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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,159 次查看
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 项奖励
回复
1 解答
2,129 次查看
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 项奖励
回复
4 回复数
1,922 次查看
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 项奖励
回复
2,130 次查看
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 项奖励
回复
2,108 次查看
Namitha_zcs
Contributor I
Thankyou for your response.
0 项奖励
回复
2,150 次查看
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 项奖励
回复