Signal strength wifi

Hello community.
as part of a small project requiring a strong signal.
For a NODEMCU how to insert the function RSSI.
I tried without success.
this part of code that does not work!

// # define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid [] = "............";
char wifiPassword [] = ".....................";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username [] = "..............";
char password [] = "....................";
char clientID [] = "................";

#define VIRTUAL_CHANNEL 0 // RSSI
long rssi = WiFi.RSSI ();

void setup ()
{
   Serial.begin (9600);
   Cayenne.begin (username, password, clientID, ssid, wifiPassword);
}
void loop ()
{
   Cayenne.loop ();
  {

CAYENNE_OUT (0)
{
   Cayenne.virtualWrite (0, RSSI, "RSSI", "dbm"); delay (2000);
}

thank you in advance.

@zanni.robert you can try this code excluding the oled code GitHub - wifijt/SSID_RSSI_BSS_OLED: A simple signal strength indicator for the ESP8266 and an 128 x 32 OLED

1 Like

Bonjour shramiksalgaonkar.
I will try to clean the code.
THANK YOU
Robert