Search code examples
yoctoconnman

Duplicate wifi services


I am using Connman on a Yocto embedded linux distribution. When I run connmanctl services I see a list of my wifi services. However, I see 2 services for each one...

connmanctl> services
my-access-point wifi_02<blah-blah-blah>
my-access-point wifi_00<blah-blah-blah>

When I connect to the one beginning with wifi_00 everything works as expected. When I connect to the one beginning with wifi_02, it will never connect. Why is this? Is it hardware, is it possibly conflicting packages? Aside from these ids there's nothing different about their properties.

I am unable to provide my entire image, but for reference, I am running Connman 1.37 and wpa-supplicant 2.9 off a minimal Yocto Zeus distribution with systemd-networkd removed.


Solution

  • I too had this same problem on my Toradex SOM which, coincidentally, also uses connman version 1.37. In my case the connman services were named wifi_48e7da77e8bb_426c617a65_managed_psk and wifi_48e7da77eabb_426c617a65_managed_psk. When I attempted to connect to the "...e8bb_..." service (which was first in the connman sorted list), it never worked, but when I attempted to connect to the "...eabb_..." service, it always worked.

    When I looked at ifconfig -a told me, I discovered 48:E7:DA:77:EA:BB was the HW address of "mlan0" which I recognized to be the wifi adapter, and 48:E7:DA:77:E8:BB was the HW address of "uap0" which I didn't know what it was at first, but later discovered it to be the HW address of an access point running on the same physical wifi module.

    I also discovered that the Marvell linux driver for the wifi module has an option that gets set when it is loaded via modprobe at boot time. That option comes from this file on the target: /etc/modprobe.d/mwifiex.conf. Setting the driver_mode option to 0x01 enables station mode, and disable the access point. The Toradex Yocto recipe sets it to 3 by default which enables both STA and AP modes. I'm assuming setting it to 2 will enable only access point mode.

    After I verified that change on a running target, I added a recipe to our layers which appends the Toradex recipe with that change, and that fixed the problem.