Hey guys,
I can't find the answer I'm looking for, most of the results I get are for people who are using GPS or other gadgets to get an accurate time.
I have a standalone network of headless (no gui - ssh only) pi4s.
Two of the pis record seagulls outside (yes, rock and roll lifestyle)
One pi hosts a wireless network and also automatically downloads the video files and puts them onto an external hdd.
There is no internet connection on this network; I intentionally keep this network disconnect from our home network to stop the download job slowing the whole network down. Whenever I want the files, I plug a flash drive in to the host pi and copy them (I log into the pi remotely and use the cp command).
The ftp server on the pi sometimes dies, and a simple reset of the ftp service does not fix it, one must reboot the pi to get everything going again. This happens every other day, it's a common experience, nobody seems to have a solution.
So I wrote a script to reboot periodically, it's not a big deal if I miss a few frames of video. However the problem is that the time starts to drift as the pi loses a few seconds every reboot.
So I want to have the two video recording pis to set their time based on the host pi's time, it's not super accurate but it's close enough just to have my videos roughly correctly timed. Does anyone know how I could do that?
Re: Time Synchronisation on a standalone network
Add an RTC module to the Pi. The DS3231 ones are fairly cheap and accurate. You could put a module on every Pi, or just have one and run it as an NTP server to the rest on the network.
Or, as you say you don't want additional hardware, you could just make the master Pi the NTP server. But I would recommend a proper RTC to keep the time accurate to real time.
Or, as you say you don't want additional hardware, you could just make the master Pi the NTP server. But I would recommend a proper RTC to keep the time accurate to real time.
Unreadable squiggle
Re: Time Synchronisation on a standalone network
I assume you have a separate switch etc for the Pi and not sharing access points so why not have one of the Pis connect to your normal network via the other interface network and get the time and act as the NTP server for the 'other' network?
Normal network routine will keep the video traffic on its own network...
As an ex-twitcher (and ex-dawn counter of wading birds fir the RSPB) I see nothing odd about seagull videos
Normal network routine will keep the video traffic on its own network...
As an ex-twitcher (and ex-dawn counter of wading birds fir the RSPB) I see nothing odd about seagull videos

Old sig removed given the current world situation. Please wish / pray / work for a peaceful world.
Re: Time Synchronisation on a standalone network
I would force the network time protocol to recognize the free-running internal clock of the Pi you want to use for the reference as a stratum time source.dbsweng wrote: ↑Fri Aug 05, 2022 5:38 pmHey guys,
I can't find the answer I'm looking for, most of the results I get are for people who are using GPS or other gadgets to get an accurate time.
I have a standalone network of headless (no gui - ssh only) pi4s.
Two of the pis record seagulls outside (yes, rock and roll lifestyle)
One pi hosts a wireless network and also automatically downloads the video files and puts them onto an external hdd.
There is no internet connection on this network; I intentionally keep this network disconnect from our home network to stop the download job slowing the whole network down. Whenever I want the files, I plug a flash drive in to the host pi and copy them (I log into the pi remotely and use the cp command).
The ftp server on the pi sometimes dies, and a simple reset of the ftp service does not fix it, one must reboot the pi to get everything going again. This happens every other day, it's a common experience, nobody seems to have a solution.
So I wrote a script to reboot periodically, it's not a big deal if I miss a few frames of video. However the problem is that the time starts to drift as the pi loses a few seconds every reboot.
So I want to have the two video recording pis to set their time based on the host pi's time, it's not super accurate but it's close enough just to have my videos roughly correctly timed. Does anyone know how I could do that?
I used to know how to do this using the traditional ntpd time server. It is possible systemd has assimilated that function. If so, you may need to disable the built-in ntp of systemd before proceeding.
Re: Time Synchronisation on a standalone network
From what I can remember, if ntpd is installed and configured systemd will not run its time services.
Unreadable squiggle
Re: Time Synchronisation on a standalone network
To set the date and time on a remote stand alone pi I use the command from a Linux machine that has the correct time:
This does not give microsecond accuracy but does what I think you are looking for. The time could then be transferred to your slaves in a similar manner within a suitable script.
Hope this helps, I like your project too btw.
Code: Select all
ssh pi@target sudo date -s$(date -Ins)
Hope this helps, I like your project too btw.
Re: Time Synchronisation on a standalone network
I'd turn that script around and run it on each Pi at boot, after the network has settled, to get the time from another Pi on that isolated network.Doug_ wrote: ↑Sat Aug 06, 2022 2:22 amTo set the date and time on a remote stand alone pi I use the command from a Linux machine that has the correct time:
This does not give microsecond accuracy but does what I think you are looking for. The time could then be transferred to your slaves in a similar manner within a suitable script.Code: Select all
ssh pi@target sudo date -s$(date -Ins)
Hope this helps, I like your project too btw.
Code: Select all
sudo date $(ssh pi@target 'date +%m%d%H%M%Y.%S')
Unreadable squiggle
Re: Time Synchronisation on a standalone network
Really, why not use NTP??
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel
Re: Time Synchronisation on a standalone network
Indeed. I was thinking after posting that last comment that we are pretty much re-inventing NTP.

Unreadable squiggle