Matti Airas - Signal K server exposes a hard-co...
Signal K server exposes a hard-coded NMEA 2000 serial number of 123456 that is set in canboatjs (
lib/candevices.js:65
). This prevents multiple SK servers from participating on a single bus. I'd like to make the serial code dynamic - and possibly expose some other parameters such as LEN to SK settings.
Ideally, I think the serial code should be per-interface if someone insists on connecting multiple CAN interfaces to the same bus (don't know why anyone would do that, but I've seen weirder stuff happen). Would it be OK if I set the serial code value to the interface uniqueNumber
option field value?22 Replies
being able to customise that property is a good idea in general (can't recall exactly why it was requested before) and a step towards having multiple can interfaces (that involves also other things, like we have just a global sk-to-n2k conversion facility now)
I’m ok with setting that to the uniqueNumber field
That was simple: https://github.com/canboat/canboatjs/pull/267
GitHub
Make the NMEA 2000 product serial code unique by mairas · Pull Requ...
Use the uniqueNumber value as the NMEA 2000 product info model serial code instead of a hard-coded constant. This should allow having multiple Signal K servers on the same NMEA 2000 bus (a common o...
Did this actually cause any issues?
Yeah. I have a B&G MfD in my lab that's mostly showing the device list. If I have only one SK server connected to the N2K network, it shows up fine, but if there are two, neither of them is shown.
Are you sure that is because of the serial number?
No 🙂
But I can test now
You going to modify by hand? Or need me to make a release?
I just modified the file directly.
But yeah, so I was wrong - it's not the serial number.
Only one of the devices is shown.
Hmm….
I’d say it’s more likely someone in the address claim
Try changing the device instance stuff
I disconnected the first one. The second one doesn't come visible.
On its own, that is.
If you restart the second one?
So the sk servers see each other? (At the bottom of the data browser)
Darn. Wait. There might be some issue with that device. It was just a random HALPI test device that I picked up. It's not showing on the MfD even by itself...
OK, so for some reason the SK server crashes soon after restart on the other device. I might've done some wonky tests on the OpenPlotter image I have running there. The server stays up if it's manually restarted. Now I'm having only that device visible on the MfD and not the patched one.
I'll try changing the device instance.
I changed the lower, upper and system instance values from 0 to 1, and... wait, now the devices disappeared on the MfD???
I kicked up the "AOS NMEA Simulator" software on a Windows VM. Despite the name, it can also display fairly detailed information on the network devices.
It's also seeing only one device with address 100.
I changed the preferred address default value to 101 and now the modified device came online with address 107. So the address claim protocol seems to do its thing. Now both devices are transmitting, the other one with address 100. But when I scan the devices on the MfD, only the modified one shows up.
So somehow the response to whatever the info request PGN was gets botched up, maybe?
126996 Product Information
But at least they end up with different addresses
Hmm. Definitely something wrong here. You should not have to change that, the negotiation stuff should have chosen a different address.
Yup
The NMEA Simulator claims addresses 101-106, so that explains that.
I'll change the default value back.