[Grow:Dashboard] Sensor Data logging to LittleFS #35

Open
opened 2025-04-01 18:26:48 +02:00 by DeltaLima · 0 comments
Owner

Some sensor values would be interesting to track and visualize as timegraph on the dashboard.

Writing the sensor readings to LittleFS should be configurable in the sensor calibration (because there is every reading present) or as Option within the dashboard settings.

Data on LittleFS could be stored like

| 
| data/
| -- [sensorID]/
|     -- [readingId]/
|         -- [YYYYMMDD].csv

the csv would contain two columns, timestamp and value (float)

1743523193,4.20
1743526793,4.10
1743530393,4.42

Appending the file every hour would be enought imho. This could be a timer beginning from startup time , or something which executes exactly at full hour. I guess the first option is the easiest to implement and should be taken for the beginning.

Keeping 7 days of data would be enough i guess. This could be configurable.

Filename schema is YYYYMMDD.

To cleanup old files, we can just check if(20250329 < 20250401). To calculate this date string of the oldest file, we can do something like datestring_oldest = year(now() - (60*60*24*7)) + month(now() - (60*60*24*7)) + day(now() - (60*60*24*7))

Some sensor values would be interesting to track and visualize as timegraph on the dashboard. Writing the sensor readings to LittleFS should be configurable in the sensor calibration (because there is every reading present) or as Option within the dashboard settings. Data on LittleFS could be stored like ``` | | data/ | -- [sensorID]/ | -- [readingId]/ | -- [YYYYMMDD].csv ``` the csv would contain two columns, timestamp and value (float) ```csv 1743523193,4.20 1743526793,4.10 1743530393,4.42 ``` Appending the file every hour would be enought imho. This could be a timer beginning from startup time , or something which executes exactly at full hour. I guess the first option is the easiest to implement and should be taken for the beginning. Keeping 7 days of data would be enough i guess. This could be configurable. Filename schema is `YYYYMMDD`. To cleanup old files, we can just check `if(20250329 < 20250401)`. To calculate this date string of the oldest file, we can do something like `datestring_oldest = year(now() - (60*60*24*7)) + month(now() - (60*60*24*7)) + day(now() - (60*60*24*7))`
DeltaLima added this to the v0.2.0 Release milestone 2025-04-01 18:26:48 +02:00
DeltaLima added the
enhancement
v0.2.x
labels 2025-04-01 18:26:48 +02:00
DeltaLima added this to the CanGrow Firmware project 2025-04-01 18:26:48 +02:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DeltaLima/CanGrow#35
No description provided.