Checking WiFi strength?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Checking WiFi strength?

Post by liudr » Mon Jul 25, 2022 9:49 pm

I wonder if there's a simple way to check the dbm value of wifi reception on MP.

According to the doc, there's a scan() that returns a list of access points. Here is what I got:

(b'my_SSID', b'\xd8\x07\xb6\xd8\xc0/', 5, -34, 3, False)

I wonder if the -34 is the dBm. Can I get the strength of specific AP instead of using scan() or getting currently connected AP's strength? Thanks.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Checking WiFi strength?

Post by davef » Mon Jul 25, 2022 9:52 pm

Code: Select all

    try:
        rssi = sta_if.status('rssi')
        print ('RSSI = ' + str(rssi) + 'dBm')
    except:
        print ('signal level too low')

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Checking WiFi strength?

Post by liudr » Tue Jul 26, 2022 6:20 am

That works! Thank you! If I may ask, where can I find the complete official doc for wlan? Is the following it?

https://docs.micropython.org/en/latest/ ... twork.html

I thought I should look under ESP8266 and/or ESP32 but didn't realize under network library there are these very brief descriptions.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Checking WiFi strength?

Post by davef » Tue Jul 26, 2022 7:16 am


User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Checking WiFi strength?

Post by liudr » Tue Jul 26, 2022 3:03 pm

Thanks!

Post Reply