Wi-Fi signal strength and RSSI
The Arduino WiFi library provides us with a simple way to get the Wi-Fi signal strength in decibels ranging from 0 to -100 (minus 100). You can use the WiFi.RSSI()
function to get the radio signal strength of the currently connected network or any specified network. You can read more about Received Signal Strength Indication (RSSI) at https://en.wikipedia.org/wiki/Received_signal_strength_indication.
The WiFi.RSSI()
function can be called with following parameters:
WiFi.RSSI();
:This will return the signal strength of the currently connected Wi-Fi network.WiFi.RSSI(WiFi Access Point);
: This will return the signal strength of a specified Wi-Fi network. Wi-Fi Access Point is the name of the Wi-Fi network. For example,MyHomeWiFi
.
Reading the Wi-Fi signal strength
Now we will write an Arduino sketch to get the RSSI value of the currently connected Wi-Fi network.
- Open a new Arduino IDE and copy the sketch named
B04844_02_04.ino
from theChapter 2
sample code folder...