RSSI Signal strength

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
AJB2K3
Posts: 11
Joined: Wed Mar 06, 2019 5:20 pm

RSSI Signal strength

Post by AJB2K3 » Thu Apr 11, 2019 5:49 pm

Sorry in advance as i'm reading the documents and not understanding.

I'm looking for a function that allows me to make an action something like

Code: Select all

If RSSI =x & ID = X
then set ID X
else
 ID = Y
I think I can work out the ID side of things but I'm confused about the RSSI side of things.

Can anyone point me to an easy to understand guide to RSSI and micropython please?

User avatar
pythoncoder
Posts: 3719
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RSSI Signal strength

Post by pythoncoder » Sat Apr 13, 2019 7:21 am

RSSI is returned by the scan function

Code: Select all

s = network.WLAN()
s.active(True)
result = s.scan()
The result is a list of tuples, one for each detected network. For entry x result[x][0] is the SSID and result[[x][3] is the RSSI in dBm. For example here my own network's SSID appears in result[1][0] so

Code: Select all

>>> result[1][3]
-67
meaning I'm getting -67dBm.
Peter Hinch

AJB2K3
Posts: 11
Joined: Wed Mar 06, 2019 5:20 pm

Re: RSSI Signal strength

Post by AJB2K3 » Sat Apr 13, 2019 3:35 pm

pythoncoder wrote:
Sat Apr 13, 2019 7:21 am
RSSI is returned by the scan function

Code: Select all

s = network.WLAN()
s.active(True)
result = s.scan()
The result is a list of tuples, one for each detected network. For entry x result[x][0] is the SSID and result[[x][3] is the RSSI in dBm. For example here my own network's SSID appears in result[1][0] so

Code: Select all

>>> result[1][3]
-67
meaning I'm getting -67dBm.
Thanks, just what I was looking for.
Thanks mate.

Post Reply