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,346 次查看
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,316 次查看
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 回复数
2,109 次查看
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,317 次查看
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,295 次查看
Namitha_zcs
Contributor I
Thankyou for your response.
0 项奖励
回复
2,337 次查看
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 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2036010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%9C%A8%20i.MX8ULP%20%E4%B8%8A%E5%90%AF%E7%94%A8%20WiFi%EF%BC%8C%E4%BB%A5%E9%81%BF%E5%85%8D%E5%9C%A8%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E9%85%8D%E7%BD%AE%20WiFi%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E5%B7%B2%E5%9C%A8%20IMX8ULP%20%E4%B8%8A%E5%90%AF%E7%94%A8%20wifi%EF%BC%8C%E4%BB%A5%E4%BD%BF%E7%94%A8%20IMX%20linux%20%E5%8F%82%E8%80%83%E6%89%8B%E5%86%8C%E4%B8%AD%E7%9A%84%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%AB%99%E7%82%B9%E6%A8%A1%E5%BC%8F%E4%B8%8B%E7%9A%84%20AP%E3%80%82%3CBR%20%2F%3Emodprobe%20moal%20mod_para%3Dnxp%2Fwifi_mod_para.conf%3CBR%20%2F%3E%20head%20-n%204%20%2Fetc%2Fwpa_supplicant.conf%20%26gt%3B%20%2Fetc%2Fwpa_supplicant.conf.tmp%3CBR%20%2F%3Ewpa_passphrase%20ssid%20%E5%AF%86%E7%A0%81%20%26gt%3B%26gt%3B%20%2Fetc%2Fwpa_supplicant.conf.tmp%3CBR%20%2F%3Emv%20%2Fetc%2Fwpa_supplicant.conf%20%2Fetc%2Fwpa_supplicant.conf.bak%3CBR%20%2F%3Emv%20%2Fetc%2Fwpa_supplicant.conf.tmp%20%2Fetc%2Fwpa_supplicant.conf%3CBR%20%2F%3E%20wpa_supplicant%20-B%20-i%20mlan0%20-c%20%2Fetc%2Fwpa_supplicant.conf%20-D%20nl80211%3CBR%20%2F%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E9%85%8D%E7%BD%AE%E9%83%BD%E4%BC%9A%E9%87%8D%E7%BD%AE%E3%80%82%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%90%AF%E7%94%A8%20WiFi%20%E4%BB%A5%E4%BE%BF%E5%AE%83%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E8%87%AA%E5%8A%A8%E5%90%AF%E5%8A%A8%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2043075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%9C%A8%20i.MX8ULP%20%E4%B8%8A%E5%90%AF%E7%94%A8%20WiFi%EF%BC%8C%E4%BB%A5%E9%81%BF%E5%85%8D%E5%9C%A8%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E9%85%8D%E7%BD%AE%20WiFi%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2043075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%BF%99%E5%AF%B9%E6%88%91%E6%9C%80%E8%BF%91%E4%BD%BF%E7%94%A8%20iMX8ULP%20%E7%9A%84%E9%A1%B9%E7%9B%AE%E6%9C%89%E5%BE%88%E5%A4%A7%E5%B8%AE%E5%8A%A9%E3%80%82%E6%88%91%E7%A8%8D%E5%90%8E%E4%BC%9A%E5%B0%86%E5%AE%83%E5%BA%94%E7%94%A8%E5%88%B0%E6%88%91%E7%9A%84%E8%AE%BE%E5%A4%87%E4%B8%8A%E8%BF%9B%E8%A1%8C%E6%B5%8B%E8%AF%95%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036402%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%9C%A8%20i.MX8ULP%20%E4%B8%8A%E5%90%AF%E7%94%A8%20WiFi%EF%BC%8C%E4%BB%A5%E9%81%BF%E5%85%8D%E5%9C%A8%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E9%85%8D%E7%BD%AE%20WiFi%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036402%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%AC%E5%9C%A8%20i.MX8ULP%20%E4%B8%8A%E5%90%AF%E7%94%A8%20WiFi%EF%BC%8C%E4%BB%A5%E9%81%BF%E5%85%8D%E5%9C%A8%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E9%85%8D%E7%BD%AE%20WiFi%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%81%3C%2FP%3E%3CP%3E%E8%A6%81%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E8%87%AA%E5%8A%A8%E5%90%AF%E7%94%A8%20IMX8ULP%20%E4%B8%8A%E7%9A%84%20WiFi%EF%BC%8C%E8%AF%B7%E5%88%9B%E5%BB%BA%E8%87%AA%E5%AE%9A%E4%B9%89%E5%90%AF%E5%8A%A8%E8%84%9A%E6%9C%AC%E4%BD%9C%E4%B8%BA%E6%9C%8D%E5%8A%A1%E3%80%82%E5%9C%A8%20%2Fetc%2Fsystemd%2Fsystem%20%E4%B8%AD%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%8C%85%E5%90%AB%E5%BF%85%E8%A6%81%E9%85%8D%E7%BD%AE%E7%9A%84%E6%96%87%E4%BB%B6%EF%BC%88%E4%BE%8B%E5%A6%82%20wifi_start.service%EF%BC%89%EF%BC%8C%E7%84%B6%E5%90%8E%E8%BF%90%E8%A1%8C%20sudo%20systemctl%20enable%20wifi_start.service%20%E5%B0%86%E5%85%B6%E6%B7%BB%E5%8A%A0%E5%88%B0%E5%90%AF%E5%8A%A8%E5%BA%8F%E5%88%97%E4%B8%AD%E3%80%82%E8%BF%99%E5%B0%86%E7%A1%AE%E4%BF%9D%20WiFi%20%E6%A8%A1%E5%9D%97%E5%9C%A8%E6%AF%8F%E6%AC%A1%E5%90%AF%E5%8A%A8%E6%97%B6%E5%88%9D%E5%A7%8B%E5%8C%96%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E