box_monitor: history data from sensors while offline
Opened this issue · 0 comments
neaxi commented
When the board can't reach the network (unavailable SSID) should we cache the sensor data and upload them all once the connectivity restores?
Possible approach
- implement buffer
- limit size / how much historical values will be stored
- there should be some sort of a limit to prevent memory exhaustion, otherwise we won't have enough memory to initiate HTTPS connection (see micropython/micropython-esp32#209 (comment))
- must record timestamp when the entry was recorded
- how to tell the API the measurement was taken at a different time than time of upload?
- limit size / how much historical values will be stored
- once the connectivity restores, start processing buffered data
- while the buffered data are being processed, keep adding current measurements to the buffer
- example:
- data are measured once per 60 sec
- API throttling is set to 15 sec
- we can't upload everything prior next measurement interval
- parallel threads?
- one handling data upload and one that keeps measuring current events