neaxi/hw_projects

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
    • 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?
  • 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