-->
Page 1 of 1

Save last WiFi settings?

PostPosted: Sat May 23, 2015 6:22 pm
by stozk
Hi,

with nodeMCU the last 2 SSID+PW Configurations get saved internally by the esp8266 and it will automatically connect.

Is this also possible with the esp8266 Arduino SDK FW?

Because there I have to call WiFi.begin(SSID, PW); but I don't want to hardcode SSID and PW.

Or do I have to write the SSID/PW to the eeprom manually?

Thanks&BR
Daniel

Re: Save last WiFi settings?

PostPosted: Mon May 25, 2015 8:52 am
by martinayotte
Yes, it does remember connection already.
What I've done is simply not calling Wifi.begin(ssid, pw) in Setup() when those are already persisted.
Then in Loop(), the wifi.status will provide the status when the persisted connection will be re-established.
In other word, I've placed the Wifi.begin(ssid, pw) in a separate WifiSetup() function and I call it only on virgin module.
I will probably do later a WebPage for it, in AT mode, like some people did to enter the ssid/pw on first connection.