-->
Page 3 of 4

Re: Why must I use WiFi.forceSleepWake() after deep sleep?

PostPosted: Fri Dec 23, 2016 9:28 am
by chupo_cro
schufti wrote:Maybe from some earlier sketch. WiFi.persistent(false) doesn't remove allready stored credentials neither replaces them or prevents reconnect with stored values; it just does not store the actually provided ones in flash on successful connect.

Change the PW on your WiFi and see if it still reconnects at startup.

Yes, that might be the reason. I will check that but only after New Year.
schufti wrote:It is not regarding the board you use, it is the Version of ESP-Package (look in board-manager).

Thank you, I'll check that too.

Regards

Re: Why must I use WiFi.forceSleepWake() after deep sleep?

PostPosted: Fri Dec 23, 2016 9:49 am
by Pablo2048
schufti wrote:Maybe from some earlier sketch. WiFi.persistent(false) doesn't remove allready stored credentials neither replaces them or prevents reconnect with stored values; it just does not store the actually provided ones in flash on successful connect.
Change the PW on your WiFi and see if it still reconnects at startup.

IMHO WiFi.persistent(false) only direct SDK to NOT store credentials given in following WiFi.connect(). To remove already stored credentials inside SDK use WiFi.disconnect() ...

Re: Why must I use WiFi.forceSleepWake() after deep sleep?

PostPosted: Fri Dec 23, 2016 10:49 am
by schufti
ah, yes, that is exactly what I wrote; so where are the news?

and AFAIK wifi.disconnect does not clear successful credentials ...

Re: Why must I use WiFi.forceSleepWake() after deep sleep?

PostPosted: Fri Dec 23, 2016 10:55 am
by martinayotte
WiFi.disconnect will clear persisted settings only in persistent mode :

Code: Select allbool ESP8266WiFiSTAClass::disconnect(bool wifioff) {
    bool ret;
    struct station_config conf;
    *conf.ssid = 0;
    *conf.password = 0;
 
    ETS_UART_INTR_DISABLE();
    if(WiFi._persistent) {
        wifi_station_set_config(&conf);
    } else {
        wifi_station_set_config_current(&conf);
    }
    ret = wifi_station_disconnect();
    ETS_UART_INTR_ENABLE();

    if(wifioff) {
        WiFi.enableSTA(false);
    }
 
    return ret;