BeagleBone Black WiFi Configuration tutorial?

10,367 views
Skip to first unread message

William C Bonner

unread,
Jun 22, 2013, 7:13:29 PM6/22/13
to beagl...@googlegroups.com
I've got a WiFi adapter that the most recent Angstrom distrivution recognizes.

I'm just using the device via SSH, and don't plan on connecting a monitor/keyboard/mouse to it.

There's no "interfaces" directory or file under /etc/network/ 

Can someone please point me to a tutorial on how I configure WiFi in this situation? 

tee....@gmail.com

unread,
Jun 23, 2013, 9:39:08 AM6/23/13
to beagl...@googlegroups.com

Wilfredo Nieves

unread,
Jun 23, 2013, 11:22:12 AM6/23/13
to beagl...@googlegroups.com

Hi William,

Since you don't plan on using a display you can ssh into the black and run:

opkg update
opkg install x11vnc
opkg install angstrom-x11vnc-xinit
reboot

And the vnc in with your vnc client of choice.

-Wil

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dale Schaafsma

unread,
Jun 24, 2013, 6:47:12 PM6/24/13
to beagl...@googlegroups.com
Hi William,
 Not sure, but I think you asked how to configure WiFi settings in Angstrom...connman (www.connman.net) is used for config.
 You need to add a new file called /var/lib/connman/wifi.config with the following (modify with your network info)

[service_home]

Type = wifi

Name = yourSSID

Security = wpa2-psk

Passphrase = yourPassPhrase

  

 Note that there have been a number of issues with various WiFi dongles..search the group for details.
 Also connman will prioritize the wired connection over WiFi. So a BBB with the cable is connected won't connect wirelessly.
 You can also use the following to scan all available access points:
/usr/lib/connman/test/test-connman services

 -Dale

William C Bonner

unread,
Jun 25, 2013, 11:22:32 PM6/25/13
to beagl...@googlegroups.com
Thanks for the feedback. I've documented the current state a little at http://wimsworld.wordpress.com/2013/06/25/beagleboneblack-wifi-configuration-problems/ where I'd gone so far as directly connecting my BBB to my monitor/keyboard/mouse and trying to enable wireless. (I tried both with and without wired ethernet connected) The "enable" button never caused any change. 

root@beaglebone:~# /usr/lib/connman/test/test-connman services
* AO Wired                      { ethernet_c8a030a62b80_cable }

no wifi was listed by that command. Would I have to disconnect the ethernet to even get it to show up? 

the command "iw list" listed the capabilities of the device, and "iw dev" produces a simple bit of information. 
root@beaglebone:~# iw dev
phy#0
        Interface wlan0
                ifindex 4
                wdev 0x1
                addr 98:fc:11:cc:ee:a1
                type managed

I've been searching for wifi references in the group, but not come up with a complete solution yet, though it seems that switching to ubuntu might make this process simpler. 

William C Bonner

unread,
Jun 26, 2013, 1:35:37 AM6/26/13
to beagl...@googlegroups.com
I was just going through the results of "dmesg" and saw the following lines..  Are they likely related to my problem?

[   13.496406] rt2800usb 1-1.1:1.0: usb_probe_interface
[   13.496441] rt2800usb 1-1.1:1.0: usb_probe_interface - got id
[   13.578417] usb 1-1.1: reset high-speed USB device number 3 using musb-hdrc
[   14.160555] ieee80211 phy0: Selected rate control algorithm 'pid'
[   14.186565] usbcore: registered new interface driver rt2800usb
[   14.218327] phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware.
[   14.282819] phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware.

Much earlier in the listing, I'd come across this, which I assumed was the initialization of the wlan0 card.

[    1.220858] usb 1-1.1: new high-speed USB device number 3 using musb-hdrc
[    1.283472] systemd[1]: systemd 196 running in system mode. (+PAM -LIBWRAP -AUDIT -SELINUX +IMA +SYSVINIT -LIBCRYPTSETUP +GCRYPT +ACL +XZ; angstrom)
[    1.313930] usb 1-1.1: default language 0x0409
[    1.320244] usb 1-1.1: udev 3, busnum 1, minor = 2
[    1.320265] usb 1-1.1: New USB device found, idVendor=13b1, idProduct=002f
[    1.320279] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.320291] usb 1-1.1: Product: Linksys AE1000
[    1.320302] usb 1-1.1: Manufacturer: Linksys
[    1.320757] usb 1-1.1: usb_probe_device
[    1.320776] usb 1-1.1: configuration #1 chosen from 1 choice
[    1.320875] usb 1-1.1: adding 1-1.1:1.0 (config #1, interface 0)

ifconfig -a shows me what I'd normally see from a downed interface.

wlan0     Link encap:Ethernet  HWaddr 98:FC:11:CC:EE:A1  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Dale Schaafsma

unread,
Jun 26, 2013, 11:49:40 AM6/26/13
to beagl...@googlegroups.com
Hi William,
 My experience is only with the Realtek rtl8188cus...which has been generally unreliable with the built-in drivers.
 That said, I suspect that your dmesg output there is due to missing firmware, I had the same problem before installing the appropriate package. Since you're using a different device, I'm not sure what package (if any) will put firmware in the correct spot. It does seem like most packages are named something like: linux-firmware*
 Maybe try googling the chipset shown by lsusb and/or the vendor/product combo (13b1:002f in your case)?

 As for the connman list..can't remember if it shows wifi when ethernet is connected, but it certainly won't connect wifi with the wired connection.

 Good luck, and sorry can't be more help,
 Dale

William C Bonner

unread,
Jun 26, 2013, 9:19:26 PM6/26/13
to beagl...@googlegroups.com
My understanding was that the firmware would be in this location. and it seems that it's already installed. 

root@beaglebone:~# opkg install kernel-module-rt2800usb
Package kernel-module-rt2800usb (3.8.13-r23a.22) installed in root is up to date.
root@beaglebone:~# opkg files kernel-module-rt2800usb
Package kernel-module-rt2800usb (3.8.13-r23a.22) is installed on root and has the following files:
/lib/modules/3.8.13/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
root@beaglebone:~# opkg info kernel-module-rt2800usb     
Package: kernel-module-rt2800usb
Version: 3.8.13-r23a.22
Depends: update-modules, kernel-module-rt2800lib, kernel-module-rt2x00lib, kernel-3.8.13, kernel-module-cfg80211, kernel-module-rfkill, kernel-module-rt2x00usb, kernel-module-mac80211
Provides:
Status: install ok installed
Section: kernel
Architecture: beaglebone
Maintainer: Angstrom Developers <angstrom-d...@linuxtogo.org>
MD5Sum: 27f98f130301ae65bb0441f2d4d18958
Size: 23738
Filename: kernel-module-rt2800usb_3.8.13-r23a.22_beaglebone.ipk
Description: linux-mainline version 3.8.13-r23a
 rt2800usb kernel module; Ralink RT2800 USB Wireless LAN driver.
Installed-Time: 1371655385

Dale Schaafsma

unread,
Jun 26, 2013, 10:43:59 PM6/26/13
to beagl...@googlegroups.com
Hi William,
 That looks like the driverinstalled correctly...I had to do something similar and install the firmware package.
 Maybe try this (I got info from http://wiki.debian.org/rt2800usb)
 opkg install firmware-ralink

 FYI the rtl8188cus firmware was installed in /lib/firmware/rtlwifi...I'd guess that the rt2800 firmware should be somewhere in /lib also
-Dale

William C Bonner

unread,
Jun 27, 2013, 10:26:58 PM6/27/13
to beagl...@googlegroups.com
Wow. I finally tried somethign that works. 

cd linux-firmware/
cp rt*.bin /lib/firmware

I unplugged and plug in my network adapter is now both recognized and UP! 
dmesg produces:
[12264.241788] usb 1-1.4: new high-speed USB device number 5 using musb-hdrc
[12264.334896] usb 1-1.4: default language 0x0409
[12264.341750] usb 1-1.4: udev 5, busnum 1, minor = 4
[12264.341804] usb 1-1.4: New USB device found, idVendor=13b1, idProduct=002f
[12264.341847] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12264.341885] usb 1-1.4: Product: Linksys AE1000
[12264.341920] usb 1-1.4: Manufacturer: Linksys
[12264.343269] usb 1-1.4: usb_probe_device
[12264.343321] usb 1-1.4: configuration #1 chosen from 1 choice
[12264.343523] usb 1-1.4: adding 1-1.4:1.0 (config #1, interface 0)
[12264.348233] rt2800usb 1-1.4:1.0: usb_probe_interface
[12264.348309] rt2800usb 1-1.4:1.0: usb_probe_interface - got id
[12264.413529] usb 1-1.4: reset high-speed USB device number 5 using musb-hdrc
[12264.526461] ieee80211 phy1: Selected rate control algorithm 'pid'
[12264.921687] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

and while I am not connected to my wifi network, the command "iw wlan0 scan" shows a portion of the networks near me, including both my 2.4GHz and 5.8GHz networks.

William C Bonner

unread,
Jun 28, 2013, 12:30:09 AM6/28/13
to beagl...@googlegroups.com
I finally managed to connect to my WiFi! I used the next line to verify that I could see my network, and copied the SSID into the wifi.config file.

iw wlan0 scan

I copied the SSID from the scanned output to the file /var/lib/connman/wifi.config so that it's contents look like:
[service_home]
Type = wifi
Name = WimsWorld-5G
Security = wpa2-psk
Passphrase = MyRealPassword

With two blank lines ending the file. Nothing is quoted. I then rebooted my machine without having the 10/100 ethernet connected. I saw some blinking on my adapter, but was not able to see the device show up in the connected devices from my router. I connect the 10/100 ethernet and log in. looking at dmesg output I saw these lines:

[   29.614314] wlan0: authenticate with 20:4e:7f:85:ce:5b
[   29.637060] wlan0: send auth to 20:4e:7f:85:ce:5b (try 1/3)
[   29.837710] wlan0: send auth to 20:4e:7f:85:ce:5b (try 2/3)
[   29.838757] wlan0: authenticated
[   29.839719] wlan0: associate with 20:4e:7f:85:ce:5b (try 1/3)
[   29.841242] wlan0: RX AssocResp from 20:4e:7f:85:ce:5b (capab=0x411 status=0 aid=2)
[   29.846048] wlan0: associated
[   29.936091] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 20:4e:7f:85:ce:5b
[   36.164316] wlan0: disassociating from 20:4e:7f:85:ce:5b by local choice (reason=3)
[   36.237355] wlan0: deauthenticating from 20:4e:7f:85:ce:5b by local choice (reason=3)

some searching on the internet related to that led me to believe that it's power management problems causing it to disconnect before it's fully finished DHCP.

root@beaglebone:~# iwconfig
wlan0     IEEE 802.11abgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
root@beaglebone:~# iwconfig wlan0 power off
root@beaglebone:~# iwconfig
wlan0     IEEE 802.11abgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

And now I remove the 10/100 cable connection and it shows up on the wireless!

run dmesg and I can see:

[  488.543241] wlan0: authenticate with 20:4e:7f:85:ce:5b
[  488.562552] wlan0: send auth to 20:4e:7f:85:ce:5b (try 1/3)
[  488.563108] wlan0: authenticated
[  488.583848] wlan0: associate with 20:4e:7f:85:ce:5b (try 1/3)
[  488.584955] wlan0: RX AssocResp from 20:4e:7f:85:ce:5b (capab=0x411 status=0 aid=2)
[  488.589590] wlan0: associated
[  488.606767] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 20:4e:7f:85:ce:5b

I had to run "opkg install wireless-tools" to get iwconfig, because it wasn't part of the standard installation.

I've entered all of this information in this thread in the hopes that it'll help someone else searching for these errors. I know that the MAC address of my router isn't all that useful, but it's what's shown in the attempts to authenticate, and it helped me to understand that the wifi.config file was getting parsed at least well enough to figure out which network I wanted to connect to.

Is there a way to disable the wifi power management in the /var/lib/conman/wifi.config file?

Dale Schaafsma

unread,
Jun 28, 2013, 12:37:43 AM6/28/13
to beagl...@googlegroups.com
Hi William,
Awesome that you've got progress!
Connman docs are pretty slim, seems you pretty much have to read the code? FYI everything I found was at connman.net

As for power everything I've seen says wifi requires a wall wart, but I presume you're already on one. There are some power management features for the CPU, but I haven't located much info yet.
-Dale

William C Bonner

unread,
Jun 28, 2013, 1:19:41 AM6/28/13
to beagl...@googlegroups.com
And I seem to found a bit of a hack to make the wifi card power management be set to off, meaning that I can boot without being physically connected to my network.

root@beaglebone:/etc/pm/power.d# cat >/etc/pm/power.d/wireless
#!/bin/sh
/sbin/iwconfig wlan0 power off
root@beaglebone:/etc/pm/power.d# chmod a+x /etc/pm/power.d/wireless 

I found a reference to this in http://ubuntuforums.org/showthread.php?t=1360901 and it seems to be working for me. 

I dug around in http://git.kernel.org/cgit/network/connman/connman.git/tree/doc?id=HEAD and especially http://git.kernel.org/cgit/network/connman/connman.git/tree/doc/config-format.txt?id=HEAD leads me to believe that there is currently nothing in connman that's going to manipulate the power management on the wifi adapter.

I'm trying to decide when I will reflash the on-board EMMC and verify that I know exactly what I've done to get wifi running with my particular adapter. A major point for me about this adapter is that I wanted to run at 5GHz. 

Now after booting, in dmesg I see:

[   21.917440] wlan0: send auth to 20:4e:7f:85:ce:5b (try 1/3)
[   21.917992] wlan0: authenticated
[   21.925273] wlan0: associate with 20:4e:7f:85:ce:5b (try 1/3)
[   21.926441] wlan0: RX AssocResp from 20:4e:7f:85:ce:5b (capab=0x411 status=0 aid=2)
[   21.931505] wlan0: associated
[   21.994996] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 20:4e:7f:85:ce:5b
[   25.140960] wlan0: disassociating from 20:4e:7f:85:ce:5b by local choice (reason=3)
[   25.222567] wlan0: deauthenticating from 20:4e:7f:85:ce:5b by local choice (reason=3)
[   50.328691] wlan0: authenticate with 20:4e:7f:85:ce:5b
[   50.400065] wlan0: send auth to 20:4e:7f:85:ce:5b (try 1/3)
[   50.400634] wlan0: authenticated
[   50.524894] wlan0: associate with 20:4e:7f:85:ce:5b (try 1/3)
[   50.526060] wlan0: RX AssocResp from 20:4e:7f:85:ce:5b (capab=0x411 status=0 aid=2)
[   50.531062] wlan0: associated
[   50.565969] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 20:4e:7f:85:ce:5b

Which leads me to believe that the power management call is actually happening between the "25" and "50" sections of the log file.

root@beaglebone:~# iwconfig
wlan0     IEEE 802.11abgn  ESSID:"WimsWorld-5G"  
          Mode:Managed  Frequency:5.18 GHz  Access Point: 20:4E:7F:85:CE:5B   
          Bit Rate=54 Mb/s   Tx-Power=17 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=33/70  Signal level=-77 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:34   Missed beacon:0



cmicali

unread,
Jun 28, 2013, 10:28:49 AM6/28/13
to beagl...@googlegroups.com
FWIW another way to handle power management is to add a file /etc/udev/rules.d/wifi_powersave_off.conf with the following contents:


ACTION
=="add", SUBSYSTEM=="net", KERNEL=="wlan*" RUN+="/usr/sbin/iw dev %k set power_save off"

Koen Kooi

unread,
Jun 28, 2013, 11:06:00 AM6/28/13
to beagl...@googlegroups.com

Op 28 jun. 2013, om 06:30 heeft William C Bonner <wimb...@gmail.com> het volgende geschreven:
>
> I had to run "opkg install wireless-tools" to get iwconfig, because it wasn't part of the standard installation.

'iwconfig' is deprecated, use 'iw', which is part of the base install. See http://wireless.kernel.org/en/users/Documentation/iw for usage tips.

William C Bonner

unread,
Jun 28, 2013, 1:19:58 PM6/28/13
to beagl...@googlegroups.com
It turns out that I didn't have things working correctly. When I powered down everything and moved it to a room closer to the access point,. the unit never came up on wireless. I'm still working on the boot-wireless scenario.

I'd been able to do most of what I wanted with iw, I'd just missed the power setting. Also, iwconfig nicely lists the current power setting as part of the status, but I'd not figured out how to see the current setting. 

After typing that, I decided to try something and feel a bit stupid.

root@beaglebone:~# /usr/sbin/iw dev wlan0 get power_save     
Power save: off
root@beaglebone:~# /usr/sbin/iw dev wlan0 set power_save on 
root@beaglebone:~# /usr/sbin/iw dev wlan0 get power_save   
Power save: on
root@beaglebone:~# /usr/sbin/iw dev wlan0 set power_save off
root@beaglebone:~# /usr/sbin/iw dev wlan0 get power_save    
Power save: off

I just now managed to get the unit to boot and connect to wireless. I'd deleted the conman-created directory /var/lib/connman/wifi_98fc11cceea1_57696d73576f726c642d3547_managed_psk/ and it's children files before I shutdown. 

Also, when I just ran /usr/sbin/iw dev wlan0 get power_save  
Power save: on

so I may have been barking up the wrong tree with the power issues.



analog...@gmail.com

unread,
Oct 13, 2013, 12:25:38 AM10/13/13
to beagl...@googlegroups.com
After spending days looking for a solution including buying a few other supposedly easier to work with wifi dongles, I've concluded:

It's easier to talk directly to the GODS than it is to get the Beaglebone Black working with Wifi with the Angstrom OR the Ubuntu images.

Seriously, this is frustrating as hell.

Gerald Coley

unread,
Oct 13, 2013, 10:28:21 AM10/13/13
to beagl...@googlegroups.com
Did you try using an extension cable on the USB dongle?

Gerald



--

yuli...@gmail.com

unread,
Oct 20, 2013, 9:06:39 PM10/20/13
to beagl...@googlegroups.com
it really works man. thanks

Sukesh

unread,
Jan 15, 2014, 3:40:43 AM1/15/14
to beagl...@googlegroups.com
Thanks for your post. I tried setting up WiFi a while back but faced the same problem...connection lost after few seconds. After turning off power-save, it works fine now.
Reply all
Reply to author
Forward
0 new messages