fix WiFiSpi on empty config

This commit is contained in:
arovak 2020-05-29 23:11:31 +02:00
parent 08d793c848
commit 8d32de4cc6

View File

@ -181,12 +181,14 @@ void wifiSetup()
} }
// attempt to connect to Wifi network // attempt to connect to Wifi network
int status = WL_IDLE_STATUS; // the Wifi radio's status // int status = WL_IDLE_STATUS; // the Wifi radio's status
if(!wifiShowAP()) {
// while (status != WL_CONNECTED) { // while (status != WL_CONNECTED) {
Log.notice(F("WIFI: Connecting to : %s"), wifiSsid); Log.notice(F("WIFI: Connecting to : %s"), wifiSsid);
// Connect to WPA/WPA2 network // Connect to WPA/WPA2 network
status = WiFi.begin(wifiSsid, wifiPassword); // status = WiFi.begin(wifiSsid, wifiPassword);
WiFi.begin(wifiSsid, wifiPassword);
}
// } // }
#else #else
@ -214,7 +216,9 @@ void wifiSetup()
bool wifiEvery5Seconds() bool wifiEvery5Seconds()
{ {
#if defined(STM32F4xx) #if defined(STM32F4xx)
if(WiFi.status() == WL_CONNECTED) { if(wifiShowAP()) { // no ssid is set yet wait for user on-screen input
return false;
} else if(WiFi.status() == WL_CONNECTED) {
#else #else
if(WiFi.getMode() != WIFI_STA) { if(WiFi.getMode() != WIFI_STA) {
return false; return false;