Put max allowed Chart files into Max_Dashboard_Chart_Files , so it gets rotated after that

limited also values to max 48 per day, gathering values for every 30 mins. this has to be enough
also with 3 charts on esp8266. more is causing problems.
This commit is contained in:
DeltaLima 2025-04-12 03:45:00 +02:00
parent a9635ccdd3
commit 1452ae298e
3 changed files with 10 additions and 4 deletions

View file

@ -63,6 +63,9 @@ const byte Max_Dashboard_Chart = 3;
#ifdef ESP32
const byte Max_Dashboard_Chart = 5;
#endif
const byte Max_Dashboard_Chart_Files = 2;
const byte Max_Dashboard_Data = 6;
/* actual structure initialization for GPIO_Index is done within the header files

View file

@ -812,9 +812,9 @@ void LFS_Chart_Rotate_Data(const byte chartId) {
/* timestamp of the oldest file allowed. Anything older gets deleted. convert to unsigned long */
#if defined(DEBUG)
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (3 * Timescale(TIMESCALE_MINUTE))), NULL, 0);
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (Max_Dashboard_Chart_Files * Timescale(TIMESCALE_MINUTE))), NULL, 0);
#else
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (3 * Timescale(TIMESCALE_DAY))), NULL, 0);
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (Max_Dashboard_Chart_Files * Timescale(TIMESCALE_DAY))), NULL, 0);
#endif
char chartDirPath[10];

View file

@ -64,10 +64,13 @@ void TimeR_Init() {
timer.setInterval(1000, Timer_Sensor);
timer.setInterval(100, Timer_Control);
//timer.setInterval(650, Timer_3s);
#if defined(DEBUG)
timer.setInterval(2500, Timer_3s);
/* 48 values per day (every 30 mins) simulated for minutes. */
timer.setInterval(1250, Timer_3s);
#else
timer.setInterval(15*60*1000, Timer_3s);
timer.setInterval(30*60*1000, Timer_3s);
#endif
}