Last active
May 7, 2020 00:24
-
-
Save jeanrobertjs/b291b3d5d9275516663b726d92bec1f1 to your computer and use it in GitHub Desktop.
For ESP32 Boards - Checks the signal strength of the wifi connection to the router via the RSSI value. (RSSI = Received Signal Strength Indication). When testing the signal strength, the closer the value to 0, the stronger the signal is.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// - For ESP32 Boards - | |
// Checks the signal strength of the wifi connection to the router via the RSSI value. (RSSI = Received Signal Strength Indication) | |
// When testing the signal strength, the closer the value to 0, the stronger the signal is. | |
#include "WiFi.h" | |
const char* ssid = "REPLACE_WITH_YOUR_SSID"; | |
const char* password = "REPLACE_WITH_YOUR_PASSWORD"; | |
void setup() { | |
Serial.begin(115200); | |
WiFi.begin(ssid, password); | |
while (WiFi.status() != WL_CONNECTED) { | |
delay(500); | |
Serial.print("."); | |
} | |
Serial.println(""); | |
Serial.println("WiFi connected."); | |
delay(100); | |
} | |
void loop(){ | |
Serial.print("RSSI: "); | |
Serial.println(WiFi.RSSI()); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment