From c0abe0652e4fb20f189fcb94658a95e5bbae836f Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sun, 24 Mar 2019 16:16:58 +0100 Subject: [PATCH] timesync params moved to paxcounter.conf --- include/timesync.h | 7 ++----- src/paxcounter.conf | 9 ++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) 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