Skip to content

Instantly share code, notes, and snippets.

@canadaduane
Created May 19, 2013 18:41
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canadaduane/5608549 to your computer and use it in GitHub Desktop.
Save canadaduane/5608549 to your computer and use it in GitHub Desktop.
BeagleBone WiFi can be manually enabled with "test-connman connect" but autoconnect fails
# Adventures In Wireless BeagleBone Black:
# What prevents my Edimax WiFi USB dongle from autoconnecting to my home WiFi network, "Catalina Island Network"?
# NOTE: If you're here to glean info for your own setup, note that I've installed the
# following two connman auxiliary packages which give the tools and test scripts in
# /usr/lib/connman/test that I use below
# $ opkg install connman-tools connman-tests
#
# Also, I've disabled power save mode for the WiFi so that the BBB can act as a server:
# $ cat > /etc/udev/rules.d/wifi_power_save.rules <<-EOF
# ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*" RUN+="/usr/sbin/iw dev %k set power_save off"
# EOF
#
# And last but not least, I created a wifi.config file in /var/lib/connman/wifi.config:
# [global]
# Name = Wifi
# Description = Home WLAN
#
# [service_wifi]
# Type=wifi
# SSID=436174616c696e612049736c616e64204e6574776f726b
# Passphrase=***
# AutoConnect=true
# Favorite=true
# boot up the beagle bone black...
# ...
# ...
# I get a prompt, yay!
localhost:website duane$ ssh root@192.168.2.3
root@192.168.2.3's password:
root@beaglebone:~# dmesg
# tail of dmesg output... I have an Edimax wifi dongle which is an rtl8192cu inside:
[ 10.666141] rtl8192cu 1-1:1.0: usb_probe_interface
[ 10.666172] rtl8192cu 1-1:1.0: usb_probe_interface - got id
[ 10.666372] rtl8192cu: Chip version 0x10
[ 11.311353] rtl8192cu: MAC address: 80:1f:02:9c:04:7f
[ 11.311388] rtl8192cu: Board Type 0
[ 11.311508] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 11.311695] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw.bin
[ 11.318886] usbcore: registered new interface driver rtl8192cu
[ 11.374675] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[ 11.376499] rtlwifi: wireless switch is on
[ 13.283662] systemd[1]: cpu-ondemand.timer: time change, recalculating next elapse.
[ 13.283847] systemd[1]: systemd-tmpfiles-clean.timer: time change, recalculating next elapse.
[ 13.302165] rtl8192cu: MAC auto ON okay!
[ 13.416375] rtl8192cu: Tx queue select: 0x05
[ 14.166138] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 27.391007] EXT4-fs (mmcblk0p2): re-mounted. Opts: commit=0
# Check to see if wlan0 is configured with an IP address (it is not):
root@beaglebone:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 80:1F:02:9C:04:7F
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)
# Check to see what wired and wireless networks connman can see:
root@beaglebone:~# /usr/lib/connman/test/test-connman services
* AO Wired { ethernet_c8a030a636e1_cable }
* A Catalina Island Network { wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk }
myqwest1194 { wifi_801f029c047f_6d79717765737431313934_managed_psk }
# Interestingly, my first attempt to connect fails (this failure occurred 1 in 5 attempts, 4 were successful right away)
root@beaglebone:~# /usr/lib/connman/test/test-connman connect wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk
net.connman.Error.Failed: Input/output error
# Check to see the network service I'm interested in is still there... (it is)
root@beaglebone:~# /usr/lib/connman/test/test-connman services
* AO Wired { ethernet_c8a030a636e1_cable }
* A Catalina Island Network { wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk }
myqwest1194 { wifi_801f029c047f_6d79717765737431313934_managed_psk }
# I make a 2nd attempt to connect, and... success!
root@beaglebone:~# /usr/lib/connman/test/test-connman connect wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk
# Notice the "* AR" in front of Catalina Island Network now... the "R" means it is now connected
root@beaglebone:~# /usr/lib/connman/test/test-connman services
* AO Wired { ethernet_c8a030a636e1_cable }
* AR Catalina Island Network { wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk }
myqwest1194 { wifi_801f029c047f_6d79717765737431313934_managed_psk }
# Just to double check, wlan0 has an IP address now.
root@beaglebone:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 80:1F:02:9C:04:7F
inet addr:192.168.0.16 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2977 (2.9 KiB) TX bytes:8536 (8.3 KiB)
# And finally, just for the sake of describing my problem, Autoconnect is set to 1 for this network (so why doesn't it autoconnect on boot?)
root@beaglebone:~# /usr/lib/connman/test/test-connman autoconnect wifi_801f029c047f_436174616c696e612049736c616e64204e6574776f726b_managed_psk
Auto connect 1 for Catalina Island Network
@dansitu
Copy link

dansitu commented Jun 13, 2013

Hey @canadaduane, did you ever figure out what was going on here? I'm seeing the exact same issue (including that my connection attempt failed the first time around but succeeded the second time).

@dansitu
Copy link

dansitu commented Jun 13, 2013

I just figured out something myself: if you disconnect the ethernet connection, wifi will autoconnect on reboot.

@adam-singer
Copy link

Ya same issue. I cant get auto connect to work even if ethernet is disconnected. I do have network over usb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment