On Mon, Jan 27, 2020 at 12:20 PM Daniel Wagner <wagi@monom.org> wrote:
Hi,

On Sun, Jan 26, 2020 at 09:17:43PM -0500, Torsten Wörtwein wrote:
> I have one router which broadcasts 2GHz and 5GHz on the same SSID with the
> same security settings. I also have a repeater which does exactly the same
> (2+5Ghz, same SSID as the router, and same security settings as the
> router). I have one visible entry in connman which merges all four of these
> wifis.
>
> Connman always connects to the router, even when the signal of the repeater
> is much stronger. It would be great if connman would connect to the
> stronger wifi source.
>
> I'm running ArchLinux with connman 1.37, WPA-supplicant 2.9, and kernel
> 4.19.98. Please let me know how I can provide more useful information about
> this issue.

What does connman -n -d plugins/wifi.c say about the SSIDs and the
found frequencis? ConnMan has to tell wpa_supplicant which SSID and
frequency to connect to. Though even if that is not wrong decision,
wpa_supplicant should then automatically roam to the strongest signal.

It seems to list only one frequency - only the lines containing the router's/repeater's SSID:
connmand[895]: plugins/wifi.c:get_latest_connections() ssid 726976656e64656c6c freq 5240 modified 1580175624
connmand[895]: plugins/wifi.c:add_scan_param() SSID 726976656e64656c6c added to scanned list of 1 entries
connmand[895]: plugins/wifi.c:network_added() 726976656e64656c6c_managed_psk
connmand[895]: plugins/wifi.c:network_added() 726976656e64656c6c_managed_psk

The router uses 2412/5240/5825 (5825 is from 'ASUS Smart Connect') and the repeater uses 2417/5500. I was much closer to the repeater than to the router when running "connmand -n -d plugins/wifi.c".

I also noticed, that not all SSIDs might have been listed:
connmand[895]: plugins/wifi.c:wifi_scan() max ssids 16
connmand[895]: plugins/wifi.c:add_scan_param() SSID 5265736964656e6365496e6e5f4755455354 added to scanned list of 15 entries

I see that the Scan method has a 'AllowRoam' parameter [1]. Not sure if
that needs to be set in order to let wpa_supplicant automatically
roam. At least in the current version of ConnMan we don't set it.

Thanks,
Daniel

[1] https://w1.fi/wpa_supplicant/devel/dbus.html

I would be happy to test a patch  :) I'm sorry, I'm not familiar enough with the connman code base.

Thanks,
Torsten