if (wifi_manager_check_connection() == ERR_WIFI_DISCONECTED) {
wifi_manager_fetch_wifi_sta_config();
if(strlen((char*)wifi_manager_config_sta->sta.ssid) > 0) {
wifi_manager_connect_async();
} else {
ESP_LOGW("%s:[%d] - Not going to automatically connect to wifi");
// Not going retry since... esp would stop working until the next reboot
// Do something else but retry connecting
}
}
this is the code that I added to solve 2 things:
Calling to wifi_manager_fetch_wifi_sta_config() to fetch saved data to the containing structure. otherwise it would not work, we cant even continue with the configuration webpage.
the conditional snippet to prevent the same case on booting up. Without any save wifi configuration, we will not attempt to connect to a null value
Could you take a look, review and merge into master if it would not fail other cases?
i also added MQTT AirU configuration to Readme in case anyone else may need it later (other research group?). But I think leaving the mqtt_id and password is not a good idea, I'll let you decide
Hi Tom,
this is the code that I added to solve 2 things:
Could you take a look, review and merge into master if it would not fail other cases?