Random MCU communication errors

Basic Information

[CR6-Max] Printer Model
[stm32f103xe] MCU / Printerboard
klippy.log (1.8 MB) klippy log

Describe your issue:

It recently started without me knowingly changing something (altough as you can see from the logs I only have Klipper since a month or so and was just about to tune input shaping)

It started a week ago, when a 20hr print stopped after 7.
I restarted klipper and everything was fine again.
Restarted the print and made it to 12hrs. Same thing again. MCU connection error
This goes on and on. As soon as I restart it, it’s fine for some hours.

Today it stopped after about 1hr

I am using a Surface Book 1 with Ubuntu on it, installed it using Kiauh.
It did print fine before.

What I tried:
Different USB Cable
Different USB on the Laptop
Restarting multiple times
Printing slower to rule out overheating (probably stupid but I didn’t know what else to try)

Can someone help please?

Thanks!

See Timeout with MCU / Lost communication with MCU

Thanks for the suggestions but I tried a lot of those things already

Now I also tried:
Unplugging everything except the one USB to the printer
Stress testing the Laptop to make sure it’s not underpowered

It worked fine for a couple of hours and now the same error accured again. Of course both USB Ports and/or all 3 cables could have died at the same time, but I doubt that. Is there something else I could try?

Downloaded the logs
moonraker.log (391.4 KB)
klippy(2).log (3.5 MB)

Unfortunately I do not know of any more reasons that already given in the link above and typically it is one of them.
The laptop is delicately running Klipper and not any virtual machine / WLS additional things?

It is ubuntu with gui and I use it for spotify youtube and so on. But while testing I dont.

Maybe I need to try the cut wire trick on the usb cable…

Or maybe theres something in ubuntu that puts the usb to sleep?

Did log the USB and got the following:

[  +0.227356] usb 1-1.1: new full-speed USB device number 8 using xhci_hcd
[  +0.101286] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[  +0.000005] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  +0.000002] usb 1-1.1: Product: USB Serial
[  +0.008418] ch341 1-1.1:1.0: ch341-uart converter detected
[  +0.000715] usb 1-1.1: ch341-uart converter now attached to ttyUSB1
[Mar 3 19:50] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002636] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002563] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002690] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002786] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002461] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.015045] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.001913] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002625] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002607] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002838] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002389] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.041014] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002300] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002776] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002605] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002541] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.002538] ch341-uart ttyUSB1: usb_serial_generic_write_bulk_callback - nonzero urb status: -71
[  +0.034002] usb 1-1-port1: disabled by hub (EMI?), re-enabling...
[  +0.002528] usb 1-1.1: USB disconnect, device number 8
[  +0.002382] ch341-uart ttyUSB1: ch341-uart converter now disconnected from ttyUSB1
[  +0.000023] ch341 1-1.1:1.0: device disconnected
[  +0.231423] usb 1-1.1: new full-speed USB device number 9 using xhci_hcd
[  +0.101729] usb 1-1.1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[  +0.000006] usb 1-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  +0.000002] usb 1-1.1: Product: USB Serial
[  +0.008091] ch341 1-1.1:1.0: ch341-uart converter detected
[  +0.000995] usb 1-1.1: ch341-uart converter now attached to ttyUSB0

Seems to be something USB related as you stated. I did cut the power cable. No difference tho,

When it is random, EMI comes to my mind.

So try a better shielded cable?

Yes.
If there are high power devices near by, like ACs etc, you also may block the power cords.

EMI is quite a complex area. Lot of things can cause issues.

I’m not sure, but it sounds like you’re not using a single board computer like a Raspberry Pi to run Klipper on but a Microsoft Surface PC running Ubuntu - is this correct? If that’s the case, then the issue is most likely caused by the OS software performing periodic high priority tasks like garbage cleaning.

Generally, “better shielded” USB (HDMI, audio, etc.) cables are scams to get customers to pay more for perceived improvements as most, if not all, USB cables have the data lines in a foil or braided shield like:

Now, very old USB cables may not be shielded and, if you are using one, you could try replacing it with newer one.

Before doing anything, you should take a look at the USB cable’s path and see if it is close to or wraps around any power cables. Check to see if it’s running by the AC/DC power supply in your printer or any of the stepper motors. Chances are if you run the cable a different way things will get better (or worse) which means that you do have an EMI problem.

As well as getting a newer USB cable, you could try a clip on Common Mode Choke (aka “Ferrite Bead”) onto your USB cable to help minimize interference.

You should be able to get them at a local computer store for a few bucks and try putting one on each end, 4" to 6" from the connectors but this is a hail Mary option.

Good luck and let us know how things work out.

1 Like

Also take care, that the USB cable does not get too close to the steppers and their cables.

I would also say that EMI can be injected from rouge electric devices in the same power line. I had a medical heater pad inside my filament box with automatic temperature cutoff. Each time the pad triggered, …

1 Like