# Time not synchronized between two nx devices with ptp

**URL:** <https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027>\
**Category:** Jetson Xavier NX\
**Tags:** ubuntu, kernel\
**Created:** [July 7, 2021, 5:23pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027 "2021-07-07T17:23:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 7, 2021, 5:23pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/1 "2021-07-07T17:23:16Z")

</div>

Hi ,  
I am using PTP synchronize time between tow xavier nx device (with one xavier NX device as master and another xavier nx device as slave) . I took the refernce commands from the  
forum ( [Time sensitive networking [TSN] on NX - #10 by carolyuu](https://forums.developer.nvidia.com/t/time-sensitive-networking-tsn-on-nx/125189/10) )  
Master side  
ifconfig eth0 down  
ifconfig eth0 up  
ifconfig eth0 0.0.0.0  
ip addr add 10.0.0.1/24 dev eth0  
ip link set dev eth0 up  
timedatectl set-ntp false  
date 010100002018  
phc\_ctl /dev/ptp0 set  
phc\_ctl /dev/ptp0 get  
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -m

```
slave side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -s -m

```

I have checked the time using both “date” command and “phc\_ctl /dev/ptp0 get” command.The date and time I sent in the master device is not reflected in the slave device.

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [July 8, 2021, 5:53am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/3 "2021-07-08T05:53:31Z")

</div>

hello tegra\_user,

could you please try again to execute below commands on both of your master/slave device.  
for example,

```auto
$ systemctl stop ptp4l
$ systemctl disable ptp4l
$ systemctl reboot

```

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 8, 2021, 1:13pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/4 "2021-07-08T13:13:36Z")

</div>

Hi @JerryChang ,  
I tried executing these commands in both master and slave ,and then I tried the commands I mentioned above. But still I am not able to synchronize the slave clock to master clock.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [July 9, 2021, 2:48am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/5 "2021-07-09T02:48:05Z")

</div>

hello tegra\_user,

may I know what’s JetPack release version of your master and slave devices?  
you may check release tag, `$ cat /etc/nv_tegra_release ` for reference,  
thanks

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 9, 2021, 12:21pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/7 "2021-07-09T12:21:07Z")

</div>

what is in the file `gPTP.cfg` ?

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 9:14am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/8 "2021-07-10T09:14:04Z")

</div>

Hi Andrey,  
I have taken the gPTP.cfg from the link I specified above( [Time sensitive networking [TSN] on NX - #10 by carolyuu](https://forums.developer.nvidia.com/t/time-sensitive-networking-tsn-on-nx/125189/10) ).

[global]

# 

# Default Data Set

# 

twoStepFlag 1  
gmCapable 1  
priority1 248  
priority2 248  
domainNumber 0  
clockClass 248  
clockAccuracy 0xFE  
offsetScaledLogVariance 0xFFFF  
free\_running 0  
freq\_est\_interval 1

# 

# Port Data Set

# 

logAnnounceInterval 1  
logSyncInterval -3  
logMinPdelayReqInterval 0  
announceReceiptTimeout 3  
syncReceiptTimeout 3  
delayAsymmetry 0  
fault\_reset\_interval 4  
neighborPropDelayThresh 800  
min\_neighbor\_prop\_delay -20000000

# 

# Run time options

# 

assume\_two\_step 1  
logging\_level 6  
path\_trace\_enabled 1  
follow\_up\_info 1  
hybrid\_e2e 0  
tx\_timestamp\_timeout 1  
use\_syslog 1  
verbose 0  
summary\_interval 0  
kernel\_leap 1  
check\_fup\_sync 0

# 

# Servo options

# 

pi\_proportional\_const 0.0  
pi\_integral\_const 0.0  
pi\_proportional\_scale 0.0  
pi\_proportional\_exponent -0.3  
pi\_proportional\_norm\_max 0.7  
pi\_integral\_scale 0.0  
pi\_integral\_exponent 0.4  
pi\_integral\_norm\_max 0.3  
step\_threshold 0.0  
first\_step\_threshold 0.00002  
max\_frequency 900000000  
clock\_servo pi  
sanity\_freq\_limit 200000000  
ntpshm\_segment 0

# 

# Transport options

# 

transportSpecific 0x1  
ptp\_dst\_mac 01:80:C2:00:00:0E  
p2p\_dst\_mac 01:80:C2:00:00:0E  
uds\_address /var/run/ptp4l

# 

# Default interface options

# 

network\_transport L2  
delay\_mechanism P2P  
time\_stamping hardware  
tsproc\_mode filter  
delay\_filter moving\_median  
delay\_filter\_length 10  
egressLatency 0  
ingressLatency 0  
boundary\_clock\_jbod 0

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 9:15am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/9 "2021-07-10T09:15:47Z")

</div>

Hi @JerryChang , We are using 32.5.1 SD card image downloaded from jetson download centre.

R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t186ref, EABI: aarch64, DATE: Fri Feb 19 16:50:29 UTC 2021

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 9:29am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/10 "2021-07-10T09:29:42Z")

</div>

do you connect two devices by direct copper wire cable?

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 10:05am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/11 "2021-07-10T10:05:03Z")

</div>

Hi @Andrey1984 ,  
I connect two devices with a ethernet cable .  
Where should I connect the copper wire cable?

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 10:46am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/12 "2021-07-10T10:46:10Z")

</div>

this should work for you

```auto
Host side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.1/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
date 010100002018
phc_ctl /dev/ptp0 set
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -m

DUT side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -s -m

```

what is the output of `phc_ctl /dev/ptp0 get` at the client side?

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 11:55am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/13 "2021-07-10T11:55:44Z")

</div>

Hi @Andrey1984 ,  
I have tried the above commands, but I coudn’t get the time synchronized on my slave device.The below is is the phc\_ctl /dev/ptp0 output on my device.

phc\_ctl[235.617]:  
capabilities:  
62500000 maximum frequency adjustment (ppb)  
0 programable alarms  
0 external time stamp channels  
0 programmable periodic signals  
doesn’t have pulse per second support

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 11:58am UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/14 "2021-07-10T11:58:58Z")

</div>

the command should be exactly

```auto
phc_ctl /dev/ptp0 get

```

with the get at the end

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 12:15pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/15 "2021-07-10T12:15:39Z")

</div>

Hi @Andrey1984 ,  
Sorry I missed out the get .I have added the result for the command below.

$ sudo phc\_ctl /dev/ptp0 get  
phc\_ctl[255.518]: clock time is 1625919201.249458848 or Sat Jul 10 17:43:21 2021

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 12:16pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/16 "2021-07-10T12:16:29Z")

</div>

yes but you would have to execute the whole thing again

```auto
Host side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.1/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
date 010100002018
phc_ctl /dev/ptp0 set
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -m

DUT side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -s -m
```

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 12:16pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/17 "2021-07-10T12:16:54Z")

</div>

execute both sides from root user, not sudo  
are both devices jetson NX’es?  
also you may paste both outputs of executing of

```auto
ethtool -T eth0

```

for linuxptp I would use

```auto
 git clone git://git.code.sf.net/p/linuxptp/code linuxptp
   cd linuxptp/
   make -j6
  sudo make install
```

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 1:03pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/18 "2021-07-10T13:03:17Z")

</div>

Hi @Andrey1984 ,  
I have tried using the linuxptp command from the site you have specified, but couldn’t find any improvements.  
Also I have pasted below teh output of ethtool -T eth0.

Time stamping parameters for eth0:  
Capabilities:  
hardware-transmit (SOF\_TIMESTAMPING\_TX\_HARDWARE)  
software-transmit (SOF\_TIMESTAMPING\_TX\_SOFTWARE)  
hardware-receive (SOF\_TIMESTAMPING\_RX\_HARDWARE)  
software-receive (SOF\_TIMESTAMPING\_RX\_SOFTWARE)  
software-system-clock (SOF\_TIMESTAMPING\_SOFTWARE)  
hardware-raw-clock (SOF\_TIMESTAMPING\_RAW\_HARDWARE)  
PTP Hardware Clock: 0  
Hardware Transmit Timestamp Modes:  
off (HWTSTAMP\_TX\_OFF)  
on (HWTSTAMP\_TX\_ON)  
Hardware Receive Filter Modes:  
none (HWTSTAMP\_FILTER\_NONE)  
ptpv1-l4-sync (HWTSTAMP\_FILTER\_PTP\_V1\_L4\_SYNC)  
ptpv1-l4-delay-req (HWTSTAMP\_FILTER\_PTP\_V1\_L4\_DELAY\_REQ)  
ptpv2-l4-sync (HWTSTAMP\_FILTER\_PTP\_V2\_L4\_SYNC)  
ptpv2-l4-delay-req (HWTSTAMP\_FILTER\_PTP\_V2\_L4\_DELAY\_REQ)  
ptpv2-l2-sync (HWTSTAMP\_FILTER\_PTP\_V2\_L2\_SYNC)  
ptpv2-l2-delay-req (HWTSTAMP\_FILTER\_PTP\_V2\_L2\_DELAY\_REQ)  
ptpv2-event (HWTSTAMP\_FILTER\_PTP\_V2\_EVENT)

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 1:08pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/19 "2021-07-10T13:08:51Z")

</div>

phc\_ctl /dev/ptp0 get  
should return the host device time at the client side if you repeat steps from root user

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 1:26pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/20 "2021-07-10T13:26:08Z")

</div>

Hi @Andrey1984 ,  
I have run the commands from the root terminal, but “phc\_ctl /dev/ptp0 get” on client side doesn’t return the time on the host side.  
Where as I am able to get the host device side time on client side when I run the ptpd command specified by you on this link ( [Implementation of Precise Time Synchronization between two Xaviers over WLAN](https://forums.developer.nvidia.com/t/implementation-of-precise-time-synchronization-between-two-xaviers-over-wlan/70980) )

Host side:  
sudo ptpd -M -V -i eth0  
Device side:  
sudo ptpd -s -V -i eth0

I wonder , why does the ptp4l command doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![Andrey1984](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/andrey1984/32/14130_2.png) [@Andrey1984](https://forums.developer.nvidia.com/u/Andrey1984)\
**Post date:** [July 10, 2021, 1:27pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/21 "2021-07-10T13:27:57Z")

</div>

> [@tegra\_user](#):
>
> un the commands from the root termi

ptpd and linux ptp [ptp4l] are two differnt projects  
also what is the output of `ethtool -T eth0` at the second device?

---

<div class="post-metadata">

**Author:** ![tegra\_user](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tegra\_user](https://forums.developer.nvidia.com/u/tegra_user)\
**Post date:** [July 10, 2021, 1:33pm UTC](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027/22 "2021-07-10T13:33:29Z")

</div>

Hi @Andrey1984 ,  
Do you have any suggestions why running the above commands(host and device side commands for ptp4l) doesn’t work for me ?

[Next page](https://forums.developer.nvidia.com/t/time-not-synchronized-between-two-nx-devices-with-ptp/183027.md?page=2)
