diff --git a/include/timesync.h b/include/timesync.h index 365c54c0..3d5cb059 100644 --- a/include/timesync.h +++ b/include/timesync.h @@ -6,12 +6,9 @@ #include "timesync.h" #include "timekeeper.h" -#define TIME_SYNC_SAMPLES 1 // number of time requests for averaging -#define TIME_SYNC_CYCLE 20 // delay between two time samples [seconds] -#define TIME_SYNC_TIMEOUT 120 // timeout waiting for timeserver answer [seconds] -#define TIME_SYNC_TRIGGER 100 // deviation triggering a time sync [milliseconds] +//#define TIME_SYNC_TRIGGER 100 // threshold for time sync [milliseconds] #define TIME_SYNC_FRAME_LENGTH 0x06 // timeserver answer frame length [bytes] -#define TIME_SYNC_FIXUP 30 // calibration to fixup processing time [milliseconds] +#define TIME_SYNC_FIXUP 6 // calibration to fixup processing time [milliseconds] void send_timesync_req(void); int recv_timesync_ans(uint8_t buf[], uint8_t buf_len); diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 2220a1b0..bfc98ba1 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -66,11 +66,14 @@ #define RESPONSE_TIMEOUT_MS 60000 // firmware binary server connection timeout [milliseconds] // settings for syncing time of node with external time source -#define TIME_SYNC_INTERVAL 60 // sync time attempt each .. minutes from time source (GPS/LORA/RTC) [default = 60], 0 means off -#define TIME_SYNC_COMPILEDATE 1 // set to 1 to use compile date to initialize RTC after power outage [default = 0] +#define TIME_SYNC_INTERVAL 0 // sync time attempt each .. minutes from time source (GPS/LORA/RTC) [default = 60], 0 means off +#define TIME_SYNC_COMPILEDATE 0 // set to 1 to use compile date to initialize RTC after power outage [default = 0] #define TIME_SYNC_LORAWAN 0 // set to 1 to use LORA network as time source, 0 means off [default = 0] #define TIME_SYNC_TIMESERVER 0 // set to 1 to use LORA timeserver as time source, 0 means off [default = 0] - +// settings for syncing time with timeserver applications +#define TIME_SYNC_SAMPLES 1 // number of time requests for averaging +#define TIME_SYNC_CYCLE 20 // delay between two time samples [seconds] +#define TIME_SYNC_TIMEOUT 120 // timeout waiting for timeserver answer [seconds] // time zone, see https://github.com/JChristensen/Timezone/blob/master/examples/WorldClock/WorldClock.ino #define DAYLIGHT_TIME {"CEST", Last, Sun, Mar, 2, 120} // Central European Summer Time #define STANDARD_TIME {"CET ", Last, Sun, Oct, 3, 60} // Central European Standard Time