BeagleBone: problem connecting WiFi on boot

Hi All,

I have finally managed to get my BeagleBone connect to my local network using WiFi (using Asus N10).

To make it work I have to run wpa_supplicant first to load a config file that has the details for my WiFi network.
So I run this:

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant_my_network.conf

Then I run:

/etc/init.d/networking restart

and everything works fine. It picks up an ip address and life is beautiful!

I have modified /etc/network/interfaces to this:

`

Wireless interfaces

auto wlan0
iface wlan0 inet dhcp
wireless_mode managed
wireless_essid any
wpa-driver wext
wpa**-conf /etc/wpa_supplicant_my_network.conf**
`

I do not know why not simplely restarting the networking process load wpa_supplicant.

Anyway, the goal is to get the bone connect to WiFi right after boot, without my intervention.

I tried to make a service with systemd. Here is my .service file:

`

Description=loads wpa_supplicant and restarts networking process
After=network.target

[Service]
ExecStart=/usr/myScripts/setupWifi.sh

[Install]
WantedBy=multi-user.target

`

setupWifi.sh is made of those two commands that I have to run manually :

`

#!/bin/sh
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant_my_network.conf

sleep 8
/etc/init.d/networking restart

`

It is not working. systemctl status does not show the script as failed.
I guessing it is a timing issue. It seems my script runs before the driver for the Wifi stick is loaded.

Two question:

  1. How can I run my service as the last thing that loads, or at least after the WiFi stick driver is loaded ?

  2. I have removed connman. It was hard to configure. no command line. Is there a better way of connecting to a Wifi network right after boot ? Do I have to go back to connman?

thank you

I succeeded on connman. See http://ladyada.net/products/beaglebone/wifi.html.

I even didn’t have /etc/init.d/networking file. Angstorm 2011.6.18 build.