- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 125
Description
In #144 we fixed the return from AutoAP mode to Wifi client mode. Unfortunately this uncovered a new issue that was hidden before: when AutoAP stops due to timeout, it correctly tries to connect to Wifi client and after this fails, it will immediately start AutoAP again.
On a site without wifi, this means that AutoAP will be constantly on. It will timeout but restart immediately. This is convenient but wastes electricity on solar systems.
My expectation is that AutoAP is only tried once after reboot - when it times out and there is no wifi present, it should remain off and save power while checking if wifi gets back. If there is no wifi and you need to service the gate, you need to reboot it to get into AutoAP mode.
In my mind the logic should be:
- after reboot, try to connect to wifi
- if wifi is not present, start AutoAP one time only until timeout
- after timeout, check if wifi is available
- if no wifi, wait 15 minutes and go to 3.
This logic needs another wifi check loop and some refactoring of the code, which is a bit too much for me at this late hour in the evening. Better ideas?