connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* bug: iwd KnownNetworks AutoConnect setting desynchronizes with connman's, breaking auto connect
@ 2022-12-28 13:39 Jade Lovelace
  2023-01-02  8:35 ` Daniel Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Jade Lovelace @ 2022-12-28 13:39 UTC (permalink / raw)
  To: connman

Hi,

I have been using connman with iwd recently and I've found that the
autoconnect doesn't seem to work consistently and I often have to
manually use connmanctl to reconnect to the network.

This manifests in a strange (to me) way: the network is seen in
connmanctl but not automatically connected to. I've glanced through
the Connman iwd plugin code and it's my understanding that the actual
automatic connection when the network reappears is done by iwd, and
the Connman plugin merely sends configurations to iwd.

I can get the AutoConnect variable resynchronized by manually toggling
it with connmanctl. If I do this, when I put my machine to sleep and
open it back up, it will reconnect as expected, temporarily resolving
the issue. My assumption here is that iwd is turning AutoConnect off
for the network for some unknown reason, and connman is not accounting
for this change.

I am using connman-1.41 and iwd-2.0 on NixOS.

You can see that toggling in the below snippet:

~ » busctl get-property net.connman.iwd
/net/connman/iwd/0000000000000000_psk net.connman.iwd.KnownNetwork
AutoConnect
b false
^^^^^ ---- On connman startup, the iwd KnownNetwork has AutoConnect = false

~ » connmanctl
connmanctl> services
*A  REDACTED1            wifi_abcdefabcdef_0000000000000000_managed_psk

connmanctl> services wifi_abcdefabcdef_0000000000000000_managed_psk
/net/connman/service/wifi_abcdefabcdef_0000000000000000_managed_psk
  Type = wifi
  Security = [ psk ]
  State = idle
  Strength = 55
  Favorite = True
  Immutable = False
  AutoConnect = True
  ^^^^^ ---- However, connman thinks it is true
  Name = REDACTED1

connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
--autoconnect true
connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
--autoconnect false
connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
--autoconnect true
^^^^^ ---- If we manually toggle it back and forth, it will get synced again

~ » busctl get-property net.connman.iwd
/net/connman/iwd/0000000000000000_psk net.connman.iwd.KnownNetwork
AutoConnect
b true

Jade

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: iwd KnownNetworks AutoConnect setting desynchronizes with connman's, breaking auto connect
  2022-12-28 13:39 bug: iwd KnownNetworks AutoConnect setting desynchronizes with connman's, breaking auto connect Jade Lovelace
@ 2023-01-02  8:35 ` Daniel Wagner
  2023-01-06 19:04   ` Jade Lovelace
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Wagner @ 2023-01-02  8:35 UTC (permalink / raw)
  To: Jade Lovelace; +Cc: connman, iwd

On Wed, Dec 28, 2022 at 02:39:05PM +0100, Jade Lovelace wrote:
> Hi,
> 
> I have been using connman with iwd recently and I've found that the
> autoconnect doesn't seem to work consistently and I often have to
> manually use connmanctl to reconnect to the network.
> 
> This manifests in a strange (to me) way: the network is seen in
> connmanctl but not automatically connected to. I've glanced through
> the Connman iwd plugin code and it's my understanding that the actual
> automatic connection when the network reappears is done by iwd, and
> the Connman plugin merely sends configurations to iwd.

Yes, this is correct. ConnMan disables the auto connect state machine for iwd.

> I can get the AutoConnect variable resynchronized by manually toggling
> it with connmanctl. If I do this, when I put my machine to sleep and
> open it back up, it will reconnect as expected, temporarily resolving
> the issue. My assumption here is that iwd is turning AutoConnect off
> for the network for some unknown reason, and connman is not accounting
> for this change.

ConnMan completle relies on iwd to do the right thing, so this question is more
for the iwd developers. I don't think ConnMan should start fiddling with the
AutoConnect settings after the initial configuration.

> I am using connman-1.41 and iwd-2.0 on NixOS.
> 
> You can see that toggling in the below snippet:
> 
> ~ » busctl get-property net.connman.iwd
> /net/connman/iwd/0000000000000000_psk net.connman.iwd.KnownNetwork
> AutoConnect
> b false
> ^^^^^ ---- On connman startup, the iwd KnownNetwork has AutoConnect = false
> 
> ~ » connmanctl
> connmanctl> services
> *A  REDACTED1            wifi_abcdefabcdef_0000000000000000_managed_psk
> 
> connmanctl> services wifi_abcdefabcdef_0000000000000000_managed_psk
> /net/connman/service/wifi_abcdefabcdef_0000000000000000_managed_psk
>   Type = wifi
>   Security = [ psk ]
>   State = idle
>   Strength = 55
>   Favorite = True
>   Immutable = False
>   AutoConnect = True
>   ^^^^^ ---- However, connman thinks it is true
>   Name = REDACTED1
> 
> connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
> --autoconnect true
> connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
> --autoconnect false
> connmanctl> config wifi_abcdefabcdef_0000000000000000_managed_psk
> --autoconnect true
> ^^^^^ ---- If we manually toggle it back and forth, it will get synced again
> 
> ~ » busctl get-property net.connman.iwd
> /net/connman/iwd/0000000000000000_psk net.connman.iwd.KnownNetwork
> AutoConnect
> b true
> 
> Jade
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: iwd KnownNetworks AutoConnect setting desynchronizes with connman's, breaking auto connect
  2023-01-02  8:35 ` Daniel Wagner
@ 2023-01-06 19:04   ` Jade Lovelace
  0 siblings, 0 replies; 3+ messages in thread
From: Jade Lovelace @ 2023-01-06 19:04 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: connman, iwd

> ConnMan completle relies on iwd to do the right thing, so this question is more
> for the iwd developers. I don't think ConnMan should start fiddling with the
> AutoConnect settings after the initial configuration.

Ah, I see. Based on my look through the iwd code, I also don't see any
evidence for why it's changing, absent someone telling it to do so
over D-Bus, so I wonder what's going on there. If I have it happen
again I'll try to poke around on the iwd side some more to try to get
further information.


Jade

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-06 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 13:39 bug: iwd KnownNetworks AutoConnect setting desynchronizes with connman's, breaking auto connect Jade Lovelace
2023-01-02  8:35 ` Daniel Wagner
2023-01-06 19:04   ` Jade Lovelace

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).