[Networkmanager] Getting connected clients in hotspot mode
Thomas Haller
thaller at redhat.com
Mon Apr 3 18:54:21 UTC 2023
hi,
On Mon, Apr 3, 2023 at 6:49 PM Guido Günther <agx at sigxcpu.org> wrote:
>
> Hi,
> when using hotspot mode in GNOME it enables ap mode on the wifi
> interface and enable dhcp via dnsmasq. Is there a way to find whether
> ther are connected clients via libnm or would you recommend looking at
> dnsmasq's leases or /proc/net/arp?
>
> The reason is that I want to be able to reenable device suspend N
> minutes after the last client disconnected:
>
> https://gitlab.gnome.org/World/Phosh/phosh/-/issues/917
Currently information about AP clients (or DHCP leases) is not exposed.
I guess, one workaround/hack could be to read the (internal)
`/var/lib/NetworkManager/dnsmasq-wlan0.leases` file.
Optimally, we add an API to make that possible. In particular, that
also then could include the number of connected clients, the age
(connection duration of each client) and how long no clients are
connected.
Thomas
More information about the Networkmanager
mailing list