How to enable WiFi on i.MX8ULP using init scripts to avoid configuring WiFi on each boot?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable WiFi on i.MX8ULP using init scripts to avoid configuring WiFi on each boot?

Jump to solution
2,201 Views
Namitha_zcs
Contributor I

I have enbaled wifi on IMX8ULP to connect to an AP in station mode uisng the following commands from  the IMX linux reference manual .
modprobe moal mod_para=nxp/wifi_mod_para.conf
head -n 4 /etc/wpa_supplicant.conf > /etc/wpa_supplicant.conf.tmp
wpa_passphrase ssid password >> /etc/wpa_supplicant.conf.tmp
mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.bak
mv /etc/wpa_supplicant.conf.tmp /etc/wpa_supplicant.conf
wpa_supplicant -B -i mlan0 -c /etc/wpa_supplicant.conf -D nl80211
However,the configuration resets in every boot .How can I  enable WiFi uisng init scripts so that it starts automatically in boot? .

0 Kudos
Reply
1 Solution
2,171 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @Namitha_zcs!

Thank you for contacting NXP Support!

 

The definitive solution is create a custom startup script as a service:


Step 1: Go to etc/systemd/system

cd /etc/systemd/system


Step 2: In this directory create a new file with the name of your preference but the
extension must be .service.

The file must contain:

[Unit]
Description=”Wifi Start”
[Service]
ExecStart=sudo modprobe moal mod_para=nxp/wifi_mod_para.conf
[Install]
WantedBy=multi-user.target


Now save the file, in my case the name was wifi_start.service.


Step 3: Now we need to enable the script in the startup/boot sequence following the
command:

sudo systemctl enable wifi_start.service

 

Finally, each time you boot your board, the WIFI module will initialize automatically.

View solution in original post

0 Kudos
Reply
4 Replies
1,964 Views
atbkoad
Contributor I

This help me a lot on my recent project with iMX8ULP. I will apply it to my device later for testing.

0 Kudos
Reply
2,172 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @Namitha_zcs!

Thank you for contacting NXP Support!

 

The definitive solution is create a custom startup script as a service:


Step 1: Go to etc/systemd/system

cd /etc/systemd/system


Step 2: In this directory create a new file with the name of your preference but the
extension must be .service.

The file must contain:

[Unit]
Description=”Wifi Start”
[Service]
ExecStart=sudo modprobe moal mod_para=nxp/wifi_mod_para.conf
[Install]
WantedBy=multi-user.target


Now save the file, in my case the name was wifi_start.service.


Step 3: Now we need to enable the script in the startup/boot sequence following the
command:

sudo systemctl enable wifi_start.service

 

Finally, each time you boot your board, the WIFI module will initialize automatically.

0 Kudos
Reply
2,150 Views
Namitha_zcs
Contributor I
Thankyou for your response.
0 Kudos
Reply
2,192 Views
Joel742Bushong
Contributor I

Hello!

To enable WiFi on your IMX8ULP automatically at boot, create a custom startup script as a service. Create a file in /etc/systemd/system (e.g., wifi_start.service) with the necessary configuration, and then run sudo systemctl enable wifi_start.service to add it to the startup sequence. This will ensure the WiFi module initializes each time you boot.

0 Kudos
Reply