Synchronization of local time between two LoPy's
-
Hello
I want to have the same local time in nanoseconds for both lopys, I use at the moment time.time () * math.pow (10,9) but this returns the nanoseconds since the power up of lopys so i try to put them power up at the same time but there is a time lag.
Do you have any solution to synchronize the local time of two lopys using RTC for example?
@LoPy-2016-Kickstarter-Backers @LoPy-Beta-Summer-2016
-
@assia said in Synchronization of local time between two LoPy's:
Do you have any solution to synchronize the local time of two lopys using RTC for example
rtc.ntp_sync("pool.ntp.org")but do you really mean
nanoseconds?
What do you try to accomplish that you should have nanosecond precision - especially synchronized between two devices- i suppose that also RTC is here not accurate.
you can use
utime.ticks_cpu() resolution (25 ns). -
@livius thanks for your response
if i use rtc.ntp_sync("pool.ntp.org") should the lopy's be connoted to the internet all the time or just at the time of synchronization?
-
@assia
if you do not use deepsleep (reset)
then you can do this only oncebut this still is not nanosecond ;-)
-
Hi @livius when i try to synchronize with the ntp server and i try to get the actual time using:
rtc.now()i get :
(1970, 1, 1, 0, 9, 11, 833500, None)but I want to have the current time like the year 2017 for example.
What is the problem knowing that my computer is connected to the Internet when i do it ?thanks
-
@assia said in Synchronization of local time between two LoPy's:
What is the problem knowing that my computer is connected to the Internet when i do it ?
Do you mean Lopy not computer right?
If your Lopy is connected to the router (STA or AP_STA mode)
then you can synchronise time by calling:rtc.ntp_sync("pool.ntp.org") -
Hi assia, did you solve the problem ?
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