TL;DR - I can trigger it reliably in my case just by issuing M303 to run PID autotuning. I think there's something fishy going on with the mainboard and firmware on my CR6-SE that's causing this in my case. Using 'minicom' to run the M303 command does complete, but throws its own warning that it lost the serial port connection 30 seconds into the M303 - the same point that Octoprint drops out (minicom just carries on, however - built for the good old days of unreliable serial comms I'm guessing it reconnects automatically).
octoiprint-log-and-terminal-capture.zip (8.0 KB)
I've just hit this. The printer, with Octoprint on the RPi, has been running fine for a good number of weeks since I rebuilt the Pi with the 0.18 Octoprint to try Python 3. It's a Creality CR6 SE, so I have the 5v line on the USB cable isolated.
A print job had finished fine and the printer had been idle for a while (just reporting temperature), and I went to run the PID autotuning from the Terminal. A short time into that, the SerialException was thrown.
In its current state (I haven't power cycled the printer or restarted the Pi or Octoprint yet), it's repeatable - I waited for the PID autotune seqence to finish (the printer carries on doing it after Octoprint disconnects), then reconnected from Octoprint and issued the M303 again. The SerialException report recurred after a similar time into the command.
I switched debug on in Octoprint (I think - added DEBUG for 'octoprint' in the bottom of the logging tab), and did the M303 thing again a couple of times. Octoprint log and terminal capture attached.
I've now restarted Octoprint (not the whole Pi) - same behaviour; I get the SerialException part way into M303.
Now restarted the Pi - same behaviour.
Switched printer off and on - same behaviour.
Installed minicom onto the pi, use it to connect to the printer to run M303 - that worked, however I notice minicom flashed up "Cannot open /dev/ttyACM0" occasionally. In fact the first time it flashed up, is about the same point that Octoprint disconnected (about 30s after the M303 command is issued). I'm guessing that minicom is seeing the same glitch on the serial port that Octoprint is seeing, but is treating it as a temporary issue and carrying on, whereas Octoprint makes it a hard fault. The "Cannot open" message seems to pop up every 30 seconds.
I ran an apt-get update/upgrade on the pi, but that didn't change anything.
I'm using a BTT mainboard (replacement for the Creality CR6 board) with the BTT firmware, which itself is a small delta to the Creality 1.0.3.6 firmware (which we believe branched sometime shortly after Marlin 2.0 - y'all know the drill here).
I'll look to try a more upstream Marlin version and report back here.