You are not logged in.

#1 2020-02-24 10:48:04

DrFrankenstein
Member
Registered: 2015-06-30
Posts: 6

connman + iwd, connman disables autoconnect after recent update

Hello,

since the last connman update my wifi does not automatically connect anymore. I use iwd for wifi and I found out that in the files in /var/lib/iwd the AutoConnect property is set to false for every network every time connman is started. That is really annoying and I only got it to stop by disabling connman, which is also bad because then only wifi works. Does anyone else have that problem and knows how to fix it?

To clarify at the end of each file in /var/lib/iwd, there is a section like this

...

[Settings]
AutoConnect=true

after running

# systemctl start connman

is says

...

[Settings]
AutoConnect=false

and I have to change it back after stopping connman or run

[iwd]# station wlan0 known-networks <network> set-property AutoConnect true

Here is my connman config:

# /etc/connman/main.conf
[General]
DefaultAutoConnectTechnologies = ethernet,wifi
PreferredTechnologies = ethernet,wifi
NetworkInterfaceBlacklist = wwp0s20u4i6
AllowHostnameUpdates = false

Last edited by DrFrankenstein (2020-02-24 10:48:28)

Offline

#2 2020-02-24 13:42:09

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 629

Re: connman + iwd, connman disables autoconnect after recent update

Why not just ditch connman?

Setup IWD to auto connect using its internal dhcp client, and also install dhcpcd.

Then, if you need to use a wired connection just stop iwd and use dhcpcd to connect.

Offline

#3 2020-02-25 15:39:49

DrFrankenstein
Member
Registered: 2015-06-30
Posts: 6

Re: connman + iwd, connman disables autoconnect after recent update

I have thought about diction connman, but I also use connman-vpn and manually starting a dhcp client on a wired connection doesn't sound great. The whole point of using connman is that I do not have to become root to do everyday networking. So that's not the kind of solution I'm looking for.

Offline

#4 2020-02-25 23:42:40

b3n10
Member
Registered: 2018-11-03
Posts: 14

Re: connman + iwd, connman disables autoconnect after recent update

this also happened to me and downgrading connman to previous version (1.37-2) fixes the problem.

$ sudo pacman -U https://archive.archlinux.org/packages/ … pkg.tar.xz
$ sudo pacman -Q connman
connman 1.37-2

Then removed my WiFi network and re-connected using iwctl:

$ sudo rm /var/lib/iwd/MyWiFi.psk
$ iwctl station wlan0 connect-hidden MyWiFi

Reboot and works fine. smile

Offline

#5 2020-10-01 03:16:41

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: connman + iwd, connman disables autoconnect after recent update

I tried reverting to 1.37 and also got no joy.

There seems to be some strange arch interaction with the current connman (1.38) at least with iwd. I have proven with monitor-connman script that when the SSID goes away that connman sees it go away and removes the IP settings. I also see that connman sees the ssid re-appear when I use the monitor-connman script, but it will never reconnect to it. NetworkManager with iwd reconnects without issue. systemd-networkd with iwd also reconnects without issue when configured. It is connman which for sopme reason does not reconnect. I have been on the connman mail list and they claim it works on open suse and that it must be some strange Arch interaction. The Arch PKGBUILD makes only 2 minor mods to the built package 1) instead of /var/run it uses /run so it deletes the tmpfiles.d/connman config which points to /var run and then adds a minor dbus mod to deal woth connman-agent. I wonder if this is why it will not reconnect. The 'agent on' needs to be turned on to allow a connection with a password via cli, but it will reconnect at reboot as it is, currently.

I do not know where to start to look at this, but it is repeatable on x86, armv6, armv7 and aarch64 on Arch Linux. iwd is at version 1.9 and it seems to be rock solid but something seems to be interfering with connman reconnecting when the ssid goes away and returns. I have even tried the 'latest git' of connman and get the same result. Any suggestions appreciated.

Offline

#6 2020-10-02 03:16:26

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: connman + iwd, connman disables autoconnect after recent update

Still struggling with this. Tried on a laptop with an Intel card and another with a broadcom card. What happens when you run the monitor-connman script from the git repository of connmen is that connman sees the SSID go away but never triggers iwd to scan again. If I force iwd to scan it sees the network and connects. This is with connman 1.38-1 or 1.37-2. all it needs is a 'iwctl station wlano scan' and it reconnects. pronto. I do not want to have to install suse just to try it out. Any ideas?

Offline

#7 2020-10-02 12:46:43

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 629

Re: connman + iwd, connman disables autoconnect after recent update

I just set this up following..

https://wiki.archlinux.org/index.php/Co … supplicant

It works, you just have to remember to disable iwd.service.

Edit: And now I've undone all that because I prefer iwctl  + dhcpcd to control networking.

Last edited by Zod (2020-10-02 13:45:42)

Offline

#8 2020-10-02 20:12:20

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: connman + iwd, connman disables autoconnect after recent update

In case anyone gets here and ends up pulling their hair out as well. The answer is: Unless you have background scanning on in connman, it will never reconnect if the signal goes away. You can reboot and reconnect and make the interface go up and down and it will reconnect, but to get it to reconnect when it has lost signal, you must have this turned on in /etc/connman/main.conf:

BackgroundScanning = true

In addition to this, I like these settings as well:

AllowHostnameUpdates = false
AlwaysConnectedTechnologies = ethernet,wifi

the first makes sure the hostname stays as it is. Otherwise connman will try to assign it based on what DHCP tells it to.
the other makes sure that it will connect to both regardless.

On this journey, I have learned that the Arch wiki on connman is a bit out of date.
1) you do not have to have --wifi=iwd_agent set any more in the service file. You just need to uninstall wpa_supplicant or disable it.
2) the default Arch package is missing a tmpfile which causes connman to give errors and can stop networking. To fix it, you need to make this file:

/etc/tmpfiles.d/connman_resolvconf.conf
d       /run/connman    - - - -
L       /etc/resolv.conf        - - - - /run/connman/resolv.conf

When connman starts up, for some reason, it soft blocks bluetooth which can be a bit of a pain. To fix this, I add a line to the connman.service file so that it does not block bluetooth at every boot

ExecStartPost=/bin/sleep 1 ; /usr/bin/rfkill unblock bluetooth

Offline

#9 2020-10-09 18:34:37

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: connman + iwd, connman disables autoconnect after recent update

I have been corrected by the connman team. Apparently, the BackgroundScanning setting is only for wpa_supplicant and will do nothing with iwd.

Also, to keep connman from blocking the bluetooth, the 'better way' is to edit /var/lib/connman/settings

  [Bluetooth]
  Enable=true
  Tethering=false

Now, if I could only get connman to reconnect to the wifi when it is rebooted.

I have done a ton of testing of connman and iwd and it appears that it has no problem connecting at boot. That is with a broadcom card as well as an intel card. What problem I have is that if I reboot the router, it will not reconnect. If I let systemd-networkd work with iwd, it reconnects every time with the intel card. With the broadcom card, it may reconnect immediately and sometimes with a variable delay and sometimes never. Restarting connman sometimes will trigger a reconnect restarting iwd sometimes trigggers a reconnect. Re-scanning (iwctl station wlan0 scan) more often than not will not trigger a reconnect.

I really *want* connman to work like advertised, but it seems to be buggy. On the connman list, they say that 'the kernel' controls it, but I do not know what that means. When the connection goes away, what will trigger it to reconnect? dbus? That is not the kernel, is it?

If NetworkManager controls it I never have a problem, just when connman does and it is never the ethernet port, just wifi.

Once I get this all stable on x86, I want to get it stable on my RPis, but I feel that the damn broadcom card may be the show stopper.

Last edited by gearhead (2020-10-09 18:43:53)

Offline

#10 2020-10-13 14:12:28

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: connman + iwd, connman disables autoconnect after recent update

I've lost sleep and hair on this particular project...

As I said, connman/iwd is intermittent. Sometimes it works others not and I have never seen anything in the logs which indicate what the problem is. I've also pestered the connman group too much and they are at a loss as to what is happening. They use suse and see no issue. I would guess that debian x64 would behave similarly.

As a test, I grabbed the latest RaspiOS (64 bit) and installed a lite version on an RPi. Uninstalled the base networking packages and wpa_supplicant and installed connman and iwd. RaspiOS is running kernel 5.4.51 and iwd 0.14 and connman 1.36 (behind Arch). This setup worked perfectly with RaspiOS but was intermittent on Arch. Every time I turned the router radio off then back on it reconnected. I could not get it to mess up. It regained the signal so quickly that the ssh link never went down long enough to log out. That I see the same behavior on ARCH on x86_64, armv6, armv7 and aarch64 leads me to believe that there is something going on with Arch in one of the services or a kernel config or something that is keeping this from working properly.

My next steps are to build a kernel and iwd and connman for RaspiOS at the same version level as what I am running in Arch and see if the RPi still behaves.

Any hints as to what to look at are appreciated.

Offline

Board footer

Powered by FluxBB