Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By julia freeman
#36360 Hello Alex,

I used your library in my project with ESP-201.
It works, however when in AP mode, the APname is always ESP-xxxx no matter the string you put in the call of wifiManager.autoConnect.
I copied exactly your example code as following:
if (!wifiManager.autoConnect("AutoConnectAP")) {
Serial.println("Echec de connexion et timeout atteint");
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
delay(5000);
}

and I get an AP named "ESP-xxxx" instead of "AutoConnectAP"

thank you for the good work,

julia
User avatar
By alextu
#36375 Hi Julia,
that is very weird. i don t even have any code in the lib that sets it to 'ESP-....' there is some code for 'ESP23423' without the dash, but only when the parameter is empty.
I have at times seen the old ap name used, some sort of caching the WIFi list of my Mac, but generally I could not even connect to that.
i will look some more into it, in the mean time, maybe it s worth cycling wifi on your device.
Also interesting would be to see what your serial debug says after line ""Configuring access point... ", it should give you the intended name of the AP
User avatar
By julia freeman
#36390 Hello Alex,

I looked into the wifimanager code and I thing the culprit is:
boolean WiFiManager::autoConnect() {
String ssid = "ESP" + String(ESP.getChipId());
return autoConnect(ssid.c_str());
}
Which generates an SSID starting with the string "ESP"
What I do not understand is why this part of the code is executed because I call the function :

boolean WiFiManager::autoConnect(char const *apName) {
..
}

any idea ?