| Next revision | Previous revision |
| network:gps [2026/03/14 21:49] – created gm5alx | network:gps [2026/03/14 21:52] (current) – [Step D: Configure PTP (linuxptp)] gm5alx |
|---|
| * **Avoid:** Pi 3 or Zero. These use USB-to-Ethernet bridges or lack hardware timestamping support, which forces you to use “Software PTP,” significantly degrading accuracy. | * **Avoid:** Pi 3 or Zero. These use USB-to-Ethernet bridges or lack hardware timestamping support, which forces you to use “Software PTP,” significantly degrading accuracy. |
| |
| | [[https://gemini.google.com/share/9fe616a57ef0|Gemini link]] |
| ---- | |
| |
| ===== 2. Hardware Connections ===== | ===== 2. Hardware Connections ===== |
| PTP on Linux uses ''%%ptp4l%%'' to manage the hardware clock and ''%%phc2sys%%'' to sync the System Clock (disciplined by your GPS) to the Ethernet controller’s PTP Hardware Clock (PHC). | PTP on Linux uses ''%%ptp4l%%'' to manage the hardware clock and ''%%phc2sys%%'' to sync the System Clock (disciplined by your GPS) to the Ethernet controller’s PTP Hardware Clock (PHC). |
| |
| <HTML><ol style="list-style-type: decimal;"></HTML> | |
| <HTML><li></HTML><HTML><p></HTML>**Sync System Clock to PHC:**<HTML></p></HTML> | **Sync System Clock to PHC:** |
| <HTML><p></HTML>''%%sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &%%''<HTML></p></HTML><HTML></li></HTML> | |
| <HTML><li></HTML><HTML><p></HTML>**Run PTP4L:**<HTML></p></HTML> | * ''%%sudo phc2sys -s CLOCK_REALTIME -c eth0 -w &%%'' |
| <HTML><p></HTML>''%%sudo ptp4l -i eth0 -m -S%%'' (The ''%%-S%%'' is for software-assisted hardware timestamping).<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML> | |
| | **Run PTP4L:** |
| | |
| | * ''%%sudo ptp4l -i eth0 -m -S%%'' (The ''%%-S%%'' is for software-assisted hardware timestamping). |
| |
| To turn your Raspberry Pi 4 into a **PTP Grandmaster**, you need a configuration that tells ''%%ptp4l%%'' two things: “I am the boss” and “Never listen to anyone else’s clock.” | To turn your Raspberry Pi 4 into a **PTP Grandmaster**, you need a configuration that tells ''%%ptp4l%%'' two things: “I am the boss” and “Never listen to anyone else’s clock.” |
| * ''%%assuming the role of MASTER%%'': This confirms it is broadcasting time to the network. | * ''%%assuming the role of MASTER%%'': This confirms it is broadcasting time to the network. |
| |
| **Would you like me to show you how to set these up as ''%%systemd%%'' services so they start automatically whenever the Pi boots?** | |
| |