Connect restarts the 3D printer

What is the problem?

A short while ago, trying to connect to the printer "restarts" it. By that, I mean that, as soon as I hit the "Connect" button in Octopi, the screen on the 3D printer cycles as if it completely restarts. While this happens, Octopi displays " State: Connecting", then after a while, ends with " State: Offline". The power cycle takes a few seconds, but that is enough for Octopi to think it is offline.
Full power cycle video here:

What did you already try to solve it?

I attempted of course to simply reboot the PI; change the USB plug it was connected to, change the USB cable, power cycle the 3D printer, upgrade Octopi, change various settings that could be remotely related to usb connection (especially "Intervals & timeouts" and "Firmware & protocol"), tried forcing the serial or AUTO; I'm fresh out of ideas!

Complete Logs

Serial.log
...
2020-09-17 03:08:29,083 - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:08:29,283 - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:08:29,365 - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:08:29,439 - Connected to: Serial<id=0xa8d027d0, open=True>(port='/dev/ttyUSB0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=20.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2020-09-17 03:08:29,530 - Send: N0 M11035
2020-09-17 03:09:09,559 - No answer from the printer within the connection timeout, trying another hello
2020-09-17 03:09:09,611 - Send: N0 M110
35
2020-09-17 03:09:29,612 - There was a timeout while trying to connect to the printer
2020-09-17 03:09:29,653 - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:09:29,749 - Connection closed, closing down monitor

octoprint.log (partial as it complains my post is too big and contains too many links...)
...
2020-09-17 02:22:04,622 - octoprint.environment - INFO - Detected environment is Python 2.7.13 under Linux (linux2). Details:
| hardware:
| cores: 1
| freq: 700.0
| ram: 388038656
| os:
| id: linux
| platform: linux2
| plugins:
| pi_support:
| model: Raspberry Pi Model B Rev 2
| octopi_version: 0.15.1
| python:
| pip: 9.0.3
| version: 2.7.13
| virtualenv: /home/pi/oprint
2020-09-17 02:22:20,623 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 02:22:20,814 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 02:22:21,026 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 02:22:21,134 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi' for _http._tcp
2020-09-17 02:22:21,492 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi' for _octoprint._tcp
2020-09-17 02:22:21,597 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for SSDP
2020-09-17 02:22:21,700 - octoprint.server - INFO - Listening on http://127.0.0.1:5000
2020-09-17 02:23:20,873 - octoprint.access.users - INFO - Logged in user: mario
...
2020-09-17 02:51:17,984 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-09-17 02:53:20,558 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 1933}
2020-09-17 02:59:15,532 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 02:59:15,638 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 02:59:15,742 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 02:59:55,935 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 02:59:56,040 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2020-09-17 03:02:38,683 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:02:38,801 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:02:38,914 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:03:19,131 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:03:19,246 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2020-09-17 03:03:57,353 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:03:57,465 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:03:57,583 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:04:37,832 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:04:37,932 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2020-09-17 03:05:26,053 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:05:26,167 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:05:26,275 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:05:26,374 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2020-09-17 03:05:47,638 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:05:47,742 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2020-09-17 03:05:54,512 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:05:54,617 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:05:54,731 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:05:54,884 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2020-09-17 03:06:07,133 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:06:07,236 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2020-09-17 03:06:17,995 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-09-17 03:08:20,979 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 2833}
2020-09-17 03:08:29,093 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2020-09-17 03:08:29,252 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 57600
2020-09-17 03:08:29,376 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial connection" to "Connecting"
2020-09-17 03:08:29,492 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2020-09-17 03:09:09,588 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2020-09-17 03:09:29,679 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline"
2020-09-17 03:09:29,802 - octoprint.plugins.action_command_notification - INFO - Notifications cleared

Additional information about your setup

Octoprint Version 1.4.2
Octopi 0.15.1
Running on: Raspberry Pi Model B Rev 2
3D Printer: Anet A8 Compatible
Firmware: OMNI_V1.4 M-505
Google Chrome Version 85.0.4183.102 (Official Build) (64-bit)
Windows 10 64-bits

Why do you use 57600 as baudrate?
Iirc that's the baudrate my Anet A8 needs for flashing a new firmware in the bootloader.

Try 115200 or 250000 :slight_smile:

Hello,
I tried all baudrates individually, and also tried leaving it at AUTO; none will work anymore :frowning:
My log just happens to be taken after my last try at a lower baud rate in a deseperate attempt to connect back.
Thanks

Hello foosel,

That would be logical, the only thing though is that this used to work just fine. In fact, I even attempted to "downgrade" octoprint to see if it would not be some new feature introduced during one of the upgrades, but to no avail. This behavior is recent (a few months back... I just started caring a bit more about it lately as my son has a project in school and he would benefit from having access to the 3D printer as I thought him via octoprint.)
I'm beginning to think that the communication circuit on the printer might be damaged now somehow; if I do not get a solid lead from this thread a to another possible culprit, I think I won't have a choice but to start thinkering with the hardware itself, something I wish I could avoid but really, I might not have any other choice at this point if this could be the case.
I know the USB ports on the Octopi work just fine as I can connect my keyboard and webcam to them without issue...
Thanks!

Ah, I understood you were confused by the printer reboot, not by the lack of connection.

Could very well be the printer controller - if you roll back OctoPrint and it still doesn't work you effectively rule out recent OctoPrint changes as the culprit (though I'd be hard pressed to see how OctoPrint could even make your printer not respond to an M110 which appears to be the issue here). To make sure it isn't something weird going on with the Pi's serial drivers you could flash a fresh OctoPi image to a second SD card, boot from that and test.

What I can tell you from your log excerpt is your printer doesn't want to talk to OctoPrint, at least not at this baudrate. 115200 and 250000 are the two most common ones, if it doesn't respond at neither of those or any of the others my money is on something's wonky with the board.

Hello foosel,
I'll try flashing a brand new Octopi first yes, in case I messed things up to the point it won't connect anymore. I'll see from that point forward what my options are,
thanks for the suggestion

Finally solved it. I attempted flashing the latest octopi to another sd card but ended up with the same issue still.
I went into the printer's eeprom settings and noticed the baud rate was set to a very bizarre and very long number. Cycling through the available option, this number was never showing up back. I ended up setting the baudrate to 250000 and saved back to eeprom. When I attempted to connect via Octoprint, the eeprom did a power cycle again, but Octoprint was able to connect anyway this time, so I was able to sedn and print a test file.
All good now! :slight_smile: Thanks for all the suggestions.

1 Like