Commit 4639a9f
committed
Detect dropped network connection
Check networkStatus() in mqttStatus() before attempting to reconnect MQTT. Fail quickly to avoid the ~20 seconds for MQTT connect attempts to timeout.
Allow run() to return if the MQTT connection is down, without any other action. The calling sketch can then check network status, etc. to fix the problem. Checking mqttStatus() once per loop() is enough to allow it to retry the MQTT connection when needed.
#991 parent 23985c6 commit 4639a9f
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
0 commit comments