Octoprint Suddenly Won't Connect to Printer

What is the problem?
Over the last 1-2 weeks it started taking a lot longer for Octoprint to connect to my printer. But, as of a few days ago, it won't connect at all. The only thing I have done over the last few weeks is update Octoprint to 1.3.9rc2, then back down to 1.3.8, and update Octolapse to v0.3.1.

The Serial Port is /dev/ttyACM0 when I have my printer plugged in via USB to my raspberry pi and it will automatically detect the baud rate at 115200. I believe these were the settings I used in the past when it would connect.

The IP for my raspberry pi has changed twice over the last few weeks (due to power outages in my house causing my internet to restart) but I've connected to my printer every time a new IP was generated for my pi. I'm guessing this isn't causing the issue.

Also, the firmware on my printer has NOT been updated since I got the printer. I've been using Octoprint successfully since approximately March 2018.

What did you already try to solve it?

  • Rebooted printer and raspberry pi many times
  • Cleared browser history
  • ctrl + f5
  • Increase timeout limits in "Serial Connections -> Intervals & Timeouts"
  • Searched on google for countless hours
  • Tried with both 1.3.9rc2 and 1.3.8 Octoprint versions
  • Removed Octolapse
  • Tried accessing Octoprint and connecting on another computer (thought I'd at least try)

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

  • Octoprint - 1.3.8
  • OctoPi 0.14.0
  • Octolapse v0.3.1
  • Attached octoprint.log
    octoprint.log (298.9 KB)
  • serial.log output...
    2018-07-16 04:05:10,302 - Connecting to: /dev/ttyACM0
    2018-07-16 04:05:10,317 - Changing monitoring state from "Offline" to "Opening serial port"
    2018-07-16 04:05:10,319 - Connected to: Serial<id=0x7432a110, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
    2018-07-16 04:05:10,320 - Changing monitoring state from "Opening serial port" to "Connecting"
    2018-07-16 04:05:40,353 - There was a timeout while trying to connect to the printer
    2018-07-16 04:05:40,364 - Changing monitoring state from "Connecting" to "Offline"
    2018-07-16 04:05:40,370 - Connection closed, closing down monitor
    -Terminal Tab Output...
    Connecting to: /dev/ttyACM0
    Changing monitoring state from "Offline" to "Opening serial port"
    Connected to: Serial<id=0x6b02a570, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
    Changing monitoring state from "Opening serial port" to "Connecting"
    There was a timeout while trying to connect to the printer
    Changing monitoring state from "Connecting" to "Offline"
    Connection closed, closing down monitor

Thanks!

Regarding IP addresses:

If it were me, I'd setup a permanent IP address lease in my router's DHCP server section of its configuration. That way, the IP address of your printer is always the same.


If you've added any other USB-based things to your printer, try disconnecting them. It's possible that they're fighting over the same device name, UART or there's low power to the Raspberry Pi.

Verify that you've got a 2.5A 5V power adapter at least for this.

Verify that your printer's serial cable is shielded (metallic shielding inside) or minimally, there are one or more ferrite cores. It's possible that both your micro USB power cable and the printer's serial cable are both trying to provide 5V to the Raspberry Pi.

What printer is this? What firmware?

@OutsourcedGuru, that's a good idea to setup a permanent IP address! I'm not the most "techy" guy so I would have never thought of doing that.

The only items plugged into my Raspberry Pi is my printer, and a USB powered 40mm fan that I use on my printer. I had a webcam plugged into it at one point but haven't for awhile (and Octoprint worked during and after it was unplugged).

The one USB cord I use to connect my printer to the Raspberry Pi has worked for months but I did try a different one last night with no success. I'll verify the power adapter tonight.

@foosel, I use a Monoprice Select Mini (Version 2) and the firmware is V35.110.2

I wonder if I should wipe my micro SD card I'm using for my Raspberry Pi and try reinstalling everything...not sure if that would work.

I haven't worked on this since I last posted because I have been replacing my hotend but I found a weird fix...instead of manually selecting the baud rate of 115200, I select "AUTO" and then it connects...using 115200. Weird but it works.

Edit: Forgot to mention I upgraded to version 1.3.9 (stable) and installed this plugin...

1 Like

Weird but working: I had exactly the same behaviour at my Prusa MK3S. Ity stopped the connection process, right before the SD card content was listed in the log... I also tried taking out the SD card, but then it complained twice the SD card was not detected and timed out attempting to connect.

I had set the connections timeout from 30s to 120s.

Setting the speed to AUTO, worked: how strange...

I have the feeling it is somehow associated to the SD card. I had put a subdir on the SD card with big (60Mbyte) Gcode files on it, after that connecting became problematic: it would succeed "sometimes" after 20 attempts or so. Will try removing those big files from the SD. I allready "repaired" the SD card, but there were no errors on it.....

Luckily the AUTO in stead of 115200 Baud trick also works for me.

OK did further tests: removed the "big" GCODE files, but it STILL does not connect.

With baudrate at AUTO: connection always succeeds.
With baudrate set to 115200: connection fails most of the time (>95%)

This is the serial LOG with baudrate at 115200:

Connecting to: /dev/ttyACM0
Changing monitoring state from "Offline" to "Opening serial port"
Connected to: Serial<id=0x72097690, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=120.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Changing monitoring state from "Opening serial port" to "Connecting"
Send: N0 M110 N0*125
Recv: echo: 3.7.2-2363
Recv: echo: Last Updated: Jul 20 2019 17:39:05 | Author: (none, default config)
Recv: Compiled: Jul 20 2019
Recv: echo: Free Memory: 2060 PlannerBufferBytes: 1392
Recv: echo:Stored settings retrieved
Recv: adc_init
Recv: CrashDetect ENABLED!
Recv: FSensor DISABLED
Recv:
Recv: echo:SD card ok
Recv: MMU not responding - DISABLED

AND AFTER THIS NOTHING.... IT WAITS FOR 2 MINUTES AND TIMES OUT...
There was a timeout while trying to connect to the printer
Changing monitoring state from "Connecting" to "Offline"
Connection closed, closing down monitor

This is the log when the baudrate is set to AUTO, this WORKS:
Connecting to: /dev/ttyACM0
Changing monitoring state from "Offline" to "Opening serial port"
Connected to: Serial<id=0x677c2890, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=120.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Starting baud rate detection...
Changing monitoring state from "Opening serial port" to "Detecting baudrate"
Trying baudrate: 115200
Send: N0 M110 N0125
Recv: echo: 3.7.2-2363
Recv: echo: Last Updated: Jul 20 2019 17:39:05 | Author: (none, default config)
Recv: Compiled: Jul 20 2019
Recv: echo: Free Memory: 2060 PlannerBufferBytes: 1392
Recv: echo:Stored settings retrieved
Recv: adc_init
Recv: CrashDetect ENABLED!
Recv: FSensor DISABLED
Recv:
Baudrate test retry #1
Send: N0 M110 N0
125
Recv: echo:SD card ok
Recv: ok
Changing monitoring state from "Detecting baudrate" to "Operational"
Send: N0 M110 N0125
Recv: ok
Send: N1 M115
39
Recv: FIRMWARE_NAME:Prusa-Firmware 3.7.2 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Ruuds i3 MK3S BMG 16 EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000
Recv: ok
Send: M20
Recv: Begin file list
Recv: /PRUSA/MK3_PR~1.GCO 409041
Recv: /PRUSA/MK3_PL~1.GCO 9671238
Recv: /PRUSA/MK3_PL~2.GCO 3795654
Recv: /PRUSA/MK3_PL~3.GCO 20523671
Recv: /PRUSA/MK3_PL~4.GCO 3901890
Recv: /PRUSA/MK9FA9~1.GCO 860828
Recv: /PRUSA/MK7032~1.GCO 19055414
Recv: /PRUSA/MK1D17~1.GCO 6019740
Recv: /PRUSA/MK310C~1.GCO 1300833
Recv: /PRUSA/MK3713~1.GCO 240908
Recv: /STEUN/AFSTAN~1.GCO 8384082
Recv: /STEUN/AFSTAN~2.GCO 7080492
Recv: /BONDTECH/ESTEPM~1.GCO 38
Recv: /BONDTECH/ESTEPM~4.GCO 38
Recv: /BONDTECH/0.9/ESTEPM~1.GCO 39
Recv: /BONDTECH/0.9/ESTEPM~2.GCO 38
Recv: /PLA/LACKTA~1.GCO 6265976
Recv: /PLA/FILAME~1.GCO 6050688
Recv: /PLA/FILAME~2.GCO 11769333
Recv: /PETG/BONDTE~2.GCO 2320660
Recv: /PETG/BONDTE~1.GCO 1281104
Recv: /PETG/TOPPLA~1.GCO 2613510
Recv: /PETG/LAMPRI~1.GCO 10101510
Recv: /PETG/LAMPST~1.GCO 71294779
Recv: End file list
Recv: ok

I hope this info makes sense to you, as to explain the different behavior for starting with different baudrate settings. The behaviour and failing/succeeding is consistent.

Grüerzi @Ruedli !

So why not running the printer without the SD card and printing from OctoPrint?

1 Like

As a troubleshooting step you might try inserting a blank SD card into the printer instead of the one you have. If this works, then it could have something to do with the directory contents. I have never trusted this whole FAT-based, short filename 8.3 nonsense on 3D printers' controller boards.

1 Like

I had the same issue with my Octoprint on a Raspberry PI 3B+ connecting to my Hictop D3 Hero printer.
Tried all the stuff above, then thought about starting Octoprint in Safe Mode. After that I connected instantly. I will have to now find the offending Plug in and uninstall it.

Look for the ones which hook into the gcode stream.

I tried disabling the two most recent plugins 'Virtual Printer' and 'Spaghetti Detective" and when restarted, I connected okay. I then enabled those two plugins and restated and was able to connect with no problem. Random Cosmic Ray effect?

Perhaps the author of the Spaghetti Detective (@Kenneth_Jiang) might have some clue.

I can't think of any reason why TSD plugin would cause OctoPrint not to connect. But you can enable TSD debug logging and send me the log file in case this happens again. Detailed instructions are at https://www.thespaghettidetective.com/docs/turn-on-debug-logging/

Where can I change baud rate?

Where I can change baud rate? Please help

@MiroslavP, You have hijacked a 3 year old topic to ask a generic question with no foundation. Open a new "Get Help" topic and fill out the template so we have the background information we need to try and help you.

no wories, i found it by my own. sorry for interupting