I am using ptp4l on linux machine. Currently, in the pcap trace I can see that the flag for PTP_Timescale is set to False. Is there anyway, that I can configure the PTP_Timescale parameter and set it to True?
Asked
Active
Viewed 1,110 times
1 Answers
0
The pmc
tool may be the answer you are looking for (I think the pmc
tool is included in the linuxptp package).
First Step:
Let's try and read your current configuration using the pmc
tool:
sudo pmc -u -b 0 'GET GRANDMASTER_SETTINGS_NP'
You should get a response in this structure:
sending: GET GRANDMASTER_SETTINGS_NP
020e06.fffe.814208-0 seq 0 RESPONSE MANAGEMENT GRANDMASTER_SETTINGS_NP
clockClass 255
clockAccuracy 0x21
offsetScaledLogVariance 0x436a
currentUtcOffset 37
leap61 0
leap59 0
currentUtcOffsetValid 1
ptpTimescale 0
timeTraceable 0
frequencyTraceable 0
timeSource 0xa0
Second Step:
Let's modify the timeTraceable
flag to 1 using a pmc
command (please note that I'm not changing the other flags - I'm writing the same values I've just read, except the timeTraceable
that we want to change):
sudo pmc -u -b 0 "SET GRANDMASTER_SETTINGS_NP clockClass 255 \
clockAccuracy 0x21 offsetScaledLogVariance 0x436a \
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \
ptpTimescale 1 timeTraceable 0 frequencyTraceable 0 \
timeSource 0xa0"
I hope this will do the job. If it doesn't help, try have a look at this links for more details:
pmc man page
pmc example

J.M.
- 472
- 1
- 6
- 15
-
I already tried to set the timesclace using pmc. But, in the trace I see that the ptp_timescale is still 0 (though I updated the Grandmaster settings using pmc). – Pratul Jn Feb 15 '21 at 12:23
-
Did you try the exact command I've posted here ? I tried it on one of my slaves/clients and the flag did changed his value. (note that when I tried the command with "pmc -t...." it didn't work, so I removed the "-t". don't know why it didn't work that way) – J.M. Feb 15 '21 at 12:30
-
When you type again: sudo pmc -u -b 0 'GET GRANDMASTER_SETTINGS_NP' , the "timeTraceable" is still set to '0' ? – J.M. Feb 15 '21 at 12:32
-
When try 'GET GRANDMASTER_SETTINGS_NP', the ptp_timescale is set to 1. But, in the wireshark trace i see that the ptp_timescale is still 0. – Pratul Jn Feb 16 '21 at 15:19