Skip to content

Instantly share code, notes, and snippets.

@jeanrobertjs
Last active May 7, 2020 00:24
Show Gist options
  • Save jeanrobertjs/b291b3d5d9275516663b726d92bec1f1 to your computer and use it in GitHub Desktop.
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.
// - 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