8000 Method for getting RSSI of the currently connected AP? · Issue #2785 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Method for getting RSSI of the currently connected AP? #2785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mika-koivusaari opened this issue Jan 12, 2017 · 7 comments
Closed

Method for getting RSSI of the currently connected AP? #2785

mika-koivusaari opened this issue Jan 12, 2017 · 7 comments

Comments

@mika-koivusaari
Copy link

Currently there doesn't seem to be a method for getting rssi for currently connected ap. WLAN.scan does return rssi, but it takes some time and also return lots of unnecessary information.

I propose adding a method for getting the current rssi.

As a proof of concept I added such a method https://github.com/mika-koivusaari/micropython/tree/esp8266-rssi

But it would most probably be best to discuss before even making a pull-request. Questions that come mind are at least.

  1. What name should the method have?
    2.Should it have some standard range it returns, or should it just return whatever the underlying hw returns?
  2. Error values? Exceptions would be more pythonic than some magic value?

Comments?

@dpgeorge
Copy link
Member

Thanks for the initiative. Other contributors may chime in here, but otherwise please see #2602.

@kfricke
Copy link
Contributor
kfricke commented Feb 6, 2017

From the first glimpse this method makes only sense in the station mode interface. So that check should be added at least.

This method will most likely not make it into a general network API, because it is only valid for wireless networks.
So there should be another place i would guess. Like an additional ifconfig() method as an read-only rssi argument. On Unix the old-style ifconfig command also returns lower network layer statictics.

@mika-koivusaari
Copy link
Author

I think network.WLAN class would be a obvious place.

@kfricke
Copy link
Contributor
kfricke commented Feb 6, 2017

Of course.

@kfricke
Copy link
Contributor
kfricke commented Feb 10, 2017

...but adding an additional new method is more impact on the API than adding another keyword argument to a method which is used in a similar environment.
Even with @pfalcon's call for an RFC regarding unifying/redesigning the network API, this is of least impact and can be seen as a way to not further deface it.

@dpgeorge
Copy link
Member

As discussed in #3351, WLAN.status('rssi') is now the way to query the signal of the AP that the STA is connected to. And in c5fe610 this was implemented for esp8266.

tannewt pushed a commit to tannewt/circuitpython that referenced this issue Apr 28, 2020
STM32: adds support for stm32f746xx MCU and the nucleo_f746zg board
@Informaticore
Copy link
Informaticore commented Feb 3, 2021

@dpgeorge if I am using this I always get the same value. Am I using it wrong?

wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect(***, ***)
...
wifi.status('rssi')

I am actually calling this wifi.status('rssi') in an asyncio task every 3 seconds and it always prints the same value, no matter if I move the device or the AP. If I reboot and get a fresh connection the value changes but then stays exactly the same.
I am using an ESP32

EDIT: I just realized that the AP we are using is hidden. Maybe that helps - I tried to receive the rssi via wifi scan but apparently this ssid was not part of the scanning list - connecting to it works - so I assume it is just not part of the scan result which made the rssi value unavailable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0