Connman and WiFi setup

I am new to connman, so this might be a basic question. I am trying to setup the WL8 WiFi cape with a BBB. I am using recent console image and kernel:

hk@wbct1:~$ uname -a
Linux wbct1 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015 armv7l GNU/Linux
hk@wbct1:~$ cat /etc/dogtag
rcn-ee.net console Debian Image 2015-11-13

With the right device tree loaded, the cape works after configuring connman. The problem is that WiFi does not connect after a reboot. I have to manually run “connmanctl connect wifi_blah”. After that, things work normally. I can use ifconfig up/down to change state without using connmanctl. It’s only after a (re)boot that it does not autoconnect. I have autoconnect turned on for the AP I am using the settings file contents below:

[wifi_blahmacaddr_6d67_managed_none]
Name=mg
SSID=6d67
Frequency=2452
Favorite=true
AutoConnect=true
Modified=2016-01-06T19:57:30.299409Z
IPv4.method=dhcp
IPv4.DHCP.LastAddress=192.168.1.104
IPv6.method=auto
IPv6.privacy=disabled
Config.file=wifi
Config.ident=service_home

Ethernet is attached and it does connect on (re)boot.

Mark, did you ever solve this? If so, how? I’m having the same problem but with a USB WiFi dongle. It worked fine with the old method of editing /etc/network/interfaces and installing the wifi-reset service. But I’ve upgraded to Debian 8.6 for the beaglebone and the old method doesn’t work any more. As you say it connects just fine with connmanctl, but doesn’t reconnect after a reboot, even with “config wifi__ autoconnect on”. Nor does the old wifi-reset service solve the problem.
https://learn.adafruit.com/setting-up-wifi-with-beaglebone-black/configuration#wifi-reset-service

This post I wrote in June needs to be refreshed, but the wifi part I believe is still correct:

https://www.ccoderun.ca/programming/2016-06-29_BBGW/index.html#wifi

See if this helps you get up and running correctly.

Stéphane

Thanks Stéphane. I believe what you have is equivalent to the instructions that appear as comments in the /etc/network/interfaces file that ships with Debian 8.6. They connect OK, but the connection is not re-established after a reboot, despite adding the command “config wifi_ autoconnect on”. The full set of commands I used was:

#connmanctl
#connmanctl> tether wifi disable
#connmanctl> enable wifi
#connmanctl> scan wifi
#connmanctl> services
#connmanctl> config wifi_managed_psk autoconnect on
#connmanctl> agent on
#connmanctl> connect wifi
_managed_psk
#connmanctl> quit

The * above corresponds to two great long strings of hex digits separated by an underscore, which you obtain by looking at the output of the “services” command, to the right of the SSID you want. Fortunately tab-completion works for those.

But after a reboot the WiFi service does not come up. I read a theory that this is because the connman service runs too early, e.g. before the USB hardware is initialised.

My friend Mike Van Emmerik came up with a way to make it work. We installed the WiFi Reset Sevice as described here:
https://learn.adafruit.com/setting-up-wifi-with-beaglebone-black/configuration#wifi-reset-service
but before running install.sh we edited wifi-reset.sh so it only does:

sleep 30
connmanctl connect wifi_*_managed_psk

where * is the same string of hex-digits and underscore as above.

This made the WiFi connection re-establish after a reboot, but only if we unlpugged our wired ethernet connection! I would love a solution to this last remaining problem.