Hi:
May be usefull for someone.
I’m using an OEM GPS module on WRAP RS232 serial port (ROS 4.01beta1). But GPS antenna is not at the right place yet and sometimes GPS data is not “valid”.
So there is a small routine to check if board clock must be tied to GPS or to a NTP-Server anywhere, according to GPS state. Since I run a NTP-Server to LAN/WLAN machines on such board, at least each 10 minutes I run this routine (scheduler) once to check if GPS is ok. If it’s not, NTP-Client is enabled. As soon as GPS is back, set-system-time via NTP-Client is disabled and set-system-time via GPS is enabled back.
{/system gps monitor once do={
:if ($"valid" = no) do={
:log info "GPS down, enabling NTP-client";
/system gps set set-system-time=no;
/system ntp client set enabled=yes}
:if ($"valid" = yes) do={
:log info "GPS up, disabling NTP-client";
/system ntp client set enabled=no;
/system gps set set-system-time=yes}
}
}
Regards;