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

Can't get time from ntpserver with DHCP #5283

Closed
4 of 6 tasks
Gwenselah opened this issue Feb 19, 2019 · 13 comments
Closed
4 of 6 tasks

Can't get time from ntpserver with DHCP #5283

Gwenselah opened this issue Feb 19, 2019 · 13 comments
Labels
bug Type - Confirmated Bug workaround Result - The work on the issue has ended with an alternative solution

Comments

@Gwenselah
Copy link

Gwenselah commented Feb 19, 2019

Describe the bug
Some of Tasmota Pow R2 does not get time from time server.
00:21:23 MQT: tele/sonoff/STATE = {"Time":"1970-01-01T00:21:23","Uptime":"0T00:20:24","Vcc":3.418,"SleepMode....

I tried timezone 99
I tried to setup the ntpserver to internal or external ntp server. I use ip or dns lookup.
I reseted the sonoff (reset 4) and reconfigured the device.
Firmware: Sonoff-Tasmota 6.4.1

Also, make sure these boxes are checked [x] before submitting your issue - Thank you!

  • Searched the problem in issues and in the wiki
  • Hardware used : Sonof Pow R2
  • Development/Compiler/Upload tools used : Atom Editor, and Inplace Upgrade of the tasmota firmware
  • If a pre-compiled release or development binary was used, which one? : No
  • You have tried latest release or development binaries? : yes, i tried the inplace upgrade button
  • Provide the output of commandstatus 0 :
00:33:14 MQT: stat/sonoff/RESULT = {"Time":"1970-01-01T00:33:14","Uptime":"0T00:32:15","Vcc":3.418,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"XXX","BSSId":"34:81:C4:F8:99:F2","Channel":6,"RSSI":86}}```

**(Please, remember to close the issue when the problem has been addressed)**
@ascillato
Copy link
Contributor

ascillato commented Feb 19, 2019

Hi,

Sorry, can't reproduce your issue. My pows are working fine.

Please, check your network. This issue had happened before (as you saw when you have searched in issues) and most of the time is just a misconfiguration on the router or firewall. Just once was that public ntp servers were down for a couple of hours.

Also, you can upgrade your device to latest Tasmota version from development branch 6.4.1.17

If you are super sure that your network is fine, may be you have a router that is not 100% compatible with esp8266 arduino core 2.4.2. You can try either latest Tasmota 6.4.1.17 with core 2.3.0 or with core 2.5.0. Thehackbox.org/tasmota/020300 or thehackbox.org/tasmota/020500

@ascillato2 ascillato2 added duplicated Result - Duplicated Issue awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting labels Feb 19, 2019
@jziolkowski
Copy link
Contributor

@Gwenselah make sure your DHCP server sends correct NTP option as well. Tasmota is based on Arduino core, which takes this info and makes it primary (which causes problem with DHCP servers sending bad or empty options for NTP)

@Gwenselah
Copy link
Author

Hello,
thank you for your replies.
At the moment i have 4 Sonof Pow R2 in the same wlan. All have the 6.4.1 firmware. 2 of them get the correct time, the other 2 not.
Now I upgraded one to version 6.4.1.17 with core 2.5.0. this didn't solved the issue.
Are there some debugging commands to trace the getting time process?

Kind regards.

@jziolkowski
Copy link
Contributor

Come and join us at our discord. There were users with this problem. Might provide more help.
https://discord.gg/Crj7tCJ

@ascillato2
Copy link
Collaborator

Hi,

Any news on this issue?

@Gwenselah
Copy link
Author

No, I setup a ntp server on my raspberry pi, but nothing changed. I increased the debug log, but there is nothing in it, which would help.
I will go over to discord now

@Gwenselah
Copy link
Author

Gwenselah commented Feb 23, 2019

Now I think i got it.
If you use DHCP on the sonoff and your DHCP server sends no or incorrect ntp option, then you can not use "ntpserver1 " to set an internal ntp server. You can set it, but it will not work. You have to set a static ip on the sonoff additionally.
Version 6.4.1.17

@ascillato
Copy link
Contributor

Very interesting! Thanks for sharing this.
That explains why I couldn’t reproduce the issue.

Thanks, now we have a workaround for people with this NTP issue for the DHCP in their router until something can be done in the code.

@ascillato2 ascillato2 added bug Type - Confirmated Bug and removed awaiting feedback Action - Waiting for response or more information duplicated Result - Duplicated Issue troubleshooting Type - Troubleshooting labels Feb 23, 2019
@ascillato2 ascillato2 changed the title Sonoff Pow R2 does not get time from ntpserver Can't get time from ntpserver with DHCP Feb 23, 2019
@andrethomas
Copy link
Contributor

Its a SDK issue - if NTP server exists (configured correctly or not) on the same IP as the DHCP server (no setting for NTP server necessary on DHCP settings) then the SDK automatically uses the NTP service it assumes to be good on the same IP of the DHCP server... or at least this has been my observation.

@arendst arendst added the workaround Result - The work on the issue has ended with an alternative solution label Feb 25, 2019
@arendst
Copy link
Owner

arendst commented Feb 25, 2019

So as it is SDK related you will have to use a workaround by adding one or two additional NTP servers using command ntpserver2 and ntpserver3.

@jziolkowski
Copy link
Contributor

@arendst it doesn't change anything. We've tried it with some discord users some time ago. The solution is to use DHCP server with proper NTP option configured in the lease.

@Gwenselah you've discovered what I basically told you in my first response.

@Gwenselah
Copy link
Author

@jziolkowski
Please consider that many people only have dhpc "server" running on routers like Fritzbox and yes, may be I missunderstood you.
For those people my workaround it is easier then setup an run a real DHCP Server.
So, please stay polite.

@ascillato2
Copy link
Collaborator

Closing this issue as it is has been answered. #5283 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug workaround Result - The work on the issue has ended with an alternative solution
Projects
None yet
Development

No branches or pull requests

6 participants