Hi @bversluijs,
Nice to read about your progress with this.
I was recently looking at AP+STA mode support in NetworkManager - this is having one real client (STA) interface and a virtual one (AP) running on the same chip. I could make it work on my Laptop, but it was not working on a RPi 3 device. Since you are using RPi 4 you may have better luck with that. If you can make it work then you won’t need a second dongle attached to the RPi and you can optimize the logic flow of your application including the issue from your paragraph.
To do that you can run iw dev wlan0 interface add vap0 type __ap addr 12:34:56:78:ab:cd
. This will create a vap0
interface and on top of it you can create an AP NetworkManager connection profile. If that works on RPi 4 it could be helpful for your use-case. I am definitely looking at continuing to debug this on the RPi 3 and others and have it working under NetworkManager, though not having a timeline for this.
Another idea: you can possibly benefit from is using the libnm
library directly. This way you won’t have to deal with D-Bus deficiencies like changing object IDs and so on, since libnm
takes care of this internally. You can use it with NodeJS through the node-gtk package like this:
const gi = require('node-gtk');
NM = gi.require('NM, '1.0');
...
Unfortunately I could not find the node-gtk code I was experimenting with. You should be fine with using D-Bus directly though.
For reading the list of connected clients to the AP, I have looked into that before, but do not remember the exact details. I remember checking how projects like DD-WRT and OpenWRT implement it. Using iw
or the corresponding netlink calls to the kernel (the ones that iw uses internally) should be fine.
Thanks,
Zahari