jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.67k stars 612 forks source link

Connects to pool.ntp.org but local ntp server defined in config #113

Closed szabocs closed 3 years ago

szabocs commented 3 years ago

My esp32cam running rolling version installed yesterday connects to pool.ntp.org every second despite the fact that in the config file a local ntp server is defined by ip address.

My config:

[MakeImage] ;LogImageLocation = /log/source ;LogfileRetentionInDays = 2 WaitBeforeTakingPicture = 5 ImageQuality = 5 ImageSize = VGA Brightness = 0

[Alignment] InitialRotate = 100 /config/ref0.jpg 233 104 /config/ref1.jpg 162 308 SearchFieldX = 20 SearchFieldY = 20 AlignmentAlgo = Default

[Digits] Model = /config/dig0721s1.tflite LogImageLocation = /log/digit LogfileRetentionInDays = 2 ModelInputSize = 20 32 digit1 182 152 30 54 digit2 223 152 30 54 digit3 262 152 30 54 digit4 302 152 30 54 digit5 340 152 30 54 digit6 380 152 21 54 digit7 412 152 21 54 digit7 441 152 24 54

;[Analog] ;Model = /config/ana0630s2.tflite ;LogImageLocation = /log/analog ;LogfileRetentionInDays = 3 ;ModelInputSize = 32 32

[PostProcessing] DecimalShift = -3 PreValueUse = true PreValueAgeStartup = 720 AllowNegativeRates = false MaxRateValue = 0.1 ErrorMessage = true CheckDigitIncreaseConsistency = false

[MQTT] Uri = mqtt://192.168.xx.xxx:1xxx Topic = w/m TopicError = w/e ;ClientID = wasser ;user = USERNAME ;password = PASSWORD

[AutoTimer] AutoStart = true Intervall = 10

[Debug] Logfile = false LogfileRetentionInDays = 3

[System] TimeZone = CET-1CEST,M3.5.0,M10.5.0/3 TimeServer = 192.168.xx.x ;SetupMode = false

[Ende]

This is what i see in my monitoring:

2021-02-13 08:34:08 A pool.ntp.org WMCam OK (forwarded to resolver1.opendns.com#53) N/A (0.0ms) 2021-02-13 08:32:55 A pool.ntp.org WMCam OK (forwarded to resolver1.opendns.com#53) N/A (0.0ms) 2021-02-13 08:31:29 A pool.ntp.org WMCam OK (forwarded to resolver2.opendns.com#53) N/A (0.0ms) 2021-02-13 08:30:29 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:29:29 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:28:21 A pool.ntp.org WMCam OK (forwarded to resolver2.opendns.com#53) N/A (0.0ms) 2021-02-13 08:17:24 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:16:26 A pool.ntp.org WMCam OK (forwarded to resolver1.opendns.com#53) N/A (0.0ms) 2021-02-13 08:05:16 A pool.ntp.org WMCam OK (forwarded to dns9.quad9.net#53) N/A (0.0ms) 2021-02-13 08:04:13 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:04:13 A pool.ntp.org WMCam OK (forwarded to dns9.quad9.net#53) N/A (0.0ms) 2021-02-13 08:03:14 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:02:19 A pool.ntp.org WMCam OK (forwarded to dns9.quad9.net#53) N/A (0.0ms) 2021-02-13 08:01:16 A pool.ntp.org WMCam OK (cached) N/A (0.0ms) 2021-02-13 08:00:11 A pool.ntp.org WMCam OK (cached)

I checked and the local time server is up and running and sync to it works fine with several other machines.

jomjol commented 3 years ago

The behavious is the following: during startup the ESP32 tries to connect the default time server. This is due to the fact, that for logging reasons the acutal time is needed before the ini file is readed. If an different time server is specified in the config.ini, than this connected after the ini file is read.

For the moment I close this issue therefore.

szabocs commented 3 years ago

I found out yesterday by connecting the esp32cam to serial that it was constantly rebooting, which caused this behaviour of going to ntp.pool.org every second as it indeed does a first sync with pool.ntp.org at startup as described above. I had an older rolling firmware after reflashing the current master the reboots stopped and the ntp sync to my internal ntp server works, which is visible on the serial terminal.