Octoprint randomly disconnects

What is the problem?
Octoprint disconnects randomly during a print with no ryhme or reason

What did you already try to solve it?
tried 2 different usb cables

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
Heres the seemingly relivant log info

2018-08-19 08:12:46,857 - 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 2581, in _readline
    ret = self._serial.readline()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 4615, 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?)
2018-08-19 08:12:46,903 - octoprint.util.comm - ERROR - Please see https://faq.octoprint.org/serialerror for possible reasons of this.
2018-08-19 08:12:46,929 - 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:2581)"
2018-08-19 08:12:46,950 - octoprint.filemanager.analysis - INFO - Starting analysis of local:body.gcode
2018-08-19 08:12:46,955 - octoprint.filemanager.analysis - INFO - Invoking analysis command: /home/pi/oprint/bin/python2 -m octoprint analysis gcode --speed-x=6000 --speed-y=6000 --max-t=10 --throttle=0.0 --throttle-lines=100 /home/pi/.octoprint/uploads/body.gcode
2018-08-19 08:12:47,124 - octoprint.plugins.filamentmanager - INFO - Filament used: 1872.3704 mm (tool0)
2018-08-19 08:12:47,324 - octoprint.plugins.astroprint - ERROR - HTTPSConnectionPool(host='api.astroprint.com', port=443): Max retries exceeded with url: /v2/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6f1cabd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2018-08-19 08:12:47,407 - octoprint.plugins.astroprint - ERROR - Failed to send print_job request: HTTPSConnectionPool(host='api.astroprint.com', port=443): Max retries exceeded with url: /v2/print-jobs/4b521922767d4b5fab251dece4b734d1 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6f330bd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2018-08-19 08:19:20,118 - octoprint.filemanager.analysis - INFO - Analysis of entry local:body.gcode finished, needed 393.17s

I had been using a camera that had a flashlight on it, removeing this seems to have fixed the problem. Now I need a new way to monitor it tho...

Will report back after a couple prints

Are you using a 3A power supply to provide power to your raspberry? Maybe your webcam is draining too much power from your Pi. Some webcam models require a powered usb hub.

1 Like

I am using a canakit power supply, 5v 2.5A

Well, yeah, but...

The Raspberry Pi 3B itself needs 2.5A of 5V power. If I (somehow) try to charge my MacBook on one of the USB ports, I'm trying to draw power from that 2.5A from the Raspberry Pi's power adapter. Likewise, the bright LED from the webcam is likely trying to draw a lot of power (more than it should).

Hello all, I am just new here. I've been looking for way to solve problem like this.
My printer keep disconnecting from the OctoPrint randomly too. Did not happen before update to the latest version. The problem is so annoying . Some time just command to turn on the heat bed would make the OctorPrint disconnect. I try to print directly from the computer without go through the Raspi3B. No problem. Then I go further and install Octoprint on window. It works flawlessly. I suspect the Raspi3B so I bought a new Raspi4( better right). Well it's not it is even worse than the Raspi3B. It just disconnect after report about 3 line of temperature reading. Al so the camera frozed. I started to look at the Raspi pwer supply( even though the Octoprint report no problem with it). So, I get a beefy 5V 10A and cut short the power cable to only 3 inches long. Voila! it works, no more disconnecting.. But I still can't figure out what is the reason. Why it's only happen after I update the Octoprint. But I believe it could be that the new software version consumed too much power of the PI( which is already has a problem with power). and make the RASPI stop working properly. I need to know if there are any explanation for this. I just want to make sure that this is solved for good since along 3 week print ruined is bad for my health... Thanks for all information I can get!!