Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Sync error: NTP server not reachable #18

Open
piter1235301 opened this issue Jun 15, 2021 · 0 comments
Open

Time Sync error: NTP server not reachable #18

piter1235301 opened this issue Jun 15, 2021 · 0 comments

Comments

@piter1235301
Copy link

piter1235301 commented Jun 15, 2021

Hello,
I've tried upload code, but I had a few issue.

The First was undefined reference to sntp_get_timezone but I set set IwIPVariant to 1.4 Higher Bandwidth (older version of esp8266 library - in my case 2.7.4) so then it was better, but still...

The Second was

invalid initialization of non-const reference of type ArduinoJson::JsonObject& {aka ArduinoJson6180_91::ObjectRef&}' from an rvalue of type 'ArduinoJson6180_91::enable_if<true, ArduinoJson6180_91::ObjectRef>::type {aka ArduinoJson6180_91::ObjectRef}

So i set older version of ArduinoJson(5.13.4) and seems to work...

but then I've got message from Serial Port:

> Connecting to WiFi...scandone
> scandone
> state: 0 -> 2 (b0)
> state: 2 -> 3 (0)
> state: 3 -> 5 (10)
> add 0
> aid 1
> cnt 
> 
> connected with myaccesspoint, channel 1
> dhcp client start...
> ip:192.168.0.10,mask:255.255.255.0,gw:192.168.0.1
> Got IP: 192.168.0.10
> 
> Beginning Azure IoT Hub Client... NTP server 0 set to: pool.ntp.org 
> NTP time zone set to: 0, result: OK
> --Set daylight OFF
> Short sync interval set to 5
> Long sync interval set to 1800
> Time sync started
> -- NTP Server hostname: pool.ntp.org
> -- Transmit NTP Request
**> please start sntp first !
> -- NTP error :-(
> Time Sync error: NTP server not reachable
> Long sync interval set to 5
> Current timestamp: 7
> OK
> -- NTP Server hostname: pool.ntp.org
> -- Transmit NTP Request
> Sync frequency set low
> No daylight
> First sync! 21:21:43 15/06/2021
> Succeccful NTP sync at 21:21:43 15/06/2021
> Got NTP time: 21:21:43 15/06/2021
> Long sync interval set to 61
> Current timestamp: 12
> Creating SAS Token!
> SAS Token expire: 1624656103
> Failed to connect to Azure IoT Hub
> pm open,type:2 0

In general time is showing 21:21:43, but in reality it was 23:21:43, so maybe it is making a Failed to connect to Azure IoT Hub?

What can I do to debug this?

Please help with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant