1

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.

Logan
  • 181
  • 1
  • 10

1 Answers1

2

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.

Robert McLean
  • 196
  • 1
  • 8
  • Nice! I didn't realize that the 2nd part of the service string was actually the hardware address of what is providing the service. It looks like on my end I have a service point for `wlan0` and service point for `p2p0`. I'll see if I can resolve the issue with this information. This is a little bizarre anyways since these services don't appear at P2P from connman's perspective. – Logan Jun 16 '23 at 15:27
  • Upon investigation I do see the `Ethernet` map has a key `Interface`. The one case where the connection work the interface is `wlan0` and the other is `p2p0`. I think the answer to the question is... "Both are valid connections but are for different hardware interfaces. To remove the non working one the hardware must be disabled or removed. If the program which exposes these services are user facing they can be filtered based on the `Ethernet.Interface` attribute of the service." – Logan Jun 16 '23 at 15:47
  • In my case, shouldn't these p2p services show up as peers instead of services anyways? – Logan Jun 23 '23 at 16:02
  • 1
    I'm not much of a connman expert so I'm not sure I know the answer to should p2p show up as peers or services question. The p2p interface is for WiFi direct (point-2-point wifi). If you don't intend on using wifi direct, then maybe you could figure out how to disable that and those "duplicate services" will not show up. It could be that is something can disable in your device tree, or something related to the kernel driver for your wifi module. If you are going to use both wifi and wifi direct, then you might just have to do the filtering you suggested. – Robert McLean Jun 27 '23 at 18:03