LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NTP on RTOS (Linux)

I'm attempted to get NTP working on all my real-time controllers but I haven't had any success. 

 

I've been following these instructions 

https://forums.ni.com/t5/Example-Code/Installing-and-Configuring-NTP-on-NI-Linux-Real-Time-Devices/t...

 

opkg install ntp ntp-tickadj

vi /etc/ntp.conf

add the server to the file, and reboot.

 

NTP appears to be running but the offset is too extreme for it to synchronize. But in reality, there is no offset or barely any, it just thinks there is. I have tried this on 4 PXIe-8880s and 1 cRIO so far, all have the same result. The offset the ntpq -p claims, isn't even the same between machines so I really don't think this is simple user error. Yes, I've checked the timezones, I've made it UTC even for a bit. I've tried manually setting the time to reduce the offset and while I can reduce it, its always thousands of seconds off as far as I can tell. It's almost like it's reading milliseconds as seconds or something. 

See attached for pictures taken from three different machines at the same time (ish). Sorry for the multi-color edits. All are running 2024 Q3 with the same Linux version. 

I've been fighting this off and on for a while. 

0 Kudos
Message 1 of 10
(486 Views)

I don't use a pool, I usually choose three servers near me (network-wise, not geographically, although they may be the same) and sync to them.  You can also make your own stratum 1 time server by using a RPI and a GPS time source.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(431 Views)

I'm not really using a pool, if by pool, you mean more than one NTP server. I was experimenting with different ways of going about having an NTP server. For now, its a stratum 1 domain server, that's actually offline. Which is fine for my purposes; the previous dev didn't have any time syncing and eventually I can get this network on the internet (ish) so I'll have access to an accurate clock later. 

 

I experimented with an IRIG to USB on one of the client computers, then found it gets angry when there's more than one NTP stratum 1 server on the network and I was unwilling to use my domain as a guinea pig for the IRIG setup. 

 

The cRIO test was on a completely different network with an IRIG to USB that comes up as stratum 1 but still says the offset is crazy high no matter what I do so the source isn't the issue. There has to be something odd about how the RTOS NTP client is translating the signal or something. My server is Windows Server 2022 if that matters but as far as I can research, NTP is NTP and there haven't been any major versioning. 

 

On an early version, I was able to run the command ntpdate -u 192.168.xx.xx to force an update from a specific server, but these say they don't recognize that command anymore. I'm trying to avoid doing a full NTP dive and learning all the innerworkings include what NTP-utils is vs NTP-tickadj, etc. 

0 Kudos
Message 3 of 10
(410 Views)

@Furbs wrote:

I'm not really using a pool, if by pool, you mean more than one NTP server.. 


The  "pool.ntp.org" is a special URL that will automatically pick one suitable NTP server in your region. Much easier that defining anything specific.

0 Kudos
Message 4 of 10
(397 Views)

@altenbach wrote:

@Furbs wrote:

I'm not really using a pool, if by pool, you mean more than one NTP server.. 


The  "pool.ntp.org" is a special URL that will automatically pick one suitable NTP server in your region. Much easier that defining anything specific.


I don't use the pool because I never know who I'm syncing to.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 10
(392 Views)

@billko wrote:

@altenbach wrote:

@Furbs wrote:

I'm not really using a pool, if by pool, you mean more than one NTP server.. 


The  "pool.ntp.org" is a special URL that will automatically pick one suitable NTP server in your region. Much easier that defining anything specific.


I don't use the pool because I never know who I'm syncing to.


(I was just making a non-judgmental statement about the special meaning of "pool" here as it relates to NTP)

 

It is an excellent default value for my code which is potentially used all over the world. It will be used if the server is left unwired as clearly documented on the FP. Nobody wants to send newbies on a snipe hunt to figure out which server is "best", enter it manually, making sure there is not typo, making sure it is up, and wire it instead, . 😄

 

altenbach_0-1755105901948.png

 

Message 6 of 10
(382 Views)

@altenbach wrote:

@billko wrote:

@altenbach wrote:

@Furbs wrote:

I'm not really using a pool, if by pool, you mean more than one NTP server.. 


The  "pool.ntp.org" is a special URL that will automatically pick one suitable NTP server in your region. Much easier that defining anything specific.


I don't use the pool because I never know who I'm syncing to.


(I was just making a non-judgmental statement about the special meaning of "pool" here as it relates to NTP)

 

It is an excellent default value for my code which is potentially used all over the world. It will be used if the server is left unwired as clearly documented on the FP. Nobody wants to send newbies on a snipe hunt to figure out which server is "best", enter it manually, making sure there is not typo, making sure it is up, and wire it instead, . 😄

 

altenbach_0-1755105901948.png

 


Me, neither.  I was just commenting on my personal prefs.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 10
(375 Views)

To be clear, I'm putting NTP directly on the RTOS, not using any kind of code or GUI. Basically NI is not involved. 

 

Have either of you experience the timestamp being correct, but the client thinking its still too far off to synchronize? 

0 Kudos
Message 8 of 10
(362 Views)

This is the latest version of NTP?  I've heard of stuff like this in (very) old implementations.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 10
(352 Views)

It's Windows Server 2022. the w32tm.dll says 10.0.20348

I wouldn't think that would qualify as very old. 

 

Linux says 4.2.8p15

0 Kudos
Message 10 of 10
(231 Views)