Giter Site home page Giter Site logo

ptp's Introduction

PTP

PTP made easy using a Docker container. This repo uses PTP4L daemon as-is from http://git.code.sf.net/p/linuxptp/code.

Pre-Reqs

  • You need the latest Docker version installed.

Building the Docker Container for PTP4L

  • In the ptp folder execute:

sudo docker build -f ./Dockerfile.ptp -t ptp4l:1.0 .

Running the Docker Container for 'PTP as a Client'

  • Start in the repo ptp folder

  • Disable Ubuntu 20.04 time sync service"

sudo systemctl stop systemd-timesyncd
sudo systemctl status systemd-timesyncd

  • Start PTP as a Client

If you DO NOT have an 802.1AS network switch execute:
sudo docker run -d --privileged -it --rm -v pwd/default.cfg/:/configs/default.cfg -v pwd/start-ptp-client.sh:/scripts/start-ptp.sh --net host ptp4l:1.0 bash -c "/scripts/start-ptp.sh"

If you DO have an 802.1AS network switch execute:
docker run -d --privileged -it --rm -v pwd/gPTP.cfg/:/configs/default.cfg -v pwd/start-ptp-client.sh:/scripts/start-ptp.sh --net host ptp4l:1.0 bash -c "/scripts/start-ptp.sh"

Running the Docker Container for 'PTP as the Primary (master)'

  • Start in the repo ptp folder

  • Disable Ubuntu 20.04 time sync service

sudo systemctl stop systemd-timesyncd
sudo systemctl status systemd-timesyncd

  • Start PTP as a Primary

If you do not have a 802.1AS network switch execute:
echo "Start PTP using default config which doesn't require 802.1AS switch docker run -d --privileged -it --rm -v pwd/default.cfg/:/configs/default.cfg -v pwd/start-ptp-primary.sh:/scripts/start-ptp-primary.sh --net host ptp4l:1.0 bash -c "/scripts/start-ptp-primary.sh"

If you DO have an 802.1AS network swtich execute:
echo "Start PTP-SW (not all devices support PTP in HW)" docker run -d --privileged -it --rm -v pwd/gPTP.cfg/:/configs/default.cfg -v pwd/start-ptp-primary.sh:/scripts/start-ptp-primary.sh --net host ptp4l:1.0 bash -c "/scripts/start-ptp-primary.sh"

Verify the Docker Container and PTP4L are running and are healthy

  • Get the running container ID using: sudo docker ps
  • sudo docker logs running container ID
  • Results should not show "Waiting for PTP". If this occuring then PTP is not working. Results should show offsets between PHC/system time and GM

ptp's People

Contributors

g2020sudo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.