SandboxElectronics / LoRaGoDOCK-Gateway

Source code for single-channel LoRaWAN Gateway based on LoRaGo DOCK (ESP8266 and SX1276)
MIT License
33 stars 14 forks source link

Add wifimanager timeout #3

Closed valerio-vaccaro closed 5 years ago

valerio-vaccaro commented 5 years ago

If you have a temporary problem with the wifi during the board boot or reboot, it will automatically turn on configuration mode enabling AP and provide a captive portal. Unfortunately the board will not try more to connect on the wifi, with pull request "Add wifimanager timeout #2" I simply added a timeout to the default wifimanager portal in order to retry (every 180 seconds) to connect to the wifi. If the temporary problem is resolved the board automatically reconnect with a maximum delay of 180 seconds.

covra commented 5 years ago

Can you explain how did you that? (Post code)

thanks

valerio-vaccaro commented 5 years ago

After the line wifiManager.autoConnect(... just set the timeout for the portal with the command wifiManager.setConfigPortalTimeout(180);. You can also watch the pull request https://github.com/SandboxElectronics/LoRaGoDOCK-Gateway/pull/2/commits/3911e7bd8cedb3de5e46ed44b5f56a28f6dbbb51

covra commented 5 years ago

Good work :+1:

valerio-vaccaro commented 5 years ago

Merged at https://github.com/SandboxElectronics/LoRaGoDOCK-Gateway/commit/fd177d16a5ae1292155891473f0027bd4c194dcc