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,323 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,293 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
2,086 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,294 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,272 Views
Namitha_zcs
Contributor I
Thankyou for your response.
0 Kudos
Reply
2,314 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
%3CLINGO-SUB%20id%3D%22lingo-sub-2036010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20enable%20WiFi%20on%20i.MX8ULP%20using%20init%20scripts%20to%20avoid%20configuring%20WiFi%20on%20each%20boot%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036010%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20enbaled%20wifi%20on%20IMX8ULP%20to%20connect%20to%20an%20AP%20in%20station%20mode%20uisng%20the%20following%20commands%20from%26nbsp%3B%20the%20IMX%20linux%20reference%20manual%20.%3CBR%20%2F%3Emodprobe%20moal%20mod_para%3Dnxp%2Fwifi_mod_para.conf%3CBR%20%2F%3Ehead%20-n%204%20%2Fetc%2Fwpa_supplicant.conf%20%26gt%3B%20%2Fetc%2Fwpa_supplicant.conf.tmp%3CBR%20%2F%3Ewpa_passphrase%20ssid%20password%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%3Ewpa_supplicant%20-B%20-i%20mlan0%20-c%20%2Fetc%2Fwpa_supplicant.conf%20-D%20nl80211%3CBR%20%2F%3EHowever%2Cthe%20configuration%20resets%20in%20every%20boot%20.How%20can%20I%26nbsp%3B%20enable%20WiFi%20uisng%20init%20scripts%20so%20that%20it%20starts%20automatically%20in%20boot%3F%20.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2043075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20enable%20WiFi%20on%20i.MX8ULP%20using%20init%20scripts%20to%20avoid%20configuring%20WiFi%20on%20each%20boot%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2043075%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThis%20help%20me%20a%20lot%20on%20my%20recent%20project%20with%20iMX8ULP.%20I%20will%20apply%20it%20to%20my%20device%20later%20for%20testing.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036402%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20enable%20WiFi%20on%20i.MX8ULP%20using%20init%20scripts%20to%20avoid%20configuring%20WiFi%20on%20each%20boot%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036402%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThankyou%20for%20your%20response.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20enable%20WiFi%20on%20i.MX8ULP%20using%20init%20scripts%20to%20avoid%20configuring%20WiFi%20on%20each%20boot%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F246168%22%20target%3D%22_blank%22%3E%40Namitha_zcs%3C%2FA%3E!%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20contacting%20NXP%20Support!%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20definitive%20solution%20is%20create%20a%20custom%20startup%20script%20as%20a%20service%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EStep%201%3A%20Go%20to%20etc%2Fsystemd%2Fsystem%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ecd%20%2Fetc%2Fsystemd%2Fsystem%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3EStep%202%3A%20In%20this%20directory%20create%20a%20new%20file%20with%20the%20name%20of%20your%20preference%20but%20the%3CBR%20%2F%3Eextension%20must%20be%20.service.%3C%2FP%3E%0A%3CP%3EThe%20file%20must%20contain%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%5BUnit%5D%0ADescription%3D%E2%80%9DWifi%20Start%E2%80%9D%0A%5BService%5D%0AExecStart%3Dsudo%20modprobe%20moal%20mod_para%3Dnxp%2Fwifi_mod_para.conf%0A%5BInstall%5D%0AWantedBy%3Dmulti-user.target%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3ENow%20save%20the%20file%2C%20in%20my%20case%20the%20name%20was%20wifi_start.service.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EStep%203%3A%20Now%20we%20need%20to%20enable%20the%20script%20in%20the%20startup%2Fboot%20sequence%20following%20the%3CBR%20%2F%3Ecommand%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Esudo%20systemctl%20enable%20wifi_start.service%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFinally%2C%20each%20time%20you%20boot%20your%20board%2C%20the%20WIFI%20module%20will%20initialize%20automatically.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20enable%20WiFi%20on%20i.MX8ULP%20using%20init%20scripts%20to%20avoid%20configuring%20WiFi%20on%20each%20boot%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3ETo%20enable%20WiFi%20on%20your%20IMX8ULP%20automatically%20at%20boot%2C%20create%20a%20custom%20startup%20script%20as%20a%20service.%20Create%20a%20file%20in%20%2Fetc%2Fsystemd%2Fsystem%20(e.g.%2C%20wifi_start.service)%20with%20the%20necessary%20configuration%2C%20and%20then%20run%20sudo%20systemctl%20enable%20wifi_start.service%20to%20add%20it%20to%20the%20startup%20sequence.%20This%20will%20ensure%20the%20WiFi%20module%20initializes%20each%20time%20you%20boot.%3C%2FP%3E%3C%2FLINGO-BODY%3E