Skip to content

Does not reconnect to WiFi on CW02 if provisioning was omitted #3

@luqmaanb

Description

@luqmaanb

bool xProvision::getWiFi(String &ssid, String &psk)
{
if ((_ssid[0] == '\0') || (_pwd[0] == '\0'))
{
return false;
}
ssid = _ssid;
psk = _pwd;
return true;
}

Reviewing the source code, it doesn't seem the the ssid and password is being read from the json config file saved in SPIFFS. The _ssid and _pwd variables are not assigned elsewhere in the library and thus getWiFi() always returns false. Executing WiFi.begin(ssid.c_str(), password.c_str()) in the example won't reconnect to the WiFi on ESP32 since its just an empty string whereas ESP8266 reconnects because when parsing an empty string in the function it reconnects to the last known WiFi. The implementation is different for the two cores.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions