Search

Ubilinux Intel Edison set up autostarting roaming wifi

Ubilinux Intel Edison set up autostarting roaming wifi

I have set up my Intel Edison board so that it allows wifi roaming.
For those that don’t know what that is, put simply it scans for wifi connections it recognises and automatically connects to them.

My issue was that the wifi service did not start in the first place which meant that I was forced to connect via USB, start the wifi service and then remove the USB lead.

There are a few steps to get this sorted out once and for all:
at reboot, bring up the wifi interface. This I achieved using the cron

crontab -e
Go to the bottom of this file and type in the following:

@reboot sleep 10; ifdown wlan0; ifup wlan0
Save and close the file.

The next step is to edit the wpa_supplicant file:

nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following contents (changing the information to suit your own needs):

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

# Home
network={
ssid="homewifi"
scan_ssid=1
key_mgmt=WPA-PSK
psk="homewifipass"
id_str="home"
}
# Work
network={
ssid="workwifi"
scan_ssid=1
key_mgmt=WPA-PSK
psk="workwifipass"
id_str="work"
}

Save and close the file.

Finally, edit the file /etc/network/interfaces to make it aware of the wpa_supplicant settings:

nano /etc/network/interfaces
Comment out any existing wifi parts and change it for the following:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

# At home, we want to have a static wifi IP 192.168.0.16/24 with default gateway 192.168.0.1
# Change the address etc to suit your own needs
iface home inet static
address 192.168.0.16
network 255.255.255.0
gateway 192.168.0.1

Finally, to allow the Edison to resolve domain names you need to add some DNS resolvers to the file /etc/resolv.conf:

echo "nameserver 208.67.222.222
nameserver 208.67.220.220
" > /etc/resolv.conf

Right about now you can either reboot or type in

ifdown wlan0; ifup wlan0; ping -c1 labby.co.uk
to start the wireless network and test connectivity.
If it can’t ping, wait about 10 seconds and try

ping -c1 labby.co.uk
again.

I hope this helps you :)

Related posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.