@@ -145,16 +145,19 @@ void sTickerCB()
145
145
#ifdef GEIGER_SDCARD
146
146
sdcard.s_tick (stick_now);
147
147
#endif
148
+ status.wifi_status = WiFi.status ();
149
+ if (status.warmup ) {
150
+ return ;
151
+ }
148
152
if (status.wifi_disabled ) {
149
153
return ;
150
154
}
155
+ if (status.wifi_status != WL_CONNECTED) {
156
+ return ;
157
+ }
151
158
#ifdef MQTTOUT
152
159
mqtt.loop (stick_now);
153
160
#endif
154
- status.wifi_status = WiFi.status ();
155
- if (status.warmup ) {
156
- return ;
157
- }
158
161
#ifdef GMCOUT
159
162
gmc.s_tick (stick_now);
160
163
#endif
@@ -205,6 +208,7 @@ void setup()
205
208
delay (250 );
206
209
pushbutton.read ();
207
210
}
211
+ delay (750 );
208
212
status.enable_oled_timeout = false ;
209
213
status.wifi_disabled = true ;
210
214
}
@@ -216,7 +220,19 @@ void setup()
216
220
}
217
221
#endif
218
222
if (!status.wifi_disabled ) {
219
- cManager.autoConnect ();
223
+ bool res = cManager.autoConnect ();
224
+ if (!res) {
225
+ #if (defined(ESPGEIGER_HW) || defined(ESPGEIGER_LT))
226
+ if (!cManager.getWiFiIsSaved ()) {
227
+ status.wifi_disabled = true ;
228
+ }
229
+ #else
230
+ Log::console (PSTR (" WiFi not connecting ... Restarting ... " ));
231
+ delay (1000 );
232
+ ESP.restart ();
233
+ #endif
234
+ }
235
+
220
236
delay (100 );
221
237
status.wifi_status = WiFi.status ();
222
238
cManager.startWebPortal ();
@@ -247,6 +263,9 @@ void setup()
247
263
status.led .Off ().Update ();
248
264
serialcmd.setup ();
249
265
hmsTicker.attach_ms (100 , hmsTickerCB);
266
+ #ifdef SSD1306_DISPLAY
267
+ status.oled_timeout = millis ();
268
+ #endif
250
269
}
251
270
252
271
void loop ()
0 commit comments