I recently started using the BeagleBone Black (BB) for a hardware design project. I don’t have to tell you what a dynamite little board it is. An Arm pc with I/O and USB for less than $70? I’ll take 2. But I find the documentation for the Rev C board with the Debian distribution a little sparse. Most of the documents I find concern either an earlier rev of the board or the Angstrom distro, or both. In the case of getting Wi-Fi to work instructions (I found) on the web simply would not work. However, since we are using Debian getting Wi-Fi working reliably is really pretty easy. This is what I will document here.
To get started, first update your BB to use the latest Debian distro. This is well documented here — update instructions.
I am using the Debian image dated 2014-09-03.
I am also using the UWN100 USB adapter –> Compact USB Wi-Fi Adapter for BeagleBone Black . Luckily, the drivers for this device are included in the current release of Debian.
Go ahead and insert the USB Wi-Fi adapter and start the BB. It would be best to use the 5 volt adapter along with the USB connection. Login to the device as root via ssh.
First — let’s find the adapter. Issue the command:
It should give an output similar to the following:
root@beaglebone:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000 link/ether d0:39:72:4a:83:cb brd ff:ff:ff:ff:ff:ff 3: ra0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:43:00:ca:44 brd ff:ff:ff:ff:ff:ff inet 10.0.1.67/24 brd 10.0.1.255 scope global ra0 inet6 2601:9:8380:71:20c:43ff:fe00:ca44/64 scope global dynamic valid_lft 345584sec preferred_lft 345584sec inet6 fe80::20c:43ff:fe00:ca44/64 scope link valid_lft forever preferred_lft forever 4: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether c2:2e:5d:00:a5:9b brd ff:ff:ff:ff:ff:ff inet 192.168.7.2/30 brd 192.168.7.3 scope global usb0 inet6 fe80::c02e:5dff:fe00:a59b/64 scope link valid_lft forever preferred_lft forever
From this we can see that our Wi-Fi adapter is named ra0. This is a little different than what is described in most instructions on Wi-Fi. Usually the name is wlan0.
Now lets see what the status of ra0 is. Issue the command:
We should get an output something like the following:
root@beaglebone:~# iwconfig ra0 Ralink STA ESSID:"11n-AP" Nickname:"MT7601STA" Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated Bit Rate:1 Mb/s RTS thr:off Fragment thr:off Encryption key:off Link Quality=100/100 Signal level:-47 dBm Noise level:-47 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 lo no wireless extensions. eth0 no wireless extensions. usb0 no wireless extensions.
This tells us the ra0 adapter is operational, but not connected to any thing. Now all we have to do is configure the adapter to start automatically and connect to our desired network on startup. To do this we edit the /etc/network/interfaces file. Using your favorite editor, modify this the interfaces file and add the following:
iface ra0 inet dhcp
wpa-psk “your-psk passphrase”
This assumes you are using WPA2 security on your network. You are right? right? Save this and exit the editor. Next we just need to bring the interface up. Enter the following:
You should see something like this:
root@beaglebone:~# ifup ra0 Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/ra0/00:0c:43:00:ca:44 Sending on LPF/ra0/00:0c:43:00:ca:44 Sending on Socket/fallback DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 8 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 19 DHCPREQUEST on ra0 to 255.255.255.255 port 67 DHCPOFFER from 10.0.1.1 DHCPACK from 10.0.1.1 bound to 10.0.1.67 -- renewal in 3823421 seconds.
Now we are all set. We can now browse to our BB via the Wi-Fi adapter and dispense with a hardwired connection to the device.
Since we have the network starting automatically and connecting up we can add time sync via ntp. This is as easy entering the following:
apt-get install ntp.
Now your BB will have the correct time set on boot.
So there you have it. Not all that complicated once you know how. I have had very consistent results with the UWN100 adapter, so far it has started every time and doesn’t drop out on me.
Thanks for reading my very first blog post. I’ll try to get the formatting better as I blog some more. Check back to find out what I am up to with the Beagle Bone Black and other embedded devices I am using for projects.
Next up — controlling the Sain Smart four channel relay board with BoneScript.