[Networkmanager] Getting connected clients in hotspot mode
agx at sigxcpu.org
Tue Apr 4 08:18:30 UTC 2023
On Mon, Apr 03, 2023 at 08:54:21PM +0200, Thomas Haller wrote:
> 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
That would indeed be great. I've filed
I don't expect myself to get to this short term but I've certainly put
that on my list.
More information about the Networkmanager