File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -233,12 +233,16 @@ int getRSSIasQuality(){
233233return getRSSIasQuality (WiFi .RSSI ());
234234}
235235
236-
236+ /**
237+ * [checkWifi description]
238+ * @param restart [description]
239+ */
237240void checkWifi (bool restart = false){
238241Serial .println ("[TASK] checkWiFi" );
239242if (WiFi .status () != WL_CONNECTED ){
240243if (downtime == 0 ) downtime = millis ();
241244if (restart && millis () > downtime + downtimeRestart ){
245+ // reboot
242246#ifdef USENEOIND
243247indSetColor (np_red );
244248#endif
@@ -247,11 +251,14 @@ void checkWifi(bool restart = false){
247251delay (1000 );
248252ESP .restart ();
249253 }
250- #ifdef USENEOIND
251- indSetColor (np_red );
252- #endif
253- Serial .println ("[WIFI] WiFi is Disconnected" );
254- WiFi .reconnect ();
254+ else {
255+ // reconnect
256+ #ifdef USENEOIND
257+ indSetColor (np_red );
258+ #endif
259+ Serial .println ("[WIFI] WiFi is Disconnected" );
260+ WiFi .reconnect ();
261+ }
255262 } else {
256263if (debug_wifi ){
257264Serial .println ("[WIFI] WiFi is CONNECTED" );
You can’t perform that action at this time.
0 commit comments