Note: I assume you are running Ubuntu 12.10 in your Beaglebone.
Manual connection
First, let's check whether the Beaglebone can use the WiFi dongle by setting up a manual connection.
Before starting the test, let's install some software with the ethernet cable plugged in:
#On the beaglebone
sudo apt-get install lshw
sudo apt-get install wpasupplicant
Now unplug the Ethernet cable from the Beaglebone. And start a connection using the USB emulated Serial connection.
sudo apt-get install lshw
sudo apt-get install wpasupplicant
# On the PC
screen /dev/<ttyUSBx> 115200
Now let's check if the Beaglebone has recognized the WiFi dongle.screen /dev/<ttyUSBx> 115200
# On the beaglebone
lshw -C network
I got this:lshw -C network
*-network:1 DISABLED
description: Wireless interface
physical id: 2
bus info: usb@1:1
logical name: wlan0
serial: d8:eb:97:12:e4:c0
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rtl8192cu driverversion=3.2.33-psp26 firmware=N/A multicast=yes wireless=IEEE 802.11bgn
If you see something similar, it means your device has been detected by the Linux kernel and an appropriate driver has been loaded.description: Wireless interface
physical id: 2
bus info: usb@1:1
logical name: wlan0
serial: d8:eb:97:12:e4:c0
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rtl8192cu driverversion=3.2.33-psp26 firmware=N/A multicast=yes wireless=IEEE 802.11bgn
Remember the logical name, in this case is wlan0.
Now, turn on the WiFi dongle. (Use the logical name obtained from the last command)
# On the beaglebone
sudo ifconfig wlan0 up
sudo ifconfig wlan0 up
Blue LED indicates that the WiFi dongle has been turned ON.
Scan for visible WiFi networks.
# On the beaglebone
sudo iwlist wlan0 scanning
You should see your network in the list:sudo iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: 00:13:49:CA:F5:10
Channel:4
Frequency:2.427 GHz (Channel 4)
Quality=56/70 Signal level=-54 dBm
Encryption key:on
ESSID:"your-ssid"
...
Now, let's connect to your network.Cell 01 - Address: 00:13:49:CA:F5:10
Channel:4
Frequency:2.427 GHz (Channel 4)
Quality=56/70 Signal level=-54 dBm
Encryption key:on
ESSID:"your-ssid"
...
# On the beaglebone
sudo nano /etc/network/interfaces
Append or modify the file to include the following text (I'm assuming your network it's WEP protected):sudo nano /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wireless-essid <ssid>
wireless-key s:<ascii key>
Next, start the connectioniface wlan0 inet dhcp
wireless-essid <ssid>
wireless-key s:<ascii key>
# On the beaglebone
sudo ifup wlan0
And finally, test the connectionsudo ifup wlan0
# On the beaglebone
ping www.google.com
ping www.google.com
Congratulations, you have connected to a wireless network.
Going automatic
We'll use wpa_supplicant to automate the connections to wireless networks.
wpa_supplicant is a daemon that manages unsecure, WEP and WPA wireless connections.
wpa_supplicant stores the information about the wireless networks that it can connect to in a .conf file, usually named wpa_supplicant.conf.
You can create/edit it, using:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
This is how it should look like:
ctrl_interface=/var/run/wpa_supplicant
# Unsecure Network
network={
ssid="<ssid>"
key_mgmt=NONE
priority=<unsecure_priority>
}
# WEP Network
network={
ssid="<ssid>"
key_mgmt=NONE
wep_key0="<key>"
priority=<wep_priority>
}
# WPA Network
network={
ssid="<ssid>"
psk="<passphrase>"
priority=<wpa_priority>
}
# Unsecure Network
network={
ssid="<ssid>"
key_mgmt=NONE
priority=<unsecure_priority>
}
# WEP Network
network={
ssid="<ssid>"
key_mgmt=NONE
wep_key0="<key>"
priority=<wep_priority>
}
# WPA Network
network={
ssid="<ssid>"
psk="<passphrase>"
priority=<wpa_priority>
}
For more examples about the .conf file, check this website.
Let's reconfigure the network interface to add support for wpa_supplicant.
sudo nano /etc/network/interfaces
Change the wlan0 part to match the following text:
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Finally reboot the BeagleBone to see the changes.iface wlan0 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
sudo reboot
Done!

This comment has been removed by a blog administrator.
ReplyDeleteExcellent tutorial, thanks! I used a Edimax EW-7811Un with no problems at all.
ReplyDeleteWhich wireless dongle have you used?
ReplyDeleteHello Hyon,
DeleteFor this tutorial I used a Trendnet dongle, the model is TEW-648UBM, a.k.a. N150 Micro Wireless USB Adapter.
It's based on the rtl8192cu chipset.
can this tutorial be followed for beagle board xm rev C as well?
ReplyDeleteand one more thing is that 12.10 version is important to setup wireless connection?? cuz i have ubuntu 11.10 running on my beagle board,12.10 was quite slow so i had to change it
ReplyDeletehi can i use a wifi data stick on an Ångström image? and can u help me setup my bone on a lan network?
ReplyDelete