SIgnalK Logs Timestamp Sources

In the SignalK log there is a timestamp line that looks like this: 1731095410848;A;2024-11-08T19:50:10.847Z or 1731095410840;A;2024-11-08T19:50:10.840Z Sometimes the first timestamp lags behind the second timestamp by 1msec, sometimes they are the same. What are the sources for each? I am assuming the first is when it was written to the file, and the second is when it was received or decoded? What's the A for?
14 Replies
Scott Bender
Scott Bender7d ago
The second timestamp is what came from n2k. Which can depend on which adapter you have. I think the first one might be system time, but I’d have to go dig in the code to find out for sure. I can look into that tomorrow. The A is the type of data. In this case, n2k. Would be different for 0183, SignalK delta, etc. You are probably seeing the difference between when it was received and when it was written to the file.
UncleBulgaria
UncleBulgariaOP7d ago
you mean the adapter has it's own time? My pi is GPS GPIO synced so system time is within 100ns most of the time...
Scott Bender
Scott Bender7d ago
If I recall, some adaptors, like the Actisense, give me a timestamp with the message
UncleBulgaria
UncleBulgariaOP7d ago
ok, this was my guess... arrr OK
Scott Bender
Scott Bender7d ago
Others, the computer system time is used
UncleBulgaria
UncleBulgariaOP7d ago
Do you also know if for a NMEA 2k fast packet the timestamp is on the last frame of the message or the first frame of the message? Or can you point me to which part of the code to look at?
Scott Bender
Scott Bender7d ago
There is no timestamp in an n2k message
UncleBulgaria
UncleBulgariaOP7d ago
Sorry I mean is SignalK adding the time of the last frame received, or the first frame received as the timestamp in the log?
Scott Bender
Scott Bender7d ago
What hardware are you using for n2k input?
UncleBulgaria
UncleBulgariaOP7d ago
waveshare 2channel can hat
Scott Bender
Scott Bender7d ago
Checking…
UncleBulgaria
UncleBulgariaOP7d ago
sorry I should probabhy clarify, my question has moved on.. maybe I should ask another question.... When signalk generates it's json, it reassembles the raw 8 byte canframes, does it use the timestamp of the first or last frame for it's json
Scott Bender
Scott Bender7d ago
I think it will be when we receive the last frame Not 100% sure. Would have to do a bunch more digging through code to verify.
Teppo Kurki
Teppo Kurki7d ago
A tells that the data for this line is n2k data. If you have data sources of multiple types there would be other values in this spot
Want results from more Discord servers?
Add your server