WEMOS Mega +WiFi R3 ATmega2560 + ESP8266

There is a way to do this, but it requires you to add an additional method into the BlynkSimpleShieldEsp8266.h library file.

Please note that I don’t condone or encourage editing the Blynk library files, these changes are made at your own risk, and may need to be replicated each time Blynk is updated

Search the BlynkSimpleShieldEsp8266.h library file for these lines:

BLYNK_LOG1(BLYNK_F("Connected to WiFi"));
return true;

immediately after return true;, but before the closing curly bracket that follows it, add these lines:

// added by PeteKnight....
        String my_ap_ststs = wifi->getNowConecAp();
        BLYNK_LOG1(my_ap_ststs);
// end of added by PeteKnight

so that it looks like this:

        BLYNK_LOG1(BLYNK_F("Connected to WiFi"));
        return true;
    
// added by PK....
        String my_ap_ststs = wifi->getNowConecAp();
        BLYNK_LOG1(my_ap_ststs);
// end of added by PK
	   }

    void config(ESP8266&    esp8266,
                const char* auth,
                const char* domain = BLYNK_DEFAULT_DOMAIN,

This has the effect of allowing you to access the getNowConecAp() command in the ESP8266.Lib file which issues the AT+CWJAP_CUR? command that returns information about your Access Point in the following response format:

+CWJAP_CUR:<ssid>,<bssid>,<channel>,<rssi>

OK

ssid is the SSID of the WiFi network that you are connected to
bssid is the MAC address of your ESP-01
channel is the WiFi channel in use
rssi is what you’re looking for, the RSSI value

You can use this new method by adding the following lines to your sketch:

  String ap_stats = wifi.getNowConecAp();
  Serial.println(ap_stats);

This prints the following to my serial monitor:

+CWJAP:"MySSID","xx:c6:8e:11:af:xx",1,-56

OK

You’ll obviously need to parse the ap_stats string to extract the RSSI field. When you do this, be aware that the “OK” preceded by a new line are part of the ap_stats string, so it’s not simply a case of taking the last few characters of the string.

Pete.

1 Like