(2022-04-27, 04:31 AM)SCarns Wrote:(2022-04-27, 01:46 AM)SCarns Wrote: I did this. After you set up SignalK to set the time in the RPi, you set up a simple NTP server to run on the Pi. Then, you give all the other devices the Pi’s IP address as the time server to connect to. It works fine and there’s nothing else needed besides installing an NTP server onto the Pi. I think I used Chrony, but I can’t remember. Easy to do if you google “how to set up an NTP server on raspberry pi”
This link will get you started:
https://rishabhdevyadav.medium.com/how-t...562e41d0e1
But in a nutshell, here's the NTP server install:
$ sudo apt-get update
$ sudo apt-get install ntp
$ sntp --version (optional)
$ sudo nano /etc/ntp.conf (to make any needed changes to the server settings, as needed)
$ sudo service ntp restart
$ sudo service ntp status (If it says "Active", you're good)
Then you need to point your clients to the IP address of your new server. This will depend a lot on your clients systems. The above article goes into how to setup linux clients further down in the article. In Linux systems, you'll simply add the location of your new NTP server to the client's "/etc/ntp.conf" file and reboot.
Steve
Beauty, thx! I was afraid that the ntp server would interfere with timedatectl that is running in openplotter, but with your hint I just tried and at first glance it seems to happily co-exist.
I added the following line to /etc/dnsmasq.conf to have the ntp-server be advertised by DHCP:
Code:
dhcp-option=option:ntp-server,10.10.10.1
Which seems to have worked:
Quote:pi@openplotter:~ $ sudo nmap --script broadcast-dhcp-discover -e wlan9
Starting Nmap 7.70 ( https://nmap.org ) at 2022-04-27 22:04 CEST
Pre-scan script results:
| broadcast-dhcp-discover:
| Response 1 of 1:
| IP Offered: 10.10.10.164
| DHCP Message Type: DHCPOFFER
| Server Identifier: 10.10.10.1
| IP Address Lease Time: 2m00s
| Renewal Time Value: 1m00s
| Rebinding Time Value: 1m45s
| Subnet Mask: 255.255.255.0
| Broadcast Address: 10.10.10.255
| Router: 10.10.10.1
| Domain Name Server: 10.10.10.1
|_ NTP Servers: 10.10.10.1
NTP server responds as well:
Code:
pi@openplotter:/var/log $ sudo sntp localhost
sntp 4.2.8p12@1.3728-o (1)
2022-04-27 22:19:25.568520 (-0100) +0.001661 +/- 0.473509 localhost ::1 s3 no-leap
Now the next thing is to try this at the boat where I have an Ubuntu client desperately in need of proper time. Will keep this thread posted.