← index #3906PR #16765
Duplicate · high · value 1.333
QUERY · ISSUE

RSSI of connected STAs from AP not working

openby treyes133opened 2018-06-29updated 2026-03-23
enhancementport-esp8266proposed-close

Howdy!

In the ESP8622 documentation (source linked below), it says that it is possible to get the RSSI of all connected STA on the AP, with network.status("stations"), however this function is not working.

Micropython version: 1.9.4-277-gab02abe9, ESP module ESP8266
Board: Adafruit Huzzah feather

The network object (ap_if) is sound, and devices can connect to the AP.

The command I am running is as follows:
ap_if.status('stations')

The error is as follows:
ValueError: Unknown status param

I have used the network.status("rssi") as a STA to get RSSI between STA and AP, and this confirmed works.

Any help is greatly appreciated.

http://docs.micropython.org/en/latest/esp8266/library/network.html#module-network

CANDIDATE · PULL REQUEST

esp8266/network_wlan: Allow enumerating connected stations in AP mode.

mergedby agattiopened 2025-02-16updated 2025-04-10
port-esp8266

Summary

This commit introduces the ability to obtain a list of stations connected to the device when in soft-AP mode.

A new parameter ("stations") to pass to WLAN.status is supported, returning a tuple of (bssid, ipv4) entries, one per connected station. An empty tuple is returned if no stations are connected, and an exception is raised if an error occurred whilst building the python objects to return to the interpreter.

Documentation is also updated to cover the new parameter.

This fixes #5395.

Testing

I've tested this code as part of a project of mine on a NodeMCU with three stations connected to it, with the expected output being returned by calling interface.status("stations"). I doubt this can be put in the CI pipeline or how this can have a test of its own.

Trade-offs and Alternatives

This comes with a small footprint increase for the general firmware configuration, however if this is unacceptable maybe I can add a port define that disables AP support in MicroPython.

Also, no idea on how wifi_softap_get_station_info behaves with a large number of stations, all possible recoverable error conditions should be handled in this PR.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied