On Wed, Oct 7, 2020 at 1:15 AM Daniel Wagner <wagi@monom.org> wrote:
On Tue, Oct 06, 2020 at 09:01:54AM -0500, KeithG wrote:
> As I see it, there are still 3 strange things going on:
> 1) the latest git will not grab an ipv4 address. I will revert that commit
> and try this again. Probably have time later this week.

Yes, please. It's the only commit which modified anything around DHCP.

> 2) the IPv6 online check still always fails (though it has a valid ipv4 and
> ipv6 address) I can connect to ipv6 addresses via ping/curl/wget and I can
> connect to it via ssh with its ipv6 address. I currently disable the online
> check and the link shows as AR and not AO.

I've still not setup an IPv6 network for testing, thus it's hard to test.

> 3) (most confounding) I am using a setting for wpa_supplicant which seems
> to work to get iwd to reconnect when the router goes down then back up.
> This setting is supposed to only work with wpa_supplicant. I am leery of
> calling this 'fixed' on my end as it is not supposed to work.

Are you referring to BackgroundScanning? This doesn't do anything for
iwd. There is literally no code in ConnMan's core nor in the iwd plugin
looking at this variable.

> On this, I wonder if it would reconnect if connman actually forced the iwd
> config setting to AutoConnect=true. Currently when connman is controlling
> iwd, the iwd config looks like this:
> [Security]
> PreSharedKey=xxxxxx
> Passphrase=password
> [Settings]
> AutoConnect=false
> I cannot edit the AutoConnect to be 'true' because connman is controlling
> it and resets it every time I try to edit it. But, without the
> BacgroundScan setting in main.conf, iwd never gets a trigger to scan after
> it has lost the connection and, therefore will never reconnect when the
> SSID reappears. When I use systemd-networkd and iwd, I can edit this iwd
> setting to true and it always reconnects. wpa_supplicant is not installed.

As I explained, ConnMan is disabling iwd's AutoConnect. When to connect
to a network is ConnMan's decision not iwd.

ConnMan doesn't need to tell iwd when to scan. The BackgroundScanning
knob was added to ConnMan because wpa_supplicant is only doing have of
the job. Please have a look at one of Marcel Holtmann's iwd
presentation, e.g.



I appreciate the link. Interesting.

It appeared to me that flag set them to always connect, but it was more complicated than that and part of that was my impatience. I think I was just not waiting long enough for it to scan.

I have made things really simple and have set up a spare router so I do not upset the family. I have a keyboard and a small display connected to the rpi so I can interact with it directly and tail the log. I am running the latest connman-git r23 with the dhcp patch reverted (so it grabs an ipv4 address) and iwd 1.9

main.conf only has
AllowHostnameUpdates = false
connman.service exec line is:

ExecStart=/usr/bin/connmand -n --nodnsproxy -d plugins/iwd.c

If I boot it always connects. If I power down the radio on the router it will reconnect eventually.
I did notice one time I got a 'Service state machine inconsistency detected' but it did reconnect after this error.

If I turn off the radio on the router then back on, I get a lag ~4 minutes before it rescans. It will re-scan and re-connects. I did this again and it took 13 minutes. I did it again and it took  ~14 minutes. It seems like it is on a schedule to trigger the scan at ~15 minutes? The 14+ minute wait for a rescan seems like a long time to me. Then I did it again and it was almost immediate. Is there any way to control this? My phone rescans almost immediately every time and reconnects.