Connect a Quick CHC 1203 Chain Counter via CAN-bus to Signal-K

510 views
Skip to first unread message

Martin Crick

unread,
Mar 30, 2022, 2:26:44 PM3/30/22
to Signal K

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:

  1. Connect a CAN lead to the slave port of the CHC 1203 and measure voltage on each pin.
  2. Connect the CHC 1203 direct to the R-Pi CAN interface, with the rest of the N2K network disconnected
  3. Monitor static traffic
  4. Operate each function of the CHC 1203 in turn, and monitor traffic
  5. Decipher the CHC 1203 PGN traffic.
  6. Write Signal-K plugin to add these PGNs to the standard dictionary
  7. Reconnect main N2K network and connect CHC 1203 to it
  8. Test all instruments and check for error messages
  9. 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?


kees

unread,
Mar 31, 2022, 5:42:58 AM3/31/22
to Signal K
I think it is safe electrically, but I would not mix the CHC CAN bus with the N2K CAN bus. So if you have N2K devices and you want the RPi to monitor that as well you will need 2 CAN interfaces.

Analysis of the CHC data can be done with the standard `candump` utility and once you have an idea what the data format is you can write some shim software that reads can dump and generates Signal K data. You could read `canboatjs` or `canboat` sources to see how we do this for N2K.

Note that it is not necessary for the CHC CAN data to be using the same structure as N2K; it might use 11 bit addressing instead of 29. It might look like J1939, N2K or something completely different. What the bits in the CAN address mean is up to the higher layer in the stack, f.i. N2K, J1939, etc. 
Reply all
Reply to author
Forward
0 new messages