RTC ntp time server not working on static ip
-
@PiAir
What if you do the same for "normal" address not ntp e.gwww.pycom.io?
Ntp pool count requests and if you ask too frequent then you can have problem. -
-
@PiAir
Then it looks like some error. In firmware? -
@livius Don't know yet, I wanted to finish my write-up of connecting a GPS receiver first before disconnecting stuff and upgrading the firmware. Could be something fixed in the latest version.
-
Problem also in latest fimware
>>> import os >>> os.uname() (sysname='LoPy', nodename='LoPy', release='1.6.13.b1', version='v1.8.6-607-g9c8a0e9e on 2017-05-01', machine='LoPy with ESP32', lorawan='1.0.0') >>> wlan.ifconfig() ('192.168.0.191', '255.255.255.0', '192.168.0.1', '213.46.228.196') >>> import machine >>> rtc = machine.RTC() >>> rtc.ntp_sync('pool.ntp.org', 3600) >>> rtc.now() (1970, 1, 1, 0, 2, 21, 96633, None) >>> rtc.ntp_sync('128.199.44.119', 3600) >>> rtc.now() (2017, 5, 16, 6, 3, 44, 126771, None) -
Could you please create an issue outlining this on our GitHub repo? This is where Daniel and the team head first to tackle outstanding firmware issues/bugs :)
-
-
@Rorence said in RTC ntp time server not working on static ip:
I have no idea about how to fix this error. I just want to search answers on here.
For now, there are two options:
- use dhcp instead of a fixed IP:
wlan.ifconfig(0,config='dhcp')- if you really have/want to use a fixed IP, use an IP-nummer for the ntp server instead of a FQDN. For example
rtc.ntp_sync('128.199.44.119', 3600)instead of
rtc.ntp_sync('pool.ntp.org', 3600)An issue has been posted with regards to this error, but no time line has been added for that. Once it has been fixed in the firmware, you shouldn't have to worry about it anymore. :)
-
@livius does ntp works with internet only? in case I want to connect my pycom to update time for rtc.
-
@shariq Obviously you can set up your own ntp server, if you like, which is called instead of the ntp server pool on the internet. if you get the date & time from a different source, like an external rtc, you can use rtc.init() to set the local date & time.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login