I’m not sure if this thread is still searched by people who are struggling… I had a multitude of issues getting CAN bus stable, and I spent hours searching for answers and trying every possible combination.
I started with an SKR 1.3 with an RPi 3b and a waveshare CAN hat. It worked but was incredibly unreliable. I tried every combination of settings out there: 250k, 500k. long txq length short… modifying the mcu.py (this is just masking your problem). All for naught… Some things made it more stable, others not… I learnt a LOT about Linux, CAN, Klipper and Mainsail/Moonraker in a short time. In the end, the logs, and error messages are somewhat cryptic, and often a bit ambiguous.
In the end, I replaced my SKR 1.3 with an Octopus 1.1 to use the onboard CAN, but before that, I opted for an Opto-isolated dual CAN hat (made no difference).
Just to throw my experience also into the fold, in the end getting things “stable” was replacing my 5V power supply. It was “noisy”, and as soon as it was under some load, seemed to cause random issues, not just related to CAN. I only saw this after putting it on a scope as a desperate measure.
The long and the short is that time-critical CAN messages, with a heavy duty cycle, is sensitive. It really has to be fine-tuned.
After doing away with the power supply, an issue only manifested when doing shaper calibration, as this puts the CAN comms under a LOT of pressure. Here’s the kicker. in the end, increasing the CAN speed to 1000 000 from 500 000 made it handle the load, and not run itself into knots. One would think that would decrease reliability.
I think the CAN mechanisms need to mature a bit still, and we are the early adopters. For now I got EVERYTHING to work as I want it to, and it’s a full house of features:
- CoreXY with 3 point bed
- Octopus 1.1 (CAN Bridge mode)
- EBB42 (BLtouch, Revo,BMG)
- 5ich TFT (Klipperscreen)
- 36 LED addressable LED strip
- Servo activated Brush (clean nozzle… no space in my frame fo rfixed mount)
- Relay control to disarm 24V PSU
The point of listing all of this is not anything other than to state that ALL of this can play nicely together with CAN.
Getting everything in Klipper working can make you humble, but so worth it.
CAN modules are the future.
In summary:
- Excellent quality CAN comms and as little RF interference as possible is critical (twisted pair, resistance measuring 60ohm, good quality power source)
- Speed is king. Definately at least 500 000, I recommend 1000 000
- the waveshare CAN hat is flrting with the edge of capable…If you have a choice get USB can adapter, or better yet CAN bridge on a compatible board
- changing the mcu.py code, will make it better, but it’s not the answer.