I'm working on a sump pump monitoring project. The current version 1 uses a Boron 402 and is publishing on/off status for the pump and dry contact water levels to Adafruit.io (mqtt). I pull that into my server and process the data for hourly trends and alert on alarms. This definitely isn't scalable. It is quickly eating up data operations and cellular data (8MB in less than a week) since the pumps cycle 60-90 times an hour.
I've been testing a store and forward option using a "cheap" ESP32 over WiFi (I don't want to use up all my sandbox data while I debug the code). I collect the number of pump cycles and total time the pump is running over a 1 hour period using the standard millis formula and then trigger hourly updates.
The part I don't like is that the pump metrics are coming in one minute later every 3-4 hours. If I reset the ESP32 at noon, by 8 PM, the metrics are being sent at 2-3 minutes after the hour. BY midnight, the updates are almost 10 minutes past the hour. I'd like to send the metrics at the same time each hour.
Am I going to have the same problem with "time creep" when I reconfigure the Boron with the "store and forward" code? Is there a way to sync the Boron millis with the cellular network time so the message is always sent at the top of the hour regardless of when the Boron is powered up?
Appreciate any ideas you have,