The clock setting is not stable on AGX

I am not able to set the clock on the AGX and every time I restart it goes to a default time in 2017.
It is not consistent and hence I get “Clock Skew” error every time I try to do a make.
Is there someway I can keep the clock time permanent as it doesn’t even accepts the internet time for long.

Dear puneeth.joseph,

Did you set the time in the following way?
https://docs.nvidia.com/drive/active/5.1.0.2L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FInterfaces%2Frealtime_clock.html

Hi Steve,

I did try the below
[b]sudo bash /usr/local/sbin/canrtc.sh get[/b]
There was no output which gave the time/Cannot get the time
I have not connected to network/rtc dongle
Tried sudo bash /usr/local/sbin/canrtc.sh set
it set the time, but sudo bash /usr/local/sbin/canrtc.sh get didn’t give the set time

Dear puneeth.joseph,

I just make sure if you have a RTC Module or not and internet connection.
If you have a RTC module and internet connection, please follow the steps below.

  1. Connecting the RTC Module
    Before getting or setting the RTC module correct time, plug the module into cable harness connector labelled CAN_6_4. For details on the cable harness connections consult Setting Up Your E3550 Platform, Cable Harness topic.

  2. Check internet connection with ifconfig -a / ping command like below.
    eth0 Link encap:Ethernet HWaddr
    inet addr:xx.xx.xx.xx Bcast:10.19.11.255 Mask:255.255.255.0
    inet6 addr: fe80::204:4bff:fea4:e7ca/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:9563 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8125 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:6077291 (6.0 MB) TX bytes:662274 (662.2 KB)
    Interrupt:82

  3. To get the system time
    Use bash shell to launch the canrtc.sh script and get the time as follows:
    sudo bash /usr/local/sbin/canrtc.sh get

  4. Check the system time
    nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh get
    Setting time and date to: 15:22:23, day of week: 5, 08/23/2019
    2019/08/23 15:22:23

Hi SteveNV,

Thanks. I would check and update you,please give me sometime.

I am in trouble because the date of 2017 is displayed every time I start up.
I think the RTC module is connected and connected to the Internet. I tried referring to Steave NV’s answer, but the following result (2003) was obtained.

nvidia @ tegra-ubuntu: ~ $ bash /usr/local/sbin/canrtc.sh get
Setting time and date to: 02:00:04, day of week: 3, 04/23/2003
date: cannot set date: Operation not permitted
2003/04/23 02:00:04
Could not get time from RTC dongle

Additional
nvidia @ tegra-ubuntu: ~ $ sudo bash /usr/local/sbin/canrtc.sh get
Setting time and date to: 02:28:12, day of week: 3, 04/23/2003
2003/04/23 02:28:12

This is the result of sudo privileges.
After all it will be set in 2003.
In addition, if you restart, it will be returned to 2017.

Is there a solution?

Dear s18,

Could you please try to run the command with sudo permission? Thanks.

Executed with sudo privileges and shut down Xavier with the RTC module connected. If it started after more than 12 hours, the time had progressed, but it has not improved since 2003.

nvidia @ tegra-ubuntu: ~ $ sudo bash /usr/local/sbin/canrtc.sh get
Setting time and date to: 01:49:16, day of week: 4, 04/24/2003
2003/04/24 01:49:16

Dear s18,

Did you set the time “Automatically from the Internet” in Time & Date like below capture?

Then you can check time with date command on the terminal.

nvidia@tegra-ubuntu:~$ date
Wed Aug 28 11:11:11 KST 2019

nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh set
setting time and date to “10.0b.0b.03.1c.08.13”

nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh get
Setting time and date to: 11:11:18, day of week: 3, 08/28/2019
2019/08/28 11:11:18

The time and date have been changed to automatic acquisition, but it switches to manual each time it restarts.

I tried the command again for advice.
It is no longer in 2003, but in 2017.

nvidia @ tegra-ubuntu: ~ date Tue Jul 4 16:42:49 JST 2017 nvidia @ tegra-ubuntu: ~ sudo bash /usr/local/sbin/canrtc.sh set
setting time and date to “35.2a.10.02.04.07.11”
nvidia @ tegra-ubuntu: ~ sudo bash /usr/local/sbin/canrtc.sh get Setting time and date to: 16:42:56, day of week: 2, 07/04/2017 2017/07/04 16:42:56 nvidia @ tegra-ubuntu: ~ date
Tue Jul 4 16:42:58 JST 2017

Since it is a network environment through a proxy, I added a proxy to ~ / .bashrc before, but is that relevant?

I got the same time sync error after the reboot.

nvidia@tegra-ubuntu:~ date Fri Jul 7 03:35:58 CST 2017 nvidia@tegra-ubuntu:~ sudo bash /usr/local/sbin/canrtc.sh set
setting time and date to “07.24.03.05.07.07.11”
nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh get
could not get time from dongle
Could not get time from RTC dongle

Dear s18 and songwen.huang,

Could you please refer to the following link and doc for this topic? Thanks.

https://docs.nvidia.com/drive/active/5.1.0.2L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FInterfaces%2Frealtime_clock.html

==============
To automatically set the system time at boot
On Linux
-. If the network is available, run the /etc/systemd/scripts/nv_rtc_sync.sh script at boot to set the system time from the network.
-. If the network is NOT available, set the system time from the dongle.

Dear SteveNV,

After running /etc/systemd/scripts/nv_rtc_sync.sh, I got this:

nvidia@tegra-ubuntu:~$ sudo bash /etc/systemd/scripts/nv_rtc_sync.sh
try_ntp 7 Jul 04:36:36 ntpdate[10811]: no server suitable for synchronization found
getting rtccould not get time from dongle
Could not get time from RTC dongle

Thanks!

I got the same result.

nvidia@tegra-ubuntu:~ date Tue Jul 4 16:39:29 JST 2017 nvidia@tegra-ubuntu:~ sudo bash /etc/systemd/scripts/nv_rtc_sync.sh
try_ntp 4 Jul 16:40:05 ntpdate[4225]: no server suitable for synchronization found
getting rtccould not get time from dongle
Could not get time from RTC dongle
nvidia@tegra-ubuntu:~ /etc/systemd/scripts/nv_rtc_sync.sh try_ntp 4 Jul 16:40:27 ntpdate[4851]: bind() fails: Permission denied getting rtccould not get time from dongle Could not get time from RTC dongle nvidia@tegra-ubuntu:~ date
Tue Jul 4 16:41:29 JST 2017

Dear songwen.huang,

Dear songwen.huang,
I can see similar log after disconnecting RTC dongle and internet connection.
So could you please help to check if RTC dongle and internet connection are properly connected? Thanks.

Does Dual GbE Dongle and RTC module match with a connection like an image?

Dear all,

This is my step for Using the CAN Realtime Clock setting.
Could you please help to refer to the steps for this topic? Thanks.

  1. Connecting the RTC Module
    Before getting or setting the RTC module correct time, plug the module into cable harness connector labelled CAN_6_4. For details on the cable harness connections consult Setting Up Your E3550 Platform, Cable Harness topic.

  2. Check internet connection with ifconfig -a / ping command like below.
    eth0 Link encap:Ethernet HWaddr
    inet addr:xx.xx.xx.xx Bcast:10.19.11.255 Mask:255.255.255.0
    inet6 addr: fe80::204:4bff:fea4:e7ca/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:9563 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8125 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:6077291 (6.0 MB) TX bytes:662274 (662.2 KB)
    Interrupt:82

  3. Check current time
    nvidia@tegra-ubuntu:~$ date
    Wed Aug 28 18:07:48 KST 2019

  4. To set the system time
    Use bash shell to launch the canrtc.sh script and set the time as follows:
    nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh set
    setting time and date to “36.07.12.03.1c.08.13”

  5. To get the system time
    nvidia@tegra-ubuntu:~$ sudo bash /usr/local/sbin/canrtc.sh get
    Setting time and date to: 18:07:58, day of week: 3, 08/28/2019
    2019/08/28 18:07:58

  6. To automatically set the system time at boot
    nvidia@tegra-ubuntu:~$ sudo bash /etc/systemd/scripts/nv_rtc_sync.sh
    try_ntp28 Aug 18:08:14 ntpdate[2695]: step time server 216.239.35.12 offset 0.013067 sec
    updating rtcsetting time and date to “0e.08.12.03.1c.08.13”

nvidia@tegra-ubuntu:~$ date
Wed Aug 28 18:08:16 KST 2019

  1. Reboot the system

  2. Check time
    nvidia@tegra-ubuntu:~$ date
    Wed Aug 28 18:11:25 KST 2019

  3. Disconnect network(unplug internet cable) & reboot

  4. Check time
    nvidia@tegra-ubuntu:~$ date
    Wed Aug 28 18:12:37 KST 2019

I removed and reconnected the RTC module.

Xavier was started and Time & date was switched to automatic acquisition.

nvidia @ tegra-ubuntu: ~ $ date
Wed Jul 5 00:20:06 JST 2017
nvidia @ tegra-ubuntu: ~ $ sudo bash /etc/systemd/scripts/nv_rtc_sync.sh
try_ntp 5 Jul 00:20:23 ntpdate [3446]: no server suitable for synchronization found
getting rtcSetting time and date to: 00:20:24, day of week: 3, 07/05/2017
2017/07/05 00:20:24
nvidia @ tegra-ubuntu: ~ $ date
Wed Jul 5 00:20:27 JST 2017

The result looks like this and cannot be resolved.

Dear s18,

Could you let me know why you removed and reconnected the RTC module?
Is this any test case for your project? Thanks.

This is because I thought there might be a connection failure in the RTC module.

Until now
Since most of the results are shown below …

nvidia @ tegra-ubuntu: ~ $ date
Tue Jul 4 16:39:29 JST 2017
nvidia @ tegra-ubuntu: ~ $ sudo bash /etc/systemd/scripts/nv_rtc_sync.sh
try_ntp 4 Jul 16:40:05 ntpdate [4225]: no server suitable for synchronization found
getting rtccould not get time from dongle
<b>Could not get time from RTC dongle</b>
nvidia @ tegra-ubuntu: ~ $ /etc/systemd/scripts/nv_rtc_sync.sh
try_ntp 4 Jul 16:40:27 ntpdate [4851]: bind () fails: Permission denied
getting rtccould not get time from dongle
<b>Could not get time from RTC dongle</b>
nvidia @ tegra-ubuntu: ~ $ date
Tue Jul 4 16:41:29 JST 2017