Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
luqmaanb opened this issue Jan 27, 2020 · 0 comments
Open

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

luqmaanb opened this issue Jan 27, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@luqmaanb
Copy link
Contributor

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.

@luqmaanb luqmaanb added the bug Something isn't working label Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant