File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,16 @@ void setup() {
131
131
localSeconds = epoch + gmtOffset_sec;
132
132
}
133
133
134
+
135
+ // XXX: Unfortunately Forcing the wifi to disconnect and then sleep can cause a random watchdog reset
136
+ // See https://github.com/esp8266/Arduino/issues/6172
137
+ // For skip the disconnect until this bug is fixed.
138
+
134
139
Serial.println (" Modem to sleep!" );
135
- WiFi.disconnect ();
140
+ // WiFi.disconnect();
136
141
WiFi.mode (WIFI_OFF);
137
142
WiFi.forceSleepBegin ();
143
+
138
144
delay (1 );
139
145
}
140
146
@@ -178,8 +184,16 @@ void loop() {
178
184
Serial.print (delaySeconds);
179
185
Serial.println (" seconds." );
180
186
181
- delay (delaySeconds * 1000 );
182
187
localSeconds += delaySeconds;
188
+ #ifdef DEBUG
189
+ while (delaySeconds-- >= 1 ) {
190
+ Serial.print (" Waiting: " );
191
+ Serial.println (delaySeconds);
192
+ delay (1000 );
193
+ }
194
+ #else
195
+ delay (delaySeconds * 1000 );
196
+ #endif
183
197
}
184
198
185
199
// send an NTP request to the time server at the given address
You can’t perform that action at this time.
0 commit comments