NTP Synchronization for GMSL Camera

I would like to get a UTC timestamp from GMSL camera without PTP connection.

In our current system, we have built a system that sends camera images acquired by DriveAGX to other desktop PCs for other processing.
Timestamps of Both Drive AGX and Desktop are synchronized using the NTP server.

In the DriveAGX system, it is possible to synchronize time using “ntp” and “ntpdate” commands, but it has been confirmed that the time obtained from the camera with the function dwImage_getTimestamp() does not become a normal UTC time.

In this case, according to the following comments, when “sudo killall ptp4l && sudo killall phc2sys” is executed, it has been confirmed that the correct time may be obtained.
https://devtalk.nvidia.com/default/topic/1046003/drive-agx/clock-is-behind-hyperion-launcher-does-not-work/

However, since it has been confirmed that a timestamp different from the current TCP time is output, could you please tell me how to get the camera UTC timestamp in the actual time without PTP connection?

Dear k.yoneda,

You should able to ping google.com, and nv_rtc_sync service uses “time.google.com” as NTPSERVER to set current date to system as well as on RTC module.
So ping to NTPSERVER should work fine to get RTC working.

nvidia@tegra-ubuntu:~$ ping time.google.com -c 5
PING time.google.com (216.239.35.0) 56(84) bytes of data.
64 bytes from time1.google.com (216.239.35.0): icmp_seq=1 ttl=41 time=58.5 ms
64 bytes from time1.google.com (216.239.35.0): icmp_seq=2 ttl=41 time=57.8 ms
64 bytes from time1.google.com (216.239.35.0): icmp_seq=3 ttl=41 time=58.7 ms
64 bytes from time1.google.com (216.239.35.0): icmp_seq=4 ttl=41 time=58.0 ms
64 bytes from time1.google.com (216.239.35.0): icmp_seq=5 ttl=41 time=57.8 ms

--- time.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 57.883/58.209/58.700/0.411 ms
nvidia@tegra-ubuntu:~$ systemctl status nv_rtc_sync.service
● nv_rtc_sync.service - Sync/Update RTC time
   Loaded: loaded (/lib/systemd/system/nv_rtc_sync.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2019-10-02 11:14:13 UTC; 4 days ago
 Main PID: 1442 (code=exited, status=0/SUCCESS)

Jul 04 07:38:41 tegra-ubuntu systemd[1]: Starting Sync/Update RTC time...
Oct 02 11:14:13 tegra-ubuntu bash[1442]: try_ntp 2 Oct 11:14:13 ntpdate[1447]: step time server 216.239.35.8 offset 70860925.207518 sec
Oct 02 11:14:13 tegra-ubuntu bash[1442]: updating rtcsetting time and date to "0d.0e.0b.03.02.0a.13"
Oct 02 11:14:13 tegra-ubuntu systemd[1]: Started Sync/Update RTC time.

To setup the Network correctly follow section “To set the DHCP server” mentioned in below link - https://docs.nvidia.com/drive/drive_os_5.1.9.0L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2Fconfig_network_setup.html%23wwpID0E0JD0HA

Dear SteveNV

Thank you for your comment.
However, in our system, there is no internet connection for the drive AGX. But, we have own ntp-server in the local network such as “192.168.0.XXX”.

I roughly checked /etc/systemd/script/nv_rtc_sync.
In our case, should we modify the script file to change the IP address of the NTP server from time.google.com to our local server?

Dear k.yoneda,

I think you can modify the script by changing the NTP server from time.google.com to your local server.
Please refer to the above DHCP server setting guidance. Thanks.