3

Does anyone know how to get network time for collecting data using Raspberry pis with no backup battery. Regular googling has gotten me things that do not work. They are Pi 4B with 4GB or 8 GB of RAM each with SD cards of 32 to 128 GB each. we have plenty of places to store data and we have internet access there are web browsers installed. Everything works great except the clocks. I have tried installing the NTP and it just keeps saying no time servers available.

We need them to ping a time server on start -up , or at all, I can't even force a time update. All I can do is manually set the time by reading my phone, and it erases each time the Pi is turned off or unplugged which is generally right after taking data.

Thanks for any help its been so frustrating. I have googled it a lot, to no avail, nothing I find works. Maybe the platform just isn't popular enough yet? I'm trying this link next and I will let people know what I find too! Thank you! https://netfuture.ch/2021/12/transparent-trustworthy-time-with-ntp-and-nts/

If you help me you help an entire lab of tired astronomy students, and their exhausted professors and TAs. We are all pretty frustrated. Thank you!

11
  • 3
    This works out of the box if you install the standard OS. No way of knowing what you have done.
    – joan
    Feb 18, 2023 at 20:32
  • well its an imaged system set up, specific to our astronomy lab, so I think the "imager" forgot to add the time modules, in fact I know they did. They said something like, "did I forget to add that?" a few weeks ago. Hmm, maybe I can just wipe my SD card and start over and then add the layers that the "imager" has put together for observing. Hmm. Thank you so much for responding this helps a lot to know this. I did mistake the RAM, most are 2GB , I splurged an 8 MB, luckily and now I can take large sets of data, where the 2MB need to chunk or up or crash. Any more tips plz! Ty! Feb 18, 2023 at 20:46
  • Time would be wonderful, its for a time stamp on observations and for coordination. We're doing interferometry with them next month. I'd like to try SSH to them, to try remote observing and I'm afraid the time being off might trigger our University firewall or something? New lab equipment includes ~twenty 2GB Rasp Pis. By imaging the whole data taking environment at the start of semester, deploying it on the RaspPis. Lab class hopes to look at increasing reproducibility in observations, They've been great data takers better if we can get them to update time. Feb 18, 2023 at 20:54
  • yes if a distro is an image that we flashed into all the new SD cards out of the box. Feb 18, 2023 at 20:55
  • currently we are using our phones to record the time and date, but yes, I think getting time going may be needed before long. Feb 18, 2023 at 20:57

2 Answers 2

3

You can run systemd-timesyncd as @Milliways has documented or you can switch back to the old ntpd. Support for this was dropped by Raspbian/RaspiOS a few years ago.

To switch first you need to disable everything to do with systemd-timesyncd as it will prevent you running ntpd. systemctl disable systemd-timesyncd will do that.

Install ntpd with sudo apt update; sudo apt install ntpd and it will just work.

Note: I run a master ntpd on one of my Raspberry Pis and run a slave ntpd on all the other systems. That's a special configuration that isn't an answer for this question.

2

Raspberry Pi OS uses timesyncd to synchronise time. This is a simplified ntp client (SNTP) (which of course needs network access).

systemctl status systemd-timesyncd.service will show status and if it is running.

If it is not running you could try enabling it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.