MeshCore/examples/simple_sensor
Wessel Nieboer 5f36fde054
Allow setting RTC clock backwards and fix elapsed-time underflow
Remove the "clock cannot go backwards" restriction from all set-time
paths (CLI `time`, `clock sync`, companion radio CMD_SET_DEVICE_TIME,
and simple_secure_chat). The ESP32-S3 RTC drifts 5-10% during deep
sleep, making backwards correction necessary after even a few days.

Add safeElapsedSecs() helper in ArduinoHelpers.h that clamps elapsed
time to 0 when a stored timestamp appears to be in the future after a
clock correction. Applied to:
- Neighbor "heard X ago" displays in simple_repeater
- UI time displays in companion_radio
- TimeSeriesData calculations in simple_sensor

Switch BaseChatMesh connection expiry from RTC timestamps to monotonic
millis(), making it immune to RTC adjustments from GPS, NTP, or manual
sync. Rename last_activity to last_activity_ms to reflect the change.
2026-04-04 13:19:21 +02:00
..
main.cpp added build flag to enable/disable boot advert 2026-01-26 22:39:39 +13:00
SensorMesh.cpp Merge pull request #1297 from ViezeVingertjes/feature/duty-cycle-token-bucket 2026-03-08 23:54:32 +11:00
SensorMesh.h * version 1.14.1 2026-03-20 12:32:41 +11:00
TimeSeriesData.cpp Allow setting RTC clock backwards and fix elapsed-time underflow 2026-04-04 13:19:21 +02:00
TimeSeriesData.h * simple_sensor: added alert send queue, with retries, checks for ACKs, etc. Low pri alerts only 1 send attempt, otherwise 4 attempts 2025-07-12 12:26:16 +10:00
UITask.cpp * first cut of new simple_sensor sketch 2025-07-08 23:19:34 +10:00
UITask.h * first cut of new simple_sensor sketch 2025-07-08 23:19:34 +10:00