Mcu randomly disconnects mid print :(

So basically like it will just randomly disconnect from my klipper mid-print, I also noticed a while ago that it would also disconnect if I just left everything idle for a while, however I did do a lot of changes since then.

Here is what I’ve done so far:

Proper PSU *I was previously running a phone charger on pi but I fixed that, still idles out at like 90’ish %*

Different Cables (Specifically for data connection from ender 3 to rpi3)

Different USB ports on pi

Complete reinstallation of Both OS and Printer firmware (But I did keep my same configs)

Technical Specifications

Printer: Ender 3 with 4.2.2 mainboard

Host: Rasperry pi 3 Model b Revision 1.2

UI: KlipperScreen + Fluidd

Klippy.log

klippy (1).log (7.3 MB)

Check the following two articles and make sure to run latest Klipper code in upcoming tests:

Your log seems not fully conclusive.

Very strange. The main error appears to be a MCU 'mcu' shutdown: Missed scheduling of next digital out event error. This occurs when the micro-controller detects that a heater has been enabled and the host unexpectedly stops sending updates for that heater.

It also appears that the host incorrectly stopped sending these heater updates. (Specifically, both the nozzle and bed heaters were active at the time, but the host was only sending updates for one heater.) The micro-controller correctly responded to this host problem by shutting down (and thus turning off the heaters).

Unfortunately, I am not seeing any clues in the log why the host code did not function correctly. This makes it difficult to give advice. You might want to try reinstalling the host klipper code and make sure you have no local code modifications. If the issue continues, try collecting more logs (and post them here) as that may help provide additional troubleshooting clues.

-Kevin

My 2c. UART allows asymmetrical data transfer, so it is possible to not receive data, or be unable to send it.

MCU was not able to deliver messages to the host, see oid=19:

Receive: 86 13390.971922 13390.742877 15: seq: 1d, analog_in_state oid=11 next_clock=1662445696 value=13827
Receive: 87 13390.991970 13390.742877 15: seq: 1d, analog_in_state oid=13 next_clock=1663885696 value=28204
Receive: 88 13391.052260 13391.042697 14: seq: 1e, analog_in_state oid=19 next_clock=1668205696 value=2432
Receive: 89 13391.272949 13391.262349 15: seq: 16, analog_in_state oid=11 next_clock=1684045696 value=13822
Receive: 90 13391.291866 13391.262349 15: seq: 16, analog_in_state oid=13 next_clock=1685485696 value=28209
Receive: 91 13391.352140 13391.348317 14: seq: 17, analog_in_state oid=19 next_clock=1689805696 value=2434
Receive: 92 13391.508527 13391.505907 11: seq: 18, clock clock=1679978855
Receive: 93 13391.572324 13391.505907 15: seq: 18, analog_in_state oid=11 next_clock=1705645696 value=13827
Receive: 94 13391.872948 13391.700704 15: seq: 1a, analog_in_state oid=11 next_clock=1727245696 value=13823
Receive: 95 13391.892996 13391.700704 15: seq: 1a, analog_in_state oid=13 next_clock=1728685696 value=28209
Receive: 96 13392.172532 13392.084312 15: seq: 10, analog_in_state oid=11 next_clock=1748845696 value=13823
Receive: 97 13392.192697 13392.084312 15: seq: 10, analog_in_state oid=13 next_clock=1750285696 value=28208
Receive: 98 13392.253016 13392.204114 14: seq: 12, analog_in_state oid=19 next_clock=1754605696 value=2437
Receive: 99 13392.253113 13392.204114 12: seq: 12, shutdown clock=1733581813 static_string_id=Missed scheduling of next digital out event

Seems to be only 100us between oid=19 and the shutdown.

There is no data in the short frame (13392.25 - 13391.35 = 0.9s) from oid=19.
And with the current MAX_HEAT_TIME and the next_pwm_time:
3 * 0.75 = 2.25.
It is possible that 0.9s are just larger than the 0.75s window when the host wants to send the update.

I suspect this just happened. Intermediate connection issue, not able to deliver ADC, not able to trigger PWM heater update → death.

1 Like

Good catch! That does give a good explanation for the fault.

So, the error actually resulted from lost messages between MCU and host. Two consecutive temperature updates from the extruder were lost, and that resulted in a sufficient gap in heater updates to cause the MCU to shutdown.

There should not have been lost messages from MCU to host. Unfortunately, that could be indicative of a failing USB-to-serial chip on the mainboard.

The host software could also be a little more resilient to lost temperature updates: heaters: Set next_pwm_time to 0.66 * MAX_HEAT_TIME by KevinOConnor · Pull Request #7008 · Klipper3d/klipper · GitHub

-Kevin

1 Like