BeagleBone and USB Wifi Adapter

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mattrichardson
 
Posts: 8
Joined: Tue Sep 28, 2010 3:13 pm

BeagleBone and USB Wifi Adapter

Post by mattrichardson »

Hello!

I'm trying to take one of my BeagleBone projects wireless with the USB Wifi adapter. I followed Ladyada's tutorial to install the firmware package and I rebooted, but dmesg shows me this when I connect the Wifi device:

Code: Select all

[  122.270388] usb 1-1.1: new high-speed USB device number 5 using musb-hdrc
[  122.371485] usb 1-1.1: New USB device found, idVendor=0bda, idProduct=8176
[  122.371504] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  122.371520] usb 1-1.1: Product: 802.11n WLAN Adapter
[  122.371531] usb 1-1.1: Manufacturer: 802.11n WLPN Adapter
[  122.371542] usb 1-1.1: SerialNumber: 00e04c000001
According to the tutorial, I should see this:
Image
I don't see anything like that. ifcongfig doesn't show wlan0. I think this has to do with the fact that I followed a tutorial to disable connman so that I could use this project on a wired network that required a static IP. I've been editing /etc/network/interfaces to change network settings. Is there a way I can get this working without connman? Even any guesses as to approaches I can take would be appreciated. I could go back to using connman, but I'm hoping that I can avoid that.

Thanks!
Matt Richardson
http://mattrichardson.com/

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

have you verified it works with a stock config Bone?

User avatar
mattrichardson
 
Posts: 8
Joined: Tue Sep 28, 2010 3:13 pm

Re: BeagleBone and USB Wifi Adapter

Post by mattrichardson »

Here's my play-by-play of trying to get this going. I hope it helps: I used a fresh BeagleBone A5 with the 2/14/2012 image on it. I connected to it via SSH, installed the drivers with opkg, typed reboot, but then couldn't connect via SSH anymore. USR LED 0 showed a heartbeat, but the green light on the Ethernet port blinked on for a quick instant every 20 seconds or so, but was off most of the time (as opposed to being on most of the time and flickering now and then). I let it sit for a 3 minutes, but still couldn't connect.

I pulled the power cord and reinserted it. Reboot took a while, but I got a regular light on the Ethernet port eventually. dmesg showed:

Code: Select all

[    0.802675] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[    0.802693] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[   37.897322] EXT4-fs (mmcblk0p2): recovery complete
[   38.140925] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   38.140996] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
BUT! I did see the right stuff in dmesg:

Code: Select all

[   43.651103] rtl8192cu: MAC address: 00:9e:95:9b:40:57
[   43.651142] rtl8192cu: Board Type 0
and then a few lines down:

Code: Select all

[   46.292273] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
[   46.342126] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[   46.343174] usbcore: registered new interface driver rtl8192cu
Great! I carried on with the tutorial, modifying the config files and setting up the SSID, password, etc. Restarted connman with "systemctl restart connman.service" and got a blinking cursor for at least five minutes. Thinking I reset my ethernet connection as well, I opened a new SSH session to connect to the BB, but could not connect via IP or beaglebone.local.

Pulled the power cord again and reinserted it. I could log in via ssh now, so I tried to pick up where I left off on the tutorial:

Code: Select all

root@beaglebone:~# ifconfig wlan0
ifconfig: wlan0: error fetching interface information: Device not found
Tried dmesg. Saw this:

Code: Select all

[    0.641461] rtl8150: v0.6.2 (2004/08/27):rtl8150 based usb-ethernet driver
[    0.641515] usbcore: registered new interface driver rtl8150
There are no lines referencing the MAC address or rtlwifi. I pulled USB Wifi dongle out. My SSH session locked up, didn't respond to keypresses. Tried to open new SSH session to the board. Couldn't. Tried again after 3 minutes... still nothing. Ethernet light looked normal. Was it possible that I had connected via Wifi before? Probably not since it said wlan0 was not found. Pulled the power cord. Inserted Wifi module. Reinserted power. Connected via ssh. ran dmesg. saw:

Code: Select all

[   12.997138] usbcore: registered new interface driver rtl8192cu
[   13.043019] rtl8192cu: MAC auto ON okay!
[   13.081947] rtl8192cu: Tx queue select: 0x05
[   13.083258] rtl8192c_common: Loading firmware file rtlwifi/rtl8192cufw.bin
[   13.771644] ADDRCONF(NETDEV_UP): wlan0: link is not ready
"ifconfig wlan0" returns:

Code: Select all

wlan0     Link encap:Ethernet  HWaddr 00:9E:95:9B:40:57  
          UP 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)
Gave it a couple minutes. Same result from dmesg and ifconfig. I'm thought, my SSID has spaces in it, which might be a problem, so I put quotation marks around the SSID in /var/lib/connman/wifi.config. Restarted connman, which happened fast. Dmesg showed:

Code: Select all

[  430.011274] ip_tables: (C) 2000-2006 Netfilter Core Team
[  430.161863] rtl8192cu: MAC auto ON okay!
[  430.184319] rtl8192cu: Tx queue select: 0x05
[  430.185664] rtl8192c_common: Loading firmware file rtlwifi/rtl8192cufw.bin
[  430.720649] ADDRCONF(NETDEV_UP): wlan0: link is not ready
And still no IP in ifconfig. Same results after a 2 minute wait. Tried single quote marks around the SSID. Restarted connman. Same results. Taking a different approach. Installed wireless tools with "opkg install wireless-tools."

Code: Select all

root@beaglebone:~# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off
Checked out what was going on in /etc/network/interfaces and saw:

Code: Select all

# Wireless interfaces
iface wlan0 inet dhcp
        wireless_mode managed
        wireless_essid any
        wpa-driver wext
        wpa-conf /etc/wpa_supplicant.conf
I followed that to check out what was going on in /etc/wpa_supplicant.conf. Saw a spot to add SSID and password, so I tried that. Rebooted the beaglebone. Weird ethernet light issue. pulled power. Reconnected. SSH in works again. But there's Nothing about wlan0 in dmesg or ifconfig. Rebooted again. Now ifconfig shows wlan0, but still no IP.

I'm taking a break from this for a while. I feel like I'm getting close, like I just need to get the settings right for my network, but I'm also concerned about the reliability since the device doesn't seem to show up sometimes.

Matt

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

i would connect thru serial for some of this. for example, a long boot time often means its doing the once-every-10-boot FSCK run which can take 5 minutes. if you pull the plug in the middle that can only make any problems worse

kcasey42
 
Posts: 4
Joined: Mon Jun 11, 2012 9:56 pm

Re: BeagleBone and USB Wifi Adapter

Post by kcasey42 »

Thank you for any thoughts you have about this problem.
--
I'm having similar problems getting the Adafruit USB WiFi dongle to connect.
Testing with another Unix box shows that the dongle works.
I connect to the Beaglebone using SSH.
WLAN0 does not come up reliably. shutdown -r +1 doesn't seem sufficient.
I have the greatest luck with a power cycle immediately followed by the reset button.
Here are the important parts:
# uname -a gives
Linux beaglebone 3.2.14 #1 Mon Apr 9 12:21:19 CEST 2012 armv7l GNU/Linux

# the end of the dmesg data shows
[ 2.300863] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2
[ 2.300974] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 2.300989] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.301003] usb usb2: Product: MUSB HDRC host driver
[ 2.301014] usb usb2: Manufacturer: Linux 3.2.14 musb-hcd
[ 2.301025] usb usb2: SerialNumber: musb-hdrc.0
[ 2.302956] hub 2-0:1.0: USB hub found
[ 2.302983] hub 2-0:1.0: 1 port detected
[ 3.421537] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 4.317071]
[ 4.317079] CPSW phy found : id is : 0x7c0f1
[ 4.323898] PHY 0:01 not found
[ 4.327961] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 4.450673] cfg80211: Calling CRDA to update world regulatory domain
[ 5.431570] rtl8192cu: MAC address: 00:9e:95:9b:3c:ae
[ 5.431609] rtl8192cu: Board Type 0
[ 7.226910] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 7.311181] PHY: 0:00 - Link is Up - 100/Full
[ 7.311378] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 7.939466] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[ 7.940431] usbcore: registered new interface driver rtl8192cu
[ 9.467307] rtl8192cu: MAC auto ON okay!
[ 9.510150] rtl8192cu: Tx queue select: 0x05
[ 9.511458] rtl8192c_common: Loading firmware file rtlwifi/rtl8192cufw.bin
[ 10.045373] ADDRCONF(NETDEV_UP): wlan0: link is not ready

# ifconfig wlan0 gives
wlan0 Link encap:Ethernet HWaddr 00:9E:95:9B:3C:AE
UP 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)
**But there is no connect to the access point!
Are there any log files that could help troubleshoot?

# lsmod gives
Module Size Used by
arc4 1131 2
rtl8192cu 73389 0
rtl8192c_common 53190 1 rtl8192cu
rtlwifi 57396 1 rtl8192cu
mac80211 146560 3 rtl8192cu,rtl8192c_common,rtlwifi
cfg80211 122995 2 rtlwifi,mac80211
ip_tables 7830 0
x_tables 14348 1 ip_tables
g_mass_storage 24018 0
rfcomm 24259 0
ircomm_tty 14073 0
ircomm 8407 1 ircomm_tty
irda 85557 2 ircomm_tty,ircomm
hidp 10152 0
bluetooth 109654 4 rfcomm,hidp
rfkill 14605 3 cfg80211,bluetooth
ipv6 210442 18

# more /var/lib/connman/settings gives
[global]
OfflineMode=false
[WiFi]
Enable=true
[Bluetooth]
Enable=false
[Wired]
Enable=true
[Cellular]
Enable=false
[WiMAX]
Enable=false

# more /var/lib/connman/wifi.config gives
[service_home]
Type = wifi
Name = servicenamewithnoquotesnospaces
Security = wpa
Passphrase = "Mixedcase Withspaces Indoublequotes"

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

so it always finds the Wifi, it just doesn't always connect to your router?

kcasey42
 
Posts: 4
Joined: Mon Jun 11, 2012 9:56 pm

Re: BeagleBone and USB Wifi Adapter

Post by kcasey42 »

Correct. The wlan0 device is typically registered, as shown below.
connman is the active agent.
No connection occurs and then dmesg shows the repeated warnings about a blocked process.
Are there log files anywhere?
Thanks.
[ 7.939466] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[ 7.940431] usbcore: registered new interface driver rtl8192cu
[ 9.467307] rtl8192cu: MAC auto ON okay!
[ 9.510150] rtl8192cu: Tx queue select: 0x05
[ 9.511458] rtl8192c_common: Loading firmware file rtlwifi/rtl8192cufw.bin
[ 10.045373] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 2400.110555] INFO: task kworker/u:0:5 blocked for more than 120 seconds.
[ 2400.117465] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2400.125665] kworker/u:0 D c0291cfd 0 5 2 0x00000000

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

sounds like connman might be having problems - but we dont know where the logs are. there are probably scripts around for checking if a wifi connection went down and if so, bring it back up - check google!

kcasey42
 
Posts: 4
Joined: Mon Jun 11, 2012 9:56 pm

Re: BeagleBone and USB Wifi Adapter

Post by kcasey42 »

I still can not duplicate the successful installation of the Adafruit USB WiFI dongle demonstrated in the tutorial at
http://ladyada.net/products/beaglebone/wifi.html. Unfortunately, the tutorial does not document the precise boot image used as the starting point.

For this new Beaglebone board and WiFi dongle, should I get the following startup complaints?
Thanks.
...
[ 0.651647] ThumbEE CPU extension supported.
[ 0.651721] mux: Failed to setup hwmod io irq -22
[ 0.652429] omap2_set_init_voltage: unable to get clk dpll1_ck
[ 0.658524] omap2_set_init_voltage: unable to set vdd_mpu_iva
[ 0.664593] omap2_set_init_voltage: unable to get clk l3_ick
[ 0.670516] omap2_set_init_voltage: unable to set vdd_core
[ 0.676240] Power Management for AM33XX family
[ 0.680069] registered taskstats version 1
...

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

kcasey, which A version of the Bone do you have?

kcasey42
 
Posts: 4
Joined: Mon Jun 11, 2012 9:56 pm

Re: BeagleBone and USB Wifi Adapter

Post by kcasey42 »

Code: Select all

[    0.248352] Board name: A335BONE
[    0.248362] Board version: 00A5
[    0.248370] The board is a AM335x Beaglebone.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: BeagleBone and USB Wifi Adapter

Post by adafruit »

What step fails?

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”