Error while reading from serial port

What is the problem?

On longer prints (more than 4 or 5 hours), it will randomly drop serial connection with the line (from octoprint.log)

2020-01-08 04:17:57,906 - octoprint.util.comm - ERROR - Unexpected error while reading from serial port
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 2793, in _readline
    ret = self._serial.readline()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 4932, in readline
    c = self.read(1)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-01-08 04:17:57,954 - octoprint.util.comm - ERROR - Please see https://faq.octoprint.org/serialerror for possible reasons of this.
2020-01-08 04:17:57,978 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Offline (Error: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793)"

and from serial.log:

2020-01-08 04:17:57,952 - Unexpected error while reading serial port, please consult octoprint.log for details: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793
2020-01-08 04:17:57,955 - Please see https://faq.octoprint.org/serialerror for possible reasons of this.
2020-01-08 04:17:57,977 - Changing monitoring state from "Printing" to "Offline (Error: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)' @ comm.py:_readline:2793)"
2020-01-08 04:17:58,021 - Connection closed, closing down monitor

The pi itself never dies or reboots, just goes silent, printing-wise, for about 5 minutes before it restarts octopi and returns to waiting to print.

What did you already try to solve it?
Put peripherals (a usb light and a logitech cam) on a powered usb hub listed in the wiki as working. Disabled plugins (only one I was using was discordremote) Lowered webcam resolution to 640x480x15, changed timelapse interval to 25s. The timelapse and resolution seemed to fix it, but it happened again overnight on a beautiful silk gold vase print and now i'm sad.

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)

serial_cropped.log (69.8 KB) octo_cropped.log (73.1 KB)

(the logs have been cropped, and while discordremote was active for this one, i still was getting the same error without it active, so not the problem)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

Octoprint 1.3.12
Octopi 0.17
Ender 3 pro (stock except for a couple printed additions, nothing mechanical or hardware)
Firmware: Th3d U1.R2.21a
RPI 3B with the 8gb card that was originally included in the printer.
Logitech C920
Browser: doesn't matter, all
OS: Windows
Power Supply: 99% sure it's a 3A power brick. Can triple check

Right, and I've been through all the steps on that list from that post and I'm not having any luck, which is why I'm posting.

These are notoriously thirsty for power. I would recommend removing anything unnecessary and try again in Safe Mode. Undervoltage means that serial communications are trying to happen with too-low voltages.

Even though the light is plugged into the powered hub, and the Pi is powered from a separate power brick?

When the power for the hub fails, the hub draws all needed power from the PI...

Speaking of, remove the powered hub. Seriously, go vanilla. Find something simple that works and build back up until you find the culprit(s).

I had the same message on the log and for my experience on a Raspberry Pi 4 8GB I'm almost certain that it was due to hight temperatures on the Pi.

I had happyly printing for more than a year with my Ender 3v2 without ANY issue ever, and during the last 2 weeks I had 3 crashes over long prints ( +24h ). The only thing it changed it shat when I cleaned the case fan of the pi, I forgot to reconect the 2 cables at 3,3v, so the fan was off and the Pi at above 60degC. Since I reconect the fan, zero issues again.

So leason learned, cold cpu = happy cpu :slight_smile: