[OE-core] What's the "proper" way to start WiFi networking?

Mike Looijmans mike.looijmans at topic.nl
Mon May 29 07:22:59 UTC 2017


On 24-05-17 14:58, Mike Looijmans wrote:
> For boards that offer WiFi, I'd want them to connect more or less automatically.
> 
> I was wondering if there were better ways than handcrafting shell scripts to 
> do this on a headless embedded board?
> 
> 
> 
> If I put wpa-conf into /etc/network/interfaces it works, but blocks booting 
> for a long time if the wifi isn't there.
> 
> 
> I've been using ifplugd combined with wired ethernet, and this also works fine 
> with wireless. Once wpa-supplicant connects to an access point, the link 
> reports up and DCHP can start.
> 
> 
> Starting wpa_supplicant from the commandline runs fine:
> 
> /usr/sbin/wpa_supplicant -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -c 
> /etc/wpa_topic.conf -D
> 
> However, putting this line into a startup script (/etc/rc5.d/...) hangs. It 
> doesn't matter whether I start early or late, the wpa_supplicant just hangs 
> and waits and doesn't fork into daemon mode like it should. Tried setting PATH 
> and redirecting input, invoking through start-stop-daemon, but that didn't help.

Found this issue, apparently the interface is down and wpa_supplicant waits 
for it.

Adding "ifconfig wlan0 up" prior to wpa_supplicant prevents that hangup.

> 
> Appending an ampersand to the command makes the boot continue, but 
> wpa_supplicant doesn't work, it won't connect to the access point.
> 

This problem remains however. Starting interactively works fine, starting from 
any form of shell script at boot makes it start up fine but it doesn't 
connect. Starting up "wpa_cli" interactively to diagnose what's going on, but 
not actually typing any command, usually makes it connect all of a sudden.


Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans at topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail



Join our presentation at Electronics & Applications 2017:
FPGA for real-time data processing, subject “Hardware platform for industrial ultrasound steel plate Inspection” Topic Embedded Systems - Herman Kuster, 1st June 10 AM

Visit http://eabeurs.nl/author/612884/ for more information




More information about the Openembedded-core mailing list