Problem with WaveShare CAN HAT - lost communication

Basic Information:

Printer Model: Voron 2.4
klippy.log (1.3 MB)

Describe your issue:

I heard from a lot of people having trouble with the WaveShare CAN Hat. Most have setup the CAN bus correctly (correct 120Ohm resistors at the end of the bus, 60Ohms bus resistance, correct wire, correct bus speed on all devices, …).
And mostly the printer works for some time and then there is one of the following MCU issues :
btw. The error occurs with 250000 and 500000 Baud.

It has been reported that the WaveShare CAN HAT could lead to some trouble because of lost packages. Question is … Are there any solution to this topic? Is there any way to debug this issue to get a better understanding of what’s going wrong here?

There is also an old thread about SPI Low Latency Kernel settings. Could this be an issue with the modern Raspberry Pi Kernel?

As I said before, this is not a single case. I knew a lot of people which have exact the same problem using the WaveShare Board regardless if they are using a Pi3 or a Pi4.

Would be really helpful if anyone (of the devs ?) can take a look at this topic. More and more people start using CAN bus, but at the same time more and more people have this problem (and gut ruined prints …).

What we can see on one printer are RX error in the CAN Dump:

candump -t z -Ddex can0,#FFFFFFFF

As you can see in the result there is a rx-overflow error and there are a lot more in the complete log.

Any help would be really appreciated.

Make sure you have the correct crystal frequency in your boot.txt

Download CAN bus tools
Use the command to create traffic on the can bus in a shh terminal.

Use the command ifconfig in a second ssh terminal to check for errors during the above command, if errors grow this could mean interference or bad connections.

Edit /etc/network/interfaces.d/can0
And change auto can0 to allow-hotplug can0

The above will attempt to recover the connection.

Right - getting the config.txt settings correct for the “can hat” is critical. Some people have also found success by increasing (or even removing) the spimaxfrequency parameter.

Ultimately though, if you’re having issues with the can hat you may want to buy a USB adapter. The USB adapters are, generally, more flexible and higher quality. I was never able to get my “can hat” to reliably do 1Mbit/s, while that speed is not an issue on the USB adapters (as long as you can find one that you can flash the latest candlelight_fw or Klipper in “usb to canbus bridge mode” on). When we first started canbus support in Klipper it was not easy to find USB canbus adapters, but they seem to be more prevalent now.


1 Like

I’m somewhat certain that the issue is not the CAN hat, but the EBB36 board. On various discord channels, I see a lot of people recommending to use USB instead. I use the waveshare hat with a mellow fly-sht36 with absolutely zero issues, but with a CANable USB adapter, I still get disconnections mid-print with the EBB36. No errors, no lost packages, but from one moment to the next, the fans turn off and a moment later it disconnects. Both running on 500k.

Hi !
Just heard from one person that turning off the SPI interface helps.
There where timeout errors during homing. And after disable the SPI and MAX31855 the problems where gone.
So maybe there is some bug / timing issue with CAN and SPI ?


My board doesn’t even have the MAX chip. I just disabled the ADXL for testing. Not sure if you can actually completely disable the SPI interface on the EBB36 board.