From 037bb371843f68ad510ec5c0a505367fdc4d187c Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Tue, 4 Jun 2024 18:29:35 +0700 Subject: [PATCH 1/2] Change macro name `SERVER_CONFIG_UPDATE_INTERVAL' to `SERVER_CONFIG_SYNC_INTERVAL` --- examples/BASIC/BASIC.ino | 4 ++-- examples/OneOpenAir/OneOpenAir.ino | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/BASIC/BASIC.ino b/examples/BASIC/BASIC.ino index ea1bb1b1..524d0a8d 100644 --- a/examples/BASIC/BASIC.ino +++ b/examples/BASIC/BASIC.ino @@ -41,7 +41,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License #define LED_BAR_COUNT_INIT_VALUE (-1) /** */ #define LED_BAR_ANIMATION_PERIOD 100 /** ms */ #define DISP_UPDATE_INTERVAL 5000 /** ms */ -#define SERVER_CONFIG_UPDATE_INTERVAL 30000 /** ms */ +#define SERVER_CONFIG_SYNC_INTERVAL 30000 /** ms */ #define SERVER_SYNC_INTERVAL 60000 /** ms */ #define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */ #define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */ @@ -82,7 +82,7 @@ bool hasSensorPMS = true; bool hasSensorSHT = true; int pmFailCount = 0; int getCO2FailCount = 0; -AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, +AgSchedule configSchedule(SERVER_CONFIG_SYNC_INTERVAL, updateServerConfiguration); AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer); AgSchedule dispSchedule(DISP_UPDATE_INTERVAL, dispHandler); diff --git a/examples/OneOpenAir/OneOpenAir.ino b/examples/OneOpenAir/OneOpenAir.ino index e3a09bd1..640af600 100644 --- a/examples/OneOpenAir/OneOpenAir.ino +++ b/examples/OneOpenAir/OneOpenAir.ino @@ -55,7 +55,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License #define LED_BAR_ANIMATION_PERIOD 100 /** ms */ #define DISP_UPDATE_INTERVAL 2500 /** ms */ -#define SERVER_CONFIG_UPDATE_INTERVAL 15000 /** ms */ +#define SERVER_CONFIG_SYNC_INTERVAL 15000 /** ms */ #define SERVER_SYNC_INTERVAL 60000 /** ms */ #define MQTT_SYNC_INTERVAL 60000 /** ms */ #define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */ @@ -118,7 +118,7 @@ static void displayExecuteOta(OtaState state, String msg, int processing); AgSchedule dispLedSchedule(DISP_UPDATE_INTERVAL, oledDisplayLedBarSchedule); -AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, +AgSchedule configSchedule(SERVER_CONFIG_SYNC_INTERVAL, configurationUpdateSchedule); AgSchedule agApiPostSchedule(SERVER_SYNC_INTERVAL, sendDataToServer); AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update); From f7e811e34baf2e839a46fd3b454092fb9bc61b32 Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Tue, 4 Jun 2024 18:30:33 +0700 Subject: [PATCH 2/2] Update server GET configure period to `60` sec --- examples/BASIC/BASIC.ino | 2 +- examples/OneOpenAir/OneOpenAir.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/BASIC/BASIC.ino b/examples/BASIC/BASIC.ino index 524d0a8d..eed48180 100644 --- a/examples/BASIC/BASIC.ino +++ b/examples/BASIC/BASIC.ino @@ -41,7 +41,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License #define LED_BAR_COUNT_INIT_VALUE (-1) /** */ #define LED_BAR_ANIMATION_PERIOD 100 /** ms */ #define DISP_UPDATE_INTERVAL 5000 /** ms */ -#define SERVER_CONFIG_SYNC_INTERVAL 30000 /** ms */ +#define SERVER_CONFIG_SYNC_INTERVAL 60000 /** ms */ #define SERVER_SYNC_INTERVAL 60000 /** ms */ #define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */ #define SENSOR_TVOC_UPDATE_INTERVAL 1000 /** ms */ diff --git a/examples/OneOpenAir/OneOpenAir.ino b/examples/OneOpenAir/OneOpenAir.ino index 640af600..dbd1385d 100644 --- a/examples/OneOpenAir/OneOpenAir.ino +++ b/examples/OneOpenAir/OneOpenAir.ino @@ -55,7 +55,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License #define LED_BAR_ANIMATION_PERIOD 100 /** ms */ #define DISP_UPDATE_INTERVAL 2500 /** ms */ -#define SERVER_CONFIG_SYNC_INTERVAL 15000 /** ms */ +#define SERVER_CONFIG_SYNC_INTERVAL 60000 /** ms */ #define SERVER_SYNC_INTERVAL 60000 /** ms */ #define MQTT_SYNC_INTERVAL 60000 /** ms */ #define SENSOR_CO2_CALIB_COUNTDOWN_MAX 5 /** sec */