Wiring
Connect CAN-H to CAN-H and CAN-L to CAN-L between all devices on the bus. Reversing the pair will produce bit errors or complete communication failure. A 120-ohm termination resistor should be present at each physical end of the bus.
The RS485 CAN HAT speaks standard CAN 2.0B and EIA/TIA-485 (RS-485), so it connects directly to any device that implements these protocols. This page covers the practical details of getting a clean, reliable link between the HAT and third-party hardware.
Wiring
Connect CAN-H to CAN-H and CAN-L to CAN-L between all devices on the bus. Reversing the pair will produce bit errors or complete communication failure. A 120-ohm termination resistor should be present at each physical end of the bus.
Baud Rate
Every node on the bus must use the same bitrate. The demo code defaults to 100 kbps (bitrate 100000). If you are connecting to an automotive ECU or industrial device, check its documentation for the expected rate and match it on the Pi side.
CAN IDs
CAN is a broadcast protocol — all nodes see all frames. However, if your receiving application filters on specific arbitration IDs, make sure the transmitting device sends with a matching ID. The demo code uses 0x123.
Frame Loss
If you observe dropped frames during sustained high-throughput transmissions, reduce the bitrate or increase the txqueuelen on the Pi. Long bus runs at high bitrates are more susceptible to signal integrity issues, especially without proper termination.
is_extended_id=False). If your remote device sends extended (29-bit) IDs, update your receive filter accordingly.Wiring
Connect A to A and B to B between all devices. A shared GND connection between devices is recommended to prevent ground-potential differences from corrupting the differential signal.
Baud Rate
Both sides must agree on the baud rate. The demo code uses 115200 bps. Industrial Modbus devices commonly run at 9600 or 19200 bps — adjust the serial.Serial() baud rate parameter to match.
USB-to-485 Adapters
A USB-to-RS-485 adapter plugged into a laptop is the simplest way to test the HAT’s RS-485 output. Open a serial terminal (such as minicom, picocom, or PuTTY) on the adapter’s serial port at the matching baud rate and you should see data from the Pi immediately.