-
Notifications
You must be signed in to change notification settings - Fork 220
How to list devices connected in AP_IF mode? #186
Comments
Presently with MicroPython, you cannot. The closest thing is |
As you point out, the status() return value is explicitly not defined, and this isn't really Returning a list of connected clients would seem reasonable, if not very self-documenting.
That way it's a bit more explicit what it's returning, and if there's some other information which doesn't fit the An alternative would be Are there AP implementations in any of the other ports? (For example, #172 Wired Ethernet Support may wish to return the PHY interface speed or whatever) |
On a related note, what's the proper format to return a MAC? For BLE, I used a |
Eric Poulsen wrote:
On a related note, what's the proper format to return a MAC? For BLE,
I used a bytes object of length 6.
That's the most sensible to my way of thinking too (my example above is
inaccurate).
If you need to expand that out for human consumption it's easy to do.
SSIDs are also a bytearray (not a unicode string or a C string, despite
appearances and common usage they aren't necessarily UTF-8 and can
contain NULs.)
|
@MrSurly were you planning on writing something for this or shall I? |
If you have the time/desire, then by all means. It's on my list, but I'm swamped. My recent PRs are more of a side effect of my current end goal; I have very little discretionary bandwidth ATM. "Pay the bills" and all that. |
Yeah, me too, I'll put it on my "low hanging fruit" list.
|
Well, the current docs are pretty vague on what status() returns: "detailed status of the interface" (what it currently says) could indeed cover returning a list of connected clients. But there's also config() which does mention "Extended status information", so something like |
See micropython/micropython#3351 for more information |
Incidentally, getting RSSI for the connected AP is easy ( There's an asynchronous process I think if we really need station RSSI we'd be better off asking the vendor to add |
(This extra information should be available in IDF 3.1 ... see referenced issue above for progress) |
(okay, looks like that's on its way, so we should be able to add RSSI soon. Thanks Espressif!) |
…us('rssi') This follows on from micropython/micropython-esp32#186
|
Is it possible to only get stations connected which got authed properly? .status('stations') unfortunately lists also devices which are trying to connect with wrong password |
I don't think so. It's up to the IDF to provide such functionality. The info it provides is:
|
Ahh too sad, would have been very handy. Would have used the pico w's WiFi to unlock an e scooter by just connecting to it's AP (then automatically turn off the AP so i am not without internet on the phone). But this way i think the only thing i could do is putting my phones mac address onto a whitelist and check for that instead. Many thanks for your replies tho |
How to list the devices that are connected to the device.
The text was updated successfully, but these errors were encountered: