n2k-signalk icon indicating copy to clipboard operation
n2k-signalk copied to clipboard

PGN127507 not available.

Open nmbath opened this issue 3 years ago • 8 comments

It would seem that PGN127507 is not yet understood by Signal, but is by canboatjs.

canboatjs view

candump can1 | /usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/bin/candumpanalyzerjs | grep :129 | grep 127507 {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.019Z","fields":{"Instance":64,"Battery Instance":6,"Operating State":"Off","Charge Mode":"Echo mode","Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.022Z","fields":{"Instance":96,"Battery Instance":6,"Operating State":"Off","Charge Mode":7,"Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.023Z","fields":{"Instance":128,"Battery Instance":6,"Operating State":2,"Charge Mode":7,"Equalization Pending":"On","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.083Z","fields":{"Instance":160,"Battery Instance":6,"Operating State":"Off","Charge Mode":"Echo mode","Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.086Z","fields":{"Instance":192,"Battery Instance":6,"Operating State":"Off","Charge Mode":7,"Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.086Z","fields":{"Instance":224,"Battery Instance":6,"Operating State":2,"Charge Mode":7,"Equalization Pending":"On","Reserved1":"0","Equalization Time Remaining":64775},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.787Z","fields":{"Instance":0,"Battery Instance":6,"Operating State":"Off","Charge Mode":"Echo mode","Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.797Z","fields":{"Instance":32,"Battery Instance":6,"Operating State":"Off","Charge Mode":7,"Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:26.797Z","fields":{"Instance":64,"Battery Instance":6,"Operating State":2,"Charge Mode":7,"Equalization Pending":"On","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"} {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-13T12:34:28.287Z","fields":{"Instance":96,"Battery Instance":6,"Operating State":"Off","Charge Mode":"Echo mode","Equalization Pending":"Off","Reserved1":"0","Equalization Time Remaining":64520},"description":"Charger Status"}

If you need raw candump data, please let me know.

nmbath avatar Jul 13 '21 14:07 nmbath

Further the attached screen shot from Actisense reader might be off use, I have noted that the canboatjs decode is wrong. The instance numbers are all over the place.

Screenshot 2021-07-09 at 18 55 33

nmbath avatar Jul 13 '21 16:07 nmbath

I attach a diff for index.js and a file 127507.js that defines PGN127507 in SignalK as per the attached screen shot.

I would be great full if this could be added to the next release.

image

nmbath avatar Jul 30 '21 07:07 nmbath

No attachment?

tkurki avatar Jul 30 '21 13:07 tkurki

Archive.zip

Sorry attached this time.

nmbath avatar Jul 30 '21 13:07 nmbath

Most if not all pgns have a corresponding test, that verifies that the SK output is generated correctly from test input data. Could you provide one? Take a look at for example https://github.com/SignalK/n2k-signalk/blob/master/test/127751_dv_voltage_current.js

I haven't been following the canboat(js) related part of this - does this require an updated version of pgns.json?

tkurki avatar Jul 30 '21 14:07 tkurki

Please find attached what I hope is a correct test input data. The below is also candump data from my environment

can0 19F21381 [8] A0 06 71 00 08 FC FF FF

When piped through candumpanalyzerjs

cat PGN127507-single.txt | /usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/bin/candumpanalyzerjs {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-30T16:48:59.722Z","input":[],"fields":{"Instance":113,"Battery Instance":0,"Operating State":"Disabled","Charge Mode":"Standalone mode","Charger Enabled":"Off"},"description":"Charger Status"}

I also attach a longer extract from a candump with messages in form two different sources. One of which is a Victron Cerbo GX sending details about a MultiPlus.

Regarding canboat(js).....

It already has a definition of 127507, however it was defined as a single packet rather than fast, so the first 2 bytes are being interpreted incorrectly. When the definition in pgns.xml and therefore pgns.json and pgn.h is made to move 127507 from single to fast and size from 8 to 6, canboatjs has problems parsing the frame. I have raised an issues (https://github.com/canboat/canboatjs/issues/161) about this. Not having access to any other fast messages which are 6 bytes or less in size, I have not been able to identify how wide spread this issue is.

I have managed to get my system working by defining the length in pgns.json of 127507 to be 9 bytes, and a fast packet.

  {
    "PGN":127507,
    "Id":"chargerStatus",
    "Description":"Charger Status",
    "Type":"Fast",
    "Complete":true,
    "Length":9, <<<<< When set to 6 have issues
    "RepeatingFields":0,
    "Fields":[

The output above are using this definition

Hope that all makes sense.

PGN127507.candump.zip

cat PGN127507-single.txt | /usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/bin/candumpanalyzerjs {"canId":435295105,"prio":6,"src":129,"dst":255,"pgn":127507,"timestamp":"2021-07-30T16:14:30.558Z","input":[],"fields":{"Instance":113,"Battery Instance":0,"Operating State":"Disabled","Charge Mode":"Standalone mode","Charger Enabled":"Off"},"description":"Charger Status"}

127507_charger_statis.js.zip

nmbath avatar Jul 30 '21 16:07 nmbath

Any progress on this?

nmbath avatar Nov 18 '21 18:11 nmbath

Now there is, see the linked PR. Would have happened probably sooner with a pull request instead of attachments. Everything that creates friction just lessens the chance of stuff moving forward. But here we are.

tkurki avatar Apr 09 '22 13:04 tkurki