BBB wifi configuration

I can’t seem to get wifi working on my BBB, and can’t find any current info online. I’m running bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img with its default kernel 4.1.15-ti-rt-r43 on a good BBB (not the broken one I wrote about in other threads). The wifi adapter is an OurLink (https://www.adafruit.com/product/1012) which works perfectly on a Raspberry Pi.

I wasn’t getting anywhere with connman so I uninstalled it and followed the instructions here (http://elinux.org/BBBWiFiConfigs#3.Modify.2Fetc.2Fnetwork.2Finterfaces_file)

etc/network/interfaces is:

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

The loopback network interface

auto lo
iface lo inet loopback

The primary network interface

auto eth0
iface eth0 inet dhcp

Example to keep MAC address between reboots

#hwaddress ether DE:AD:BE:EF:CA:FE

The secondary network interface

#auto eth1
#iface eth1 inet dhcp

WiFi Example

#auto wlan0
#iface wlan0 inet dhcp

wpa-ssid “essid”

wpa-psk “passphrase”

Ethernet/RNDIS gadget (g_ether)

Used by: /opt/scripts/boot/autoconfigure_usb0.sh

iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.252
network 192.168.7.0
gateway 192.168.7.1

/etc/wpa_supplicant/wpa_supplicant.conf is

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=“galileo”
scan_ssid=1
psk=“my router’s psk”
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

The ssid and psk in the file are correct; the router is configured to wpa2-psk and works fine for all other devices.

The wifi adapter seems to be recognized. When it’s plugged in dmesg shows:

[ 3330.645439] usb 1-1: SerialNumber: 00e04c000001
[ 3330.661745] rtl8192cu: Chip version 0x10
[ 3330.818499] rtl8192cu: MAC address: 00:e0:4c:08:ac:98
[ 3330.818618] rtl8192cu: Board Type 0
[ 3330.818858] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 3330.819108] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[ 3330.821381] ieee80211 phy4: Selected rate control algorithm ‘rtl_rc’
[ 3332.505433] rtl8192cu: MAC auto ON okay!
[ 3332.549124] rtl8192cu: Tx queue select: 0x05
[ 3333.290384] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

If I run ifup wlan0 i can get it to appear in ifconfig, but it never gets an ip address :

wlan0 Link encap:Ethernet HWaddr 00:e0:4c:08:ac:98
inet6 addr: fe80::2e0:4cff:fe08:ac98/64 Scope:Link
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)

dhclient wlan0 gets nothing.
and after running wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf I see multiple failed attempts to connect:

wlan0: SME: Trying to authenticate with fc:f5:28:fe:1b:90 (SSID=‘galileo’ freq=2422 MHz)
wlan0: Trying to associate with fc:f5:28:fe:1b:90 (SSID=‘galileo’ freq=2422 MHz)
wlan0: Associated with fc:f5:28:fe:1b:90
wlan0: CTRL-EVENT-DISCONNECTED bssid=fc:f5:28:fe:1b:90 reason=3 locally_generated=1
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid=“galileo” auth_failures=1 duration=10 reason=CONN_FAILED

I’m absolutely certain that the passphrase I entered in wpa_supplicant.conf is correct.

I see a lot of entries like this in my router’s log (NBG6503 is the router model #) which seem to coincide with dhclient trying to get an address:

NBG6503 user.notice kernel: (null)

What am I missing?

I can't seem to get wifi working on my BBB, and can't find any current info
online. I'm running bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img with
its default kernel 4.1.15-ti-rt-r43 on a good BBB (not the broken one I
wrote about in other threads). The wifi adapter is an OurLink
(https://www.adafruit.com/product/1012) which works perfectly on a Raspberry
Pi.

I wasn't getting anywhere with connman so I uninstalled it and followed the
instructions here
(http://elinux.org/BBBWiFiConfigs#3.Modify.2Fetc.2Fnetwork.2Finterfaces_file)

For wifi, just use connmanctl...

~$ sudo connmanctl

enable wifi

Enabled wifi

scan wifi

Scan completed for wifi

services

*AO Wired ethernet_74d435b65be6_cable
    Avenger wifi_14cc201db6f6_4176656e676572_managed_psk

agent on

Agent registered

connect wifi_14cc201db6f6_4176656e676572_managed_psk

Agent RequestInput wifi_14cc201db6f6_4176656e676572_managed_psk
  Passphrase = [ Type=psk, Requirement=mandatory ]

Passphrase? my password
Connected wifi_14cc201db6f6_4176656e676572_managed_psk

quit

check:

sudo ifconfig -a

Regards,

Thanks Robert. Now wlan0 is working, but if I leave the wifi adapter plugged in, it doesn’t connect again after rebooting unless I unplug and re-plug the adapter.

Also, after replugging it, resolv.conf has been rewritten by connman and no longer has the nameserver provided by the router, it just has:

Generated by Connection Manager

nameserver 127.0.0.1
nameserver ::1

so it can’t connect anywhere unless I manually edit it.

So, I don’t know why connman didn’t bring up the wifi after rebooting the first time, but now (with no changes in configuration) it’s working consistently. It doesn’t always show the ip address in the serial terminal when it boots, but it does actually bring up wlan0 or eth0, whichever is connected.

And even though resolv.conf only has

nameserver 127.0.0.1
nameserver ::1

it is able to find www hostnames.

Apparently there’s no need for the wpa_supplicant.conf file, so I removed it. I also found this helpful guide which explains that connman configurations for multiple connections can be stored in a config file in /var/lib/connman:
https://github.com/IntelOpenDesign/MakerNode/wiki/connman:-wifi-configuration
which should prove helpful.