Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get PTP configuration tied up and daemonized #1

Open
geerlingguy opened this issue Dec 13, 2024 · 3 comments
Open

Get PTP configuration tied up and daemonized #1

geerlingguy opened this issue Dec 13, 2024 · 3 comments
Labels

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented Dec 13, 2024

Right now I have a couple tasks in the ptp.yml tasks file that I still need to write:

  • Set up the Pi as a PTP grandmaster on eth1: sudo ptp4l -i eth1 -m
    • Maybe set up configuration inside /etc/linuxptp/ptp4l.conf?
  • Set up phc2sys to sync the clock on the NIC: phc2sys -a -rr
  • (Maybe) use testptp to set PPS out on the proper pin:
    • Install from testptp.c and gcc -Wall -lrt testptp.c -o testptp, then sudo mv testptp /usr/bin/
    • sudo testptp -d /dev/ptp0 -L2,0 (not sure if that's the right pin...?)
    • sudo ./testptp -d /dev/ptp0 -p 1000000000

For reference:

$ phc2sys -h
usage: phc2sys [options]
 automatic configuration:
 -a             turn on autoconfiguration
 -r             synchronize system (realtime) clock
                repeat -r to consider it also as a time source

$ testptp -h
usage: testptp [options]
 -c         query the ptp clock's capabilities
 -d name    device to open
 -l         list the current pin configuration
 -L pin,val configure pin index 'pin' with function 'val'
            the channel index is taken from the '-i' option
            'val' specifies the auxiliary function:
            0 - none
            1 - external time stamp
            2 - periodic output
 -p val     enable output with a period of 'val' nanoseconds
@jauderho
Copy link

I was trying to use timemaster to set up both chrony and linuxptp but got sidetracked. Maybe this would be of interest to get both tied together?

@geerlingguy
Copy link
Owner Author

@jauderho - I was planning on configuring the individual portions by hand, but timemaster does seem like a potential way to tie it all together as well.

@geerlingguy
Copy link
Owner Author

geerlingguy commented Dec 22, 2024

Hmm... also https://github.com/MaciekMachni/ptp_recipes/blob/main/grandmaster.md for a tidy config (assuming NTP not running, in this case; see this NetDevConf presentation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants