Live data from Hacker News

Going in circles without a real-time clock

rachelbythebay.com

101–110 of 157 posts

Re: Going in circles without a real-time clock

#101

It's surprising that it was left out. Ie, the workaround makes sense, but this is a peripheral that is sometimes built into MCUs themselves. For example, most (all?) STM32s include an RTC... with the caveat that if you are using them for canonical use cases, you will need external hardware in the form of a dedicated 32kHz oscillator, and possibly a battery. For a lot of micro-controller timing uses, they aren't requi…

I had to support an IoT device once that lacked an RTC.

That was actually the easier hardware platform, because it either had good NTP sync or it didn't reach our C&C servers.

The difficult one was the platform that had an RTC. Those would slooowly drift out of sync if NTP was broken. Slowly and silently.

Re: Going in circles without a real-time clock

#102
post #78

Earlier quoted context omitted.

Ah okay. Because I found that the default start order of gpsmon and chrony was incorrect meaning that the shared memory communications wasn't working but there were no error messages stating this. So sometimes, it would sync (slowly) and then chrony sources would say that it was having microsecond sync time but when I connected a switch (On/Off type) to the same gpio on two separate Pi's with linked earth connections…

I must admit I've never used chrony, so I'm unfamiliar with how to configure it. I've read a lot say saying gpsmon's shared-memory-segment is a really great interface and to go with it instead of NTP's own GPS drivers, but I cannot say that lines up with my experience. I do have one computer setup this way, and it works, but I found on the PPS configurations, it seemed to me to have better accuracy and less jitter us…

Ah okay. Conversely I've never tried that setup :) Nice to hear about it though.

Re: Going in circles without a real-time clock

#103
Two nights ago I rebooted my router and it wasn't able to update its clock. The logs were filled with "ntp: start NTP update" every 5 seconds.

Well, it was something related to using AdGuard's (94.140.14.14) DNS and pool.ntp.org. I added Google's (8.8.8.8) to resolv.conf temporarily to get the clock synced. But I'm still not sure what the root cause was.

Re: Going in circles without a real-time clock

#104
post #10

Earlier quoted context omitted.

See, e.g., https://rachelbythebay.com/w/2018/04/28/meta/

Amazing. So when you read about some weird (and mostly self-inflicted) problem you've never had in your life, you are not allowed to express your surprise because by doing that you're implying you're better than other people, and that would be horrible (the implying part is what is horrible, I think? Or maybe actually being better is also wrong? Can you even be better―yeah, I guess it's possible to be better than som…

You're allowed to. We are then allowed to think you are an asshat for doing it.

Sharing cautionary stories is good. Learning from others' mistakes is good. Jumping on these as an opportunity to put someone down for the purpose of self-promotion ("mostly self-inflicted", express your surprise) is unkind, probably bullshit (I have seen soooo many people pretend to be above problems and then run smack into them), but most importantly: it shits up the dynamic where people are willing to share their mistakes, allowing group-learning. It would have been the easiest thing in the world for rachelbythebay to not make this blogpost and thereby avoid providing an opening for asshats like yourself, but I'm glad she made it anyway, even knowing that you would take your shot, so that everyone else could learn.

Re: Going in circles without a real-time clock

#105
post #10

Earlier quoted context omitted.

See, e.g., https://rachelbythebay.com/w/2018/04/28/meta/

Amazing. So when you read about some weird (and mostly self-inflicted) problem you've never had in your life, you are not allowed to express your surprise because by doing that you're implying you're better than other people, and that would be horrible (the implying part is what is horrible, I think? Or maybe actually being better is also wrong? Can you even be better―yeah, I guess it's possible to be better than som…

Found the one!

Re: Going in circles without a real-time clock

#106
post #102

Earlier quoted context omitted.

I must admit I've never used chrony, so I'm unfamiliar with how to configure it. I've read a lot say saying gpsmon's shared-memory-segment is a really great interface and to go with it instead of NTP's own GPS drivers, but I cannot say that lines up with my experience. I do have one computer setup this way, and it works, but I found on the PPS configurations, it seemed to me to have better accuracy and less jitter us…

Ah okay. Conversely I've never tried that setup :) Nice to hear about it though.

This is off-topic, but I was looking at your sbts-aru project and remembered having read the hackaday post on it about fireworks. I'm curious if you've ever seen the RaspberryShake BOOM sensor? If so, any thoughts on how your project and it differ?

https://shop.raspberryshake.org/product/turnkey-iot-atmosphe...

Re: Going in circles without a real-time clock

#107

tl;dr: machine is unable synchronize its clock because it won't trust the NTP server's DNSSEC certificate because its clock isn't synchronized. Oof.

This is the perennial problem with trying to secure NTP. I've also seen people suggest that we just use HTTPS for time sync, not realizing that if your clocks are too far off you can't make a HTTPS connection.

You can use plain HTTP for time sync. Almost all HTTP servers respond with a time header.

Re: Going in circles without a real-time clock

#108

Earlier quoted context omitted.

This is the perennial problem with trying to secure NTP. I've also seen people suggest that we just use HTTPS for time sync, not realizing that if your clocks are too far off you can't make a HTTPS connection.

You can use plain HTTP for time sync. Almost all HTTP servers respond with a time header.

The whole point of the exercise was to make it secure though. If you don't care about MITM attackers then NTP works great.

Re: Going in circles without a real-time clock

#109

Earlier quoted context omitted.

I do that, with a local GSP-synced Pi. Very cheap and easy to set up with IPv4 at least. That said, if you don't trust the DHCP server because some evil actor might give you the wrong time, why should you trust the NTP server it tells you about?

I agree that if you distrust the network operator (but must use the operated network for some reason) that you should accept as little configuration information provided by that operator as is reasonably possible. That goes without saying. I mentioned the fact that DHCP can provide NTP server information as a way to explain why DHCP wouldn't just straight-up provide "current time" information. Why do that when you ca…

Oh yeah, certainly agree. Especially since devices can use SNTP[1] to talk to a NTP server if they just want to know the current time and don't need all the complexity of NTP.

[1]: https://timetoolsltd.com/ntp/sntp-overview/

Re: Going in circles without a real-time clock

#110

Its weird that people work OK without knowing exactly what time it is. Sure it helps us but if a person lost track of the date for a few days in a city they would still be able to perform basic functions. We only have had timekeeping devices for a tiny part of our history but we invented alot of stuff without precise synchrony.

Isn’t that just because individual human activities aren’t very precise, and for the most part, the position of the sun in the sky is enough for an individual to broadly synchronise themselves with the rest of society.

Unless someone is actually aiming to do a time coordinated task with others, you really need to know the time, or even the day-of-week to do stuff, because most human things in world aren’t actually occurring in small time sensitive windows.

Post reply on HN