This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timeserver
#11
(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.
Reply
#12
(2022-04-27, 07:50 PM)Sailoog Wrote: I think this is something we could add to openplotter-settings app.

That would be excellent. And why not? This set up makes perfect sense on a boat where the only access to correct time in through a GPS receiver and SignalK already updates the server time with it. Would it also be possible to set up a client? For example, I have more then on Pi on board and SK is the primary. I would be cool to be able to have the second one look to the primary for time updates.

I vote +1 for that upgrade! It would be easier to set up through a software interface/settings app than to struggle through with a terminal interface trying, copying and pasting to get it to work. Thanks!
Reply
#13
ntp server is already added in openplotter-settings v3.3.1

test and report any issue here: https://forum.openmarine.net/showthread.php?tid=3878

thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)