When OctoPrint disconnects mid-print, read the last lines in its Terminal tab before restarting. Repeated resend requests point to the USB serial link, timeouts mean replies stopped, and a fatal firmware error points to the printer. On a Raspberry Pi, run vcgencmd get_throttled to check for undervoltage.
Change one thing at a time, because an intermittent failure gives no way to tell which of several changes fixed it.
Symptom-to-cause table
| What you see | Likely layer | Go to |
|---|---|---|
Communication timeout while printing in the Terminal | Printer busy or slow to reply | Busy and timeout errors |
No response from printer after consecutive timeouts | Printer or link stopped answering | Busy and timeout errors, then Undervoltage |
| Repeated resend requests or an unreliable communication warning | Possible trouble on the serial link | USB signal integrity |
Error: followed by a halt, or a fatal message such as kill() called or fatal: | Firmware halt | When the printer halted itself |
vcgencmd get_throttled returns a value with bit 0 or bit 16 set | Pi undervoltage | Undervoltage |
| Printer missing from the port list after a reboot | Device path | The device path changed |
| Problems began after installing or updating a plugin | Plugin | Plugins: bisect with safe mode |
| Browser tab dropped while the print continued | Browser connection | Wi-Fi and the print |
The timeout messages and firmware error handling come from the OctoPrint 2.0.1 Serial Connector communication code.
First: read the terminal, not the popup
OctoPrint’s Terminal tab shows the serial conversation, and the last lines before a disconnect say more than the notification.
Use the last Terminal messages to choose a check. OctoPrint 2.0.1 communication code
- Repeated resend requests. The firmware asked for a line again. By default, the settings schema allows 10 resends of the same line before the job is considered failed.
echo:busy:orbusy:before the gap. The firmware reports that it is busy. OctoPrint resets its wait for an acknowledgment when it receives either prefix.Communication timeout while printing. OctoPrint sendsM105to prompt a reply when it logs this message. If the same command keeps timing out, check the long-running command settings.Error: ...from the firmware, then a halt. The printer decided to stop. Read the message before anything else.
Save the logs before restarting. See Logs and the serial log.
Undervoltage: check power first
On Raspberry Pi OS, vcgencmd get_throttled returns a bit pattern. The Raspberry Pi documentation lists what each set bit means:
| Bit | Hex value | Meaning |
|---|---|---|
| 0 | 0x1 | Undervoltage detected |
| 1 | 0x2 | Arm frequency capped |
| 2 | 0x4 | Currently throttled |
| 3 | 0x8 | Soft temperature limit active |
| 16 | 0x10000 | Undervoltage has occurred |
| 17 | 0x20000 | Arm frequency capping has occurred |
| 18 | 0x40000 | Throttling has occurred |
| 19 | 0x80000 | Soft temperature limit has occurred |
Run it after a failed print:
vcgencmd get_throttled
After an overnight failure, check bit 16 for earlier undervoltage. Bit 0 reports undervoltage at the time of the check. Use the other rows to identify frequency capping, throttling or a soft temperature limit.
If an undervoltage bit is set, the power supply is the place to start. The hardware and first boot guide covers choosing a supply and host board.
Logs and the serial log
By default OctoPrint stores its logs in the logs folder in OctoPrint’s base folder, per the config.yaml docs. The logging.yaml docs name the two files that matter here: octoprint.log and serial.log.
In OctoPrint 2.0.1, serial logging is off by default. Enable it through the Serial Connector settings. Settings schema Plugin registration Settings dialog
- Open Settings, then Serial Connection.
- On the General tab, under Serial logging, tick Log communication to
serial.log. - Save, then reproduce the failure.
Serial logging can slow communication. While it is active, the navigation bar shows a file icon labeled “serial.log is enabled”. Navbar template
Turn serial logging off after saving the capture.
OctoPrint logs resends to octoprint.log by default. Settings schema
The Logging plugin adds a settings dialog for log levels. Managing log files through it requires admin rights. Logging plugin documentation
Busy and timeout errors
In OctoPrint 2.0.1, timeout settings sit under Settings > Serial Connection > Intervals & timeouts (plugin source, settings dialog source). The defaults below come from the 2.0.1 settings schema:
| Setting | Default | What it covers |
|---|---|---|
| Communication timeout | 30 s | Configured timeout while OctoPrint uses standard serial communication |
| Communication timeout (busy detected) | 3 s | Configured timeout once OctoPrint activates busy protocol support |
| Connection timeout | 10 s | Wait to establish a connection with the selected port |
| Max consecutive timeouts, printing | 5 | Timeouts allowed while printing before an error |
| Max consecutive timeouts, idle | 2 | Timeouts allowed while idle |
| Max consecutive timeouts, long-running command | 5 | Timeouts allowed during a known long command |
OctoPrint adds one second to the temperature update interval, then uses the larger of that value and the configured communication timeout. Communication code
OctoPrint closes the connection after the consecutive timeout count exceeds the applicable limit. A timeout while printing can prompt an M105 reply check. Heating, long-running commands and active resends are handled separately. Communication code
For timeouts tied to specific commands, check the advanced options on the Firmware & protocol tab. Settings dialog Settings schema
- Support
busyprotocol, if detected is enabled by default. - Long running commands defaults to
G4,G28,G29,G30,G32,M400,M226andM600. Add a G-code command your printer executes without replying for a long time.
If timeouts cluster around one command, add it to that list before raising the general timeout.
USB signal integrity
Repeated resends are a reason to check the serial link. With default settings, OctoPrint 2.0.1 warns about unreliable communication when resend requests reach 10% of transmitted lines after more than 100 lines have been sent. Communication code Settings schema
With the printer idle, check that both USB plugs are seated and try a known-good USB cable. Compare the next print’s logs for repeat resends. Klipper USB troubleshooting
The device path changed
If the serial port vanishes or changes number after a reboot, list the stable USB serial names on the Linux host. Klipper serial-port FAQ
ls /dev/serial/by-id/*
OctoPrint scans for numbered devices such as ttyUSB and ttyACM. To offer the stable names as well, open Settings > Serial Connection > General and add /dev/serial/by-id/* on its own line in Additional serial ports. Plugin registration Settings dialog Communication code Klipper serial-port FAQ
Save the settings, then select your printer’s entry in Serial Port. Check which entry belongs to your printer before connecting if several are listed. Connection options Klipper serial-port FAQ
Baud rate and the connection handshake
If the connection fails immediately, check the selected port and baud rate. The connection options include AUTO under Baudrate. Connection options
In OctoPrint 2.0, the connection dialog lets you choose the connector and save the connection parameters. 2.0.0 release notes
By default OctoPrint sends M110 N0 as its “Hello” command to trigger the handshake, and the Firmware & protocol tab lets you change it (settings schema, settings dialog source).
Host contention: camera and timelapse load
OctoPrint and camera software run on the same host. The webcam guide shows how to change the stream resolution and frame rate on either OctoPi camera stack.
Wi-Fi and the print
In OctoPrint 2.0 the printer link is handled by the bundled Serial Connector, which connects “to printers through a serial connection” (2.0.0 release notes). The browser reaches OctoPrint over the network, a separate link. If the print carries on and only the browser tab drops, the problem is the network path. The OctoPrint remote access guide covers VPN, proxy and relay checks for that case.
Plugins: bisect with safe mode
Plugins hook into printer communication. The plugin hook docs warn that slow handlers in hooks such as octoprint.comm.protocol.gcode.received “block the receive loop, causing the communication with the printer to stall”. Suspect a plugin when disconnects started after an install or an update.
Safe mode disables third-party plugins and language packs. The command-line options are below. OctoPrint safe mode documentation
# Stop OctoPrint first, then:
octoprint serve --safe
# Or set the one-time flag, then restart OctoPrint:
octoprint safemode
The third way is Restart OctoPrint in safe mode in the System menu, which needs the restart command configured. The web interface shows a notification while safe mode is active. The OctoPrint 2.0 release candidate notes also point to /recovery/ for restarting in safe mode. Release notes
Reproduce the same workload in safe mode. If the problem goes away, return to normal mode and vary one plugin at a time. Compare the logs after each change.
Use the plugin guide when investigating plugins that cause serial instability: it identifies serial polling, video processing and overlapping functions to check before adding more extensions.
When the printer halted itself
If a firmware error appears before the disconnect, read that error before retrying the print. OctoPrint 2.0.1 attempts to send M112 before a firmware-error disconnect only if Send M112 on disconnect due to error is enabled. The handler skips the attempt if its SD-printing check returns true. It checks after switching to the error state, which falls outside the states that count as printing. Marlin’s M112 turns off the steppers and heaters and requires a reset. Settings dialog Settings schema Communication code Marlin M112 reference
Under Serial Connection > Behaviour > Error handling, the choices are to disconnect, cancel the print, or ignore the error. With Cancel, OctoPrint stays connected for ordinary firmware errors and disconnects for fatal firmware errors. Ignore can mask even fatal errors. Plugin registration Settings dialog
Stop and investigate faults involving heaters or thermistors. Keep thermal protection enabled while diagnosing the fault. Marlin thermal protection
Limit the consequences of a disconnect
Decide how the firmware behaves when commands stop, and inspect that behaviour while the machine is supervised. Do not rely on the host being able to send a final command after a fault.
The default afterPrintCancelled script turns off the motors, heaters and fan, but it is sent to the printer, so it needs a working connection. The beforePrinterDisconnected script “will not be sent for unexpected connection cut offs, e.g. in case of errors on the serial line” (GCODE Scripts docs). Once USB communication is lost, a shutdown command cannot reach the printer, so firmware protection and the printer’s physical controls remain necessary.
For printers that support local storage, consider starting the job from the printer itself while using OctoPrint for monitoring. This removes reliance on a continuous host G-code stream. Verify the printer’s behaviour and which monitoring or cancellation features remain available in that mode.
If the underlying goal is motion tuning, the OctoPrint vs Klipper comparison explains the different host roles.
Evidence and limits
The steps were checked on 2026-11-21 against the OctoPrint 2.0.1 source code, the OctoPrint documentation, and the Raspberry Pi, Klipper and Marlin documentation. The steps were not run on a printer.