Wifi manager can login without my credentials?

Hi. anyone know how this can happen.

I have a ESP32. The last thing that was installed on it, was a arduino sketch including blynk and OTA and DHT22.

now i wanted to play a little bit with Wifi manager. Downloaded the library for esp32 and uploaded the exaple sketch (se below) and changed nothing. now the device started up and connected directly to my WIFI network? how? i havn’t used it before and therefore not entered credentials. is wifi manager integrated with blynk so it stores the credentials in the same placeholder?

#if defined(ESP8266)
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#else
#include <WiFi.h>          //https://github.com/esp8266/Arduino
#endif

//needed for library
#include <DNSServer.h>
#if defined(ESP8266)
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#endif
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager


void setup() {
	// put your setup code here, to run once:
	Serial.begin(115200);

	//WiFiManager
	//Local intialization. Once its business is done, there is no need to keep it around
	WiFiManager wifiManager;
	//reset saved settings
	//wifiManager.resetSettings();

	//set custom ip for portal
	//wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));

	//fetches ssid and pass from eeprom and tries to connect
	//if it does not connect it starts an access point with the specified name
	//here  "AutoConnectAP"
	//and goes into a blocking loop awaiting configuration
	wifiManager.autoConnect("AutoConnectAP");
	//or use this for auto generated name ESP + ChipID
	//wifiManager.autoConnect();


	//if you get here you have connected to the WiFi
	Serial.println("connected...yeey :)");
}

void loop() {
	// put your main code here, to run repeatedly:

}

Yes, ESP remembers your credentials, no matter if you reloaded other sketch. The only way to avoid this is to erase flash with empty bin first.

hi.thanks for your answer.
but how wherefrom is Wifimanager getting the credentials? i’ve only used them in blynk. So to get the credentials wifimanager must use the same location in the memory as blynk. Are blynk and wifimanager related?

It doesn’t matter if you used Blynk or any other platform for previous logging to wifi, your credentials will remain in flash memory and they will be used by wifi manager. So if you want to activate wifi manager, turn off your router while powering up ESP. Wifi manager is not related to Blynk; Blynk has it’s own provisioning tool.

According to https://github.com/tzapu/WiFiManager/issues/142

WiFi.disconnect() will erase ssid/password

I think I’ve read that with the ESP32 you can overwrite/update the Wi-Fi credentials using OTA.

Pete.

Thanks for the replies. The WiFi.disconnect() did the trick.
But im still curious obout why the credentials are stored in eeprom/non volatile memorandum since wifimanager can read it from the memory. Is it for blynk own provisioning system? But again thanks, problem solved.

It is not a Blynk thing… more likely something particular with espressif design. I know my little ESP-01 always remembered my WiFi credentials even in AT mode.

Yes, it’s definitely up to ESP design, every single one from ESP01 to ESP32 stores wifi credentials at 0x7E000, it has nothing to do with Blynk/WiFi Manager. So if you want to get rid of it, erase your flash before uploading sketch.

Thanks guys for your answer. NIce to learn something everyday :smiley: :slight_smile:

A post was split to a new topic: WifiManager with ESP32