n2k-signalk
n2k-signalk copied to clipboard
fix: PGN 127503/127504 -> use new canboatjs2 / canboat4 data, PGN 127501 -> off by one error fixed
Both PGNs (127503 and 127504) have repeatable fields. canboatjs2 and canboat4 messages have an array in fields called 'list' for these repeated dataset. This wasn't handled correctly by the current version of 127503.js and 127504.js
In my fix the PGNs now export directly a function to generate the deltas. I don't think this is the most elegant solution, but since the number of lines is variable I couldn't figure out another way.
Unfortunately I have only one AC phase on my boat, it would be good to see real world data using three phases. I could only simulate it by adding additional lines:
{"canId":435293963,"prio":6,"src":11,"dst":255,"pgn":127503,"timestamp":"2023-11-10T16:16:38.535Z","input":[" can0 19F20F0B [8] 80 14 00 01 FC C0 58 0F"," can0 19F20F0B [8] 81 00 88 13 FE FF FF FF"," can0 19F20F0B [8] 82 FF FF FF FF 00 00 FF"],"fields":{"Instance":0,"Number of Lines":3,"list":[ {"Line":0,"Voltage":227.2,"Current":1.5,"Frequency":50,"Reactive Power":65535}, {"Line":1,"Voltage":227.2,"Current":1.5,"Frequency":50,"Reactive Power":65535}, {"Line":2,"Voltage":227.2,"Current":1.5,"Frequency":50,"Reactive Power":65535} ]},"description":"AC Input Status"}
@sbender9 any insight here?