Summary:
Is it possible, and if so how best, to connect a CAN-bus anchor chain counter to Signal-K running on an R-Pi?
I'm new to Signal-K development, so would appreciate your help.
Installation:
I have a Quick CHC 1203 chain counter. This has a CAN bus interface for connecting to a twin slave device. It is NOT described as being NMEA-2000.
My main instrument network is Raymarine ST-NG / N2K. It connects to a Raspberry Pi 3B+ with a Sailor Hat. This latter provides a CAN bus interface connecting the R-Pi to the ST-NG/N2K network. Signal-K runs on the R-Pi.
Objective:
I’d like to connect the chain counter to the Signal-K server via the N2K network. This could allow automatic detection of anchoring, monitoring of chain length vs. water depth, etc. The current initial objective however is simply to get the chain length deployed recognised by Signal-K.
Outline Plan so far:
- Connect a CAN lead to the slave port of the CHC 1203 and measure voltage on each pin.
- Connect the CHC 1203 direct to the R-Pi CAN interface, with the rest of the N2K network disconnected
- Monitor static traffic
- Operate each function of the CHC 1203 in turn, and monitor traffic
- Decipher the CHC 1203 PGN traffic.
- Write Signal-K plugin to add these PGNs to the standard dictionary
- Reconnect main N2K network and connect CHC 1203 to it
- Test all instruments and check for error messages
- Implement Signal-K plugin to support CHC1203
Considerations:
- Electrical compatibility: as the CHC 1203 device is described as having a CAN interface, I’m assuming it is electrically safe (voltage, current) to connect to the R-Pi CAN interface and later to the N2K network. Is this assumption correct? How do I best check it?
- Device compatibility: since the chain counter was designed to be on a private CAN network of only CHC 1203 devices, there is presumably a risk that its device address &/or PGNs conflict with those defined in N2K. How best to check this, and if it arises, is there a work around?
- What software is best for observing CAN traffic on the R-Pi while I attempt to decipher the CHC1203 traffic? I think the Signal-K server log will only show PGNs it understands - is that correct?
- I’ve dabbled in various software languages in the past - C, Fortran, Python-2, and VBA - but JavaScript and NodeJS is new to me. What resources would you recommend to learn it? What existing plug-in for supporting custom devices would you recommend as a starting template?