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
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.
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...
If I recall, some adaptors, like the Actisense, give me a timestamp with the message
ok, this was my guess...
arrr OK
Others, the computer system time is used
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?
There is no timestamp in an n2k message
Sorry I mean is SignalK adding the time of the last frame received, or the first frame received as the timestamp in the log?
What hardware are you using for n2k input?
waveshare 2channel can hat
Checking…
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
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.
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