Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGN127507 not available. #219

Open
nmbath opened this issue Jul 13, 2021 · 8 comments · May be fixed by #240
Open

PGN127507 not available. #219

nmbath opened this issue Jul 13, 2021 · 8 comments · May be fixed by #240

Comments

@nmbath
Copy link

nmbath commented Jul 13, 2021

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
Copy link
Author

nmbath commented Jul 13, 2021

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
Copy link
Author

nmbath commented Jul 30, 2021

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

@tkurki
Copy link
Member

tkurki commented Jul 30, 2021

No attachment?

@nmbath
Copy link
Author

nmbath commented Jul 30, 2021

Archive.zip

Sorry attached this time.

@tkurki
Copy link
Member

tkurki commented Jul 30, 2021

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?

@nmbath
Copy link
Author

nmbath commented Jul 30, 2021

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 (canboat/canboatjs#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
Copy link
Author

nmbath commented Nov 18, 2021

Any progress on this?

@tkurki tkurki linked a pull request Apr 9, 2022 that will close this issue
@tkurki
Copy link
Member

tkurki commented Apr 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants