Waveshare RS485 CAN HAT not compatible with Pi 5?

I have a new Raspberry Pi 5 running Bookworm with a Waveshare RS485 CAN HAT and am unable to get the HAT to transmit. Is this a known problem with Bookworm? Can anybody see what the problem might be? I am out of ideas.

Here is what I’ve done so far:

HAT attached via 40-pin GPIO on Pi 5. RS485 terminal block connected with a short jumper between A and B for loopback testing.

Verified serial devices:

ls -l /dev/serial* (/dev/serial0 → ttyAMA10)

Confirmed UART availability:

sudo dmesg | grep -i tty (ttyAMA10 active, no console attached)

Tried initial PySerial loopback script (without RS485 mode):

ser = serial.Serial(“/dev/serial0”, 4800, timeout=2)
ser.write(b’TEST’)
received = ser.read(4)

Result: Failed — no data received (b’').

Loopback Tests with PySerial RS485 Mode:

ser.rs485_mode = serial.rs485.RS485Settings()

Result: Failed — still no data received

GPIO Monitoring for DE/RE:

gpioget gpiochip0 4

Result: GPIO 4 was high at boot and never toggled during UART transmission attempts.

Tried ‘watch’ to monitor GPIO 4 while writing UART data — no change observed.

Added standard RS485 overlay for Pi 5 / Bookworm:

dtoverlay=uart1,txd1_pin=14,rxd1_pin=15,auto_rs485=on

Result: Rebooted; still, GPIO 4 did not toggle, and Python loopback test continued to fail.

Attempted to toggle GPIO 4 manually using libgpiod while sending UART data:

Result: Still failed — no data received over the loopback. GPIO 4 manual control did not enable transmission.

Hi Damien

Remove that immediately. You have just shorted out your RS485 transmission line. RS485 A and B is not a TX/RX combination it is a balanced line not unlike balanced audio. Nothing is referenced to ground. It is the voltage DIFFERENCE between A and B that is the signal.

This is a bit long winded to do a course on RS485 here so I would suggest reading up on the subject before you go any further.

I have not read your post any further that that line as it would be immaterial as the system would not work at all.

RS485 has pretty robust drivers but I am not sure how they handle a short circuit. Could be damage, don’t know and would not guess.
Cheers Bob
Note: You will come across mentions of RS422. The 2 systems are related but RS422 is one way. Either TX or RX. Not capable of half duplex operation.

1 Like

Hi there, @Damien296423, and welcome to the forum. Glad to have you here.

Have to echo Bob here.

If you’ve connected the A and B pins the best case scenario is that nothing will happen and most likely you would have a short circuit.

If you’re trying to do a loopback with the module, you would need to do the following:

Wiring:
H ----------------- A
L ------------------ B

Then, using the Waveshare’s FAQ information as a guide:

With any luck, your HAT won’t be damaged and you can verify that it is working.

1 Like

From our long discussions about RS485, I’d reckon it should be OK once the short is removed. I know I did some pretty dodgy things with the Maxim drivers!!

1 Like

Hi Jane

You should change that to WILL have a short circuit.
Marvelous what can happen when someone walks in like a bull in a china shop without any research.
First time I have seen that sort of thing though.
Cheers Bob
Cheers

1 Like