I downloaded the libptpmgmt from sourceforge and then tried to use the libptpmgmt with python test. But getting following error.
# python3 test.py
Traceback (most recent call last):
File "test.py", line 14, in <module>
ModuleNotFoundError: No module named 'ptpmgmt'
The test script fails to find the libraries.
Python script needs 2 libraries:
libptpmgmt.so - The ptpmgmt C++ library.
_ptpmgmt.so - The python wrapper library.
You can install the libraries in your system.
Or you can use:
LD_LIBRARY_PATH to tell the shell the path to
PYTHONPATH to tell the shell the location of the python wrapper library files.
$ LD_LIBRARY_PATH=.. PYTHONPATH=3 python3 test.py
Can you provide details how can I make use of ptpmgmt to get, query and set PTP configuration parameters?
The PTP daemon comes with its own configuration. The ptpmgmt uses the PTP IEEE management messages to monitor, query and set.
Look in the
test.py, it shows reading and setting of
PRIORITY1. You could also see
sample/sync_watch.py which “continuously checks whether a PTP client is well synced to its master”, using the
The library supports linuxptp vendor specific TLVs like:
_ptpmgmt.so files? How do I build them?
They are built by the project.
You need swig to generate the wrapper code, and python development package for C API.
make file would skip the python wrapper library if python development were absent.
The project supports several languages in addition to native C++ library. The
make does NOT notify the absence of languages, as the user may defer them.
Where can I download the
The project does not provide binaries. You can build packages for your Linux distribution.
- Debian package
- RPM package
- Arch Linux package
Users can create packages for their system. The packages are per language, so for example, you can install the package for python only.
I use Cent OS Linux.
You can build RPMs with
$ make rpm
The RPMs are tested on Fedora and should work on all RPM-based Linux distributions.
The RPM files are stored under the