* How to elegantly engage/disengage AP mode
@ 2025-02-18 0:58 KeithG
2025-02-18 13:38 ` James Prestwood
0 siblings, 1 reply; 2+ messages in thread
From: KeithG @ 2025-02-18 0:58 UTC (permalink / raw)
To: iwd, connman
Hi. I am soliciting ideas on how to elegantly engage/disengage AP mode
when configuration is needed on a headless device.
What we do now: We use connman as our connection manager with iwd
handling wlan duties. At first boot our headless RPi based appliance
checks to see if it has a valid ethernet address on either the wlan or
the ethernet. If not, it creates an AP on a made up MAC address and
launches (with either IWD or Hostapd) an AP to allow a connection to
configure the internet. This works fine and we can use this to
configure the RPi and when we select a valid SSID with connman and
type in the password, it brings the AP down and connects to the SSID.
All good.
The problem: What happens if the SSID goes away either because we
moved the Pi or the SSID goes away? What we would like is it to scan
for a known SSID and reconnect if it finds one, (which it already
does) and if ones does not appear, to restart AP mode so we can
connect to it. If it finds an SSID while we are connecting, continue
to set up, but if the SSID reappears and no-one has connected, to then
shut down AP and re-connect to the SSID.
Question: Are there any elegant ways of doing this? We currently use
scripts and such to look at connmanctl and iwctl, but could start
digging into dbus, to monitor what is going on if needed. We thought
this may have been solved previously and wanted to ask here.
Any ideas? This seems like something that would be useful for just
about any headless internet connected device.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to elegantly engage/disengage AP mode
2025-02-18 0:58 How to elegantly engage/disengage AP mode KeithG
@ 2025-02-18 13:38 ` James Prestwood
0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2025-02-18 13:38 UTC (permalink / raw)
To: KeithG, iwd, connman
Hi Keith,
On 2/17/25 4:58 PM, KeithG wrote:
> Hi. I am soliciting ideas on how to elegantly engage/disengage AP mode
> when configuration is needed on a headless device.
>
> What we do now: We use connman as our connection manager with iwd
> handling wlan duties. At first boot our headless RPi based appliance
> checks to see if it has a valid ethernet address on either the wlan or
> the ethernet. If not, it creates an AP on a made up MAC address and
> launches (with either IWD or Hostapd) an AP to allow a connection to
> configure the internet. This works fine and we can use this to
> configure the RPi and when we select a valid SSID with connman and
> type in the password, it brings the AP down and connects to the SSID.
> All good.
>
> The problem: What happens if the SSID goes away either because we
> moved the Pi or the SSID goes away? What we would like is it to scan
> for a known SSID and reconnect if it finds one, (which it already
> does) and if ones does not appear, to restart AP mode so we can
> connect to it. If it finds an SSID while we are connecting, continue
> to set up, but if the SSID reappears and no-one has connected, to then
> shut down AP and re-connect to the SSID.
>
> Question: Are there any elegant ways of doing this? We currently use
> scripts and such to look at connmanctl and iwctl, but could start
> digging into dbus, to monitor what is going on if needed. We thought
> this may have been solved previously and wanted to ask here.
>
> Any ideas? This seems like something that would be useful for just
> about any headless internet connected device.
I'm not too sure there is anything more that IWD could really do to
support this use case. At the moment I think your main limiting factor
is trying to use command line utilities + scripts to create this
application. These tools aren't API stable and never will be so your
always going to have maintenance if something changes. DBus on the other
hand is API stable and you can rely on the APIs to stay consistent
between IWD releases.
Based on other smart devices I have used, this is what I would do:
- Device starts up, check if there are any known network profiles.
- If yes, let autoconnect do its thing. At this point your "done"
already.
- If no, start AP mode and wait for a connection/configuration.
- Have a "reset" button on the device and when pressed/held down erase
the known network profile and reboot
Doing the above you don't have to handle any special logic of the
configured AP disappearing. Once the profile is configured that is the
network and the device should connect to it unless reset.
Thanks,
James
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-18 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 0:58 How to elegantly engage/disengage AP mode KeithG
2025-02-18 13:38 ` James Prestwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox