Close

Fixing Serial Communication Issues (spoiler: Raspberry Pi 3 hardware issue)

A project log for Klipper 3D Printer Firmware on Malyan M180 Install

I'm trying to install Klipper on my modified Malyan M180 3D Printer. Currently, Marlin is installed but it has loads of performance issues.

Timo BirnscheinTimo Birnschein 05/11/2022 at 14:460 Comments

During my past couple months with Klipper, Moonraker and Fluidd, I have been reasonably happy with the status and print quality of the machine. There are some stuttering issues I still can’t explain under certain circumstances but all in all, it works. Plus, Fluidd is… well more fluid than OctoPrint, too.

However, every once in a while I would wake up in the morning to start a print only to be presented with a communication error message stating the MCU is disconnected and doesn’t respond.

So I logged into the Raspberry Pi via ssh and “dmesg” revealed that I have indeed a usb2serial converter issue. The CH341 disconnects every so often and comes back up by itself. Turn out, googleing raspberry pi 3 ch341 disconnection has a lot of hits with many people complaining that the issue could never be resolved... Well, I have identified a possible solution....

A quick check using

vcgencmd get_throttled

revealed.... nothing. It's not a power issue. The return is

0x00

which means no throttling due to power happened in the past (probably since the last reboot). So back to square one.

I suspected a driver issue on the linux distribution side. A quick google search confirmed this. The CH341 kernel module that comes standard is no good and needs to be replaced for trouble free operation.

I followed a few tutorials (like this and this), compiled and loaded the new CH34x kernel module and observed the results. Unfortunately, the next day, I was greeted with the same disconnect messages I had seen before. How troublesome! The reason this is so frustrating is, my printer was absolutely stable running Marlin + Octoprint and the serial connection has, or rather should have, absolutely nothing to do with the AVR since it's entirely handled by a different chip: The CH341 USB to Serial Converter. So what's wrong here?

A few weeks later and actually even a few failed prints due to disconnects mid-way, I decided it was time for more drastic measures.

Back when I switched from Marlin + Octoprint to Klipper + Fluidd I took a new SD card on a new Pi3 and installed everything on a separate system so that I could always go back without making any changes at all. In other words, the only thing that could have an impact on the serial connection quality itself is the Pi 3 since I already tried pretty much everything else.

So I pulled the SD card out of one, swapped the Pi3 connected to my printer, plugged the SD card back in and rebooted. You can guess my surprise when I now finally have no issues anymore. The Pi3 itself has an issue likely on the hardware side. Swapping the Pi and do nothing else solved this CH341 serial connection drop issue for me. I hope it stays that way! I'll place a marker on this Pi3 board.

Discussions