Timeout error when trying to connect to printer

What is the problem?

Just recently I've been having problems connecting to my printer. It tries to connect but then goes offline with a timeout error.

What did you already try to solve it?

Tried changing the serial port and baudrate, but with no success. Restarted OctoPrint in safe mode but was still not able to connect. Checked the serial.log and octoprint.log files and did see an uncaught exception in the octoprint.log file (see below). Not sure what it means or how to fix it.

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

OctoPrint version: 1.3.8
OctoPi version: 0.15.0PE
Printer: Prusa i3 MK3
Printer Firmware: 3.1.2-231
Pi: Raspberry Pi Zero W
Camera: Raspberry Pi Camera Module v2

serial.log (safe mode):

2018-05-28 00:31:55,930 - Connecting to: /dev/ttyAMA0
2018-05-28 00:31:55,958 - Changing monitoring state from "Offline" to "Opening serial port"
2018-05-28 00:31:55,994 - Connected to: Serial<id=0xad35c870, open=True>(port='/dev/ttyAMA0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2018-05-28 00:31:55,996 - Changing monitoring state from "Opening serial port" to "Connecting"
2018-05-28 00:31:56,026 - Send: N0 M110 N0*125
2018-05-28 00:32:26,074 - There was a timeout while trying to connect to the printer
2018-05-28 00:32:26,119 - Changing monitoring state from "Connecting" to "Offline"
2018-05-28 00:32:26,151 - Connection closed, closing down monitor

octoprint.log (safe mode):

2018-05-28 00:29:26,975 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets...
2018-05-28 00:29:27,067 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache...
2018-05-28 00:29:28,180 - octoprint.server - INFO - Shutting down intermediary server...
2018-05-28 00:29:28,411 - octoprint.server - INFO - Intermediary server shut down
2018-05-28 00:29:28,418 - octoprint.events - INFO - Processing startup event, this is our first event
2018-05-28 00:29:28,422 - octoprint.events - INFO - Adding 1 events to queue that were held back before startup event
2018-05-28 00:29:28,438 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2018-05-28 00:29:28,505 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2018-05-28 00:29:28,517 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2018-05-28 00:29:30,403 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial port"
2018-05-28 00:29:30,476 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial port" to "Connecting"
2018-05-28 00:29:30,545 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2018-05-28 00:29:30,622 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance "PrusaPrint 😉" for _http._tcp
2018-05-28 00:29:30,747 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance "PrusaPrint 😉" for _octoprint._tcp
2018-05-28 00:29:30,804 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance "PrusaPrint 😉" for SSDP
2018-05-28 00:29:30,809 - octoprint.server - INFO - Listening on http://127.0.0.1:5000
2018-05-28 00:29:30,830 - octoprint.server - INFO - Server started successfully in safe mode as requested from config, removing flag
2018-05-28 00:29:32,725 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2018-05-28 00:29:33,988 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2018-05-28 00:29:34,539 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=en', 'path': '/', 'base_url': 'http://octopi-prusa-mk3/'}
2018-05-28 00:29:38,936 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2018-05-28 00:29:47,443 - tornado.application - ERROR - Uncaught exception in /sockjs/026/edckw2uz/websocket
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/websocket.py", line 369, in _run_callback
callback(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/sockjs/tornado/transports/websocket.py", line 32, in open
self.stream.socket.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
AttributeError: 'NoneType' object has no attribute 'setsockopt'
2018-05-28 00:29:47,778 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.1.164
2018-05-28 00:30:00,660 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2018-05-28 00:30:53,012 - octoprint.server.preemptive_cache - INFO - ... done in 78.47s
2018-05-28 00:31:01,340 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.1.164
2018-05-28 00:31:02,646 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.1.164
2018-05-28 00:31:55,965 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial port"
2018-05-28 00:31:55,998 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial port" to "Connecting"
2018-05-28 00:31:56,021 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2018-05-28 00:32:26,122 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"

Any help you can provide would be appreciated. Thanks!

That looks like you are trying to connect to it using your Pi 0W's header/the Einsy header. As far as I remember that requires you to also tell you MK3 to even allow that via the Settings on the controller. Have you done that?

PS: The Pi0W is not recommended for running OctoPrint, has some serious performance issues when the WiFi is utilized. If you don't plan on attaching a camera you should mostly be fine, but if you also want a webcam, consider upgrading to a Pi3.

Ahh...of course! I forgot I turned off the RPI setting. How embarrassing. :disappointed_relieved: Thank you Gina!

And thank you for the suggestion regarding the use of the Pi0W with OctoPrint. I have experienced performance issues so I will be looking to upgrade to a Pi3.

Thanks again!