How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by BetterAutomations » Thu Apr 13, 2017 1:41 pm

I've got a successful connection to my router using STA mode. How do I list the RSSI strength of my connection?

I had thought to do another scan and list out the RSSI from there, but that's slow. (Speed is important; I'm building a web GUI for a product to sell.) Further, sometimes there are multiple routers with the same SSID ('xfinitywifi' for example) so I want to look only at the router I'm connected to.

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by BetterAutomations » Fri Apr 14, 2017 12:39 pm

I gather by the lack of response and also by some Googling around that this is not possible. I'll just do it as I proposed: Scan all networks and pull out my SSID. Where there are multiple matches I'll use the strongest one. I may do a scan at boot up and cache the results then refer back to them as needed. Since my product will be stationary the RSSI won't change much.

skeatz
Posts: 1
Joined: Sat Apr 29, 2017 5:44 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by skeatz » Sat Apr 29, 2017 5:52 pm

After you have activated station mode, do a scan, e.g. wlan.scan(). The signal strength is one of the fields returned. If you are interested in the wifi signal strength for a specific ssid, write a loop to check for matching ssid, then extract the signal strength for that ssid.

sc

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by BetterAutomations » Sun Apr 30, 2017 3:33 pm

The down side of this method is when there are multiple APs with the same SSID such as xfinitywifi. I'm going to just choose the strongest one since that's the one most likely to be connected.

Also this method is slow. I'll just grab the list once and refer back to it later since my device will be stationary and not likely to change.

jcea
Posts: 27
Joined: Fri Mar 18, 2016 5:28 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by jcea » Thu May 11, 2017 7:31 am

I can not check just now, but do you have access to the WIFI's routers MAC addresses?

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by BetterAutomations » Thu May 11, 2017 8:07 am

On my own personal router yes, on my customer's router no.

jcea
Posts: 27
Joined: Fri Mar 18, 2016 5:28 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by jcea » Thu May 11, 2017 4:02 pm

BetterAutomations wrote:On my own personal router yes, on my customer's router no.
I am talking about the ESP8266 knowing the MAC of the router which it is connected to via WIFI. If the code has access to that information (the MAC of the currently connected router), you could filter the wifi scan.

I can not check my ESP8266 now. Out of home.

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by BetterAutomations » Sat May 13, 2017 4:27 pm

That would be a clever workaround but I don't see anywhere that I can get the MAC of the router I associate with.

kamkalian
Posts: 2
Joined: Mon Oct 29, 2018 8:14 pm

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by kamkalian » Mon Oct 29, 2018 8:31 pm

if you are connected with:
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("your_ssid")

you can get the rssi from:
wlan.status('rssi')

User avatar
Hasenradball
Posts: 15
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

Re: How do I list the RSSI (strength) of the Wi-Fi SSID I'm connected to?

Post by Hasenradball » Tue Aug 20, 2019 2:20 pm

Hello,
do I get the RSSI by wlan.status('rssi') only when I am connected?

Post Reply