Rolf van Kleef - Is there a way to set NMEA-200...
Is there a way to set NMEA-2000 identification information? I see in https://github.com/SignalK/n2k-signalk/blob/14eebdfc56ac4d792e2b6c5b7a1772a6a6187ab8/n2kMapper.js#L359 that there are some properties pulled from somewhere, but I cannot find where I can modify these.
13 Replies
What n2k adapter are you using and what exactly do you want to change?
I use an mcp2515 connected through SPI to a Raspberry P 5. Stuff is working using CanboatJS configured for SocketCAN. As I linked, SignalkK sends several identification PGNs over N2k, and I want to adjust that data to differentiate different devices running Signalk.
Here's the relavent code in canboats
https://github.com/canboat/canboatjs/blob/65fd6e8764f9c7994f7b2d817d22981120f103bf/lib/n2kDevice.js#L37
GitHub
canboatjs/lib/n2kDevice.js at 65fd6e8764f9c7994f7b2d817d22981120f10...
Native javascript NMEA 2000 decoder and encoder. Contribute to canboat/canboatjs development by creating an account on GitHub.
You can manually set the addressClaim, productInfo and also the install info.
This is done in ~/.signalk/settings.json
for example:
Oh that's awesome! That helps enormously!
Thanks a lot!
It looks like this doesn't work anymore. These fields are not being sent out over the CANBus anymore?
I don’t think I changed anything that would effect this
They are definitely still being sent out.
Huh. I'll continue debugging then.
You know what. I guess I could have broken the part that gets the config. I did refactor some of that. I’ll do some testing…
For context, I ran Canboatjs 3.12.0. I'm currently upgrading to .1 in case one of the fixes there helps this issue.
.1 seems to make no difference.
Moreover, perhaps this is useful in debugginb. Even when I specify nothing of the values shown above, there is no mention of the default (which is Signal K, I think). There's just no productInfo pgn being sent it seems. I also think the addressClaim is a bit faulty as I'm unable to get an address other than 100. I'll go write down my findings in an issue on GH to provide a bit more structure to the problems i'm having.
I've some basic "mocked up" testing, and things look ok to me
Definitely working for me on my boat, but I don't want to mess with things there.
I don't have access to my lab right now, but will test there ASAP
Do you know what version of canbatjs worked for you?
You can turn on debug for
canboatjs:candevice
That should show you what is being sent outI remember doing it back in june (based on the initial messages in this thread).
I'll do that. 1 moment.
That should also show the address claim procedure
Hmm I see this in the log:
But I also see a LOT of this in the log:
Don't know if that has to do with anything though.
So I guess the plotter just isn't recognizing it somehow.
Though after restarting Signalk the log is somehow a lot cleaner. Showing that it does indeed send the product info and claims the address properly.
So perhaps it's a plotter issue. Very strange though. I'll see if I can decipher anything using the Actisense.
Curiosly enough it does show FUSION as the manufacturer, but no other information.
I think it's this: https://github.com/canboat/canboatjs/issues/157
At least it looks very similar.