philhartung / node-ptpv2 Goto Github PK
View Code? Open in Web Editor NEWIEEE 1588-2008 PTPv2 Client for NodeJS
License: GNU General Public License v3.0
IEEE 1588-2008 PTPv2 Client for NodeJS
License: GNU General Public License v3.0
Per the tech brief at: https://chronos.uk/wordpress/wp-content/uploads/TechnicalBrief-IEEE1588v2PTP.pdf
Line 86 and 148 should read:
var version = buffer.readUInt8(1) & 0x0f;
I discovered this using linuxptp (ptp4l) - only the bottom 4 bits of byte 2 are used for the version number. For some reason my version of linuxptp is sending 00010010 in that byte, and the high nibble was making it value of 18.
Hi and thanks for open sourcing node-ptpv2.
I have a machine with two network interfaces, en0 and en1, both of which do multicast. There is a PTP grandmaster on a separate machine in en1's network.
$ ifconfig
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.126 netmask 255.255.0.0 broadcast 192.168.255.255
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
en1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2800
inet 172.24.1.126 netmask 255.255.0.0 broadcast 172.24.255.255
When init()
ing with en1's address, grandmaster's messages come in fine because the addr is passed through to the addMembership call.
//event msg client
ptpClientEvent.on('listening', function() {
ptpClientEvent.addMembership(ptpMulticastAddrs[ptp_domain], addr);
// ^ explicitly specified
});
However, sending delay_req
s goes over en0 instead, so a sync is never established. I'm wondering if the default interface and routing table should be bypassed, as they are for receiving? Currently, the routing table has to be adjusted accordingly instead. IMO both approaches have their merits, but if it should be up to the routing table I think addMemberships should be called without the addr as well, as that's an optional parameter. Another alternative would be varying what happens based on whether the user explicitly provided the address in the first place, or not.
It's a small change to align sends with the current behaviour for receives, so I'll be sending a PR for that shortly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.