OctoPrint disconnect from printer after pressing LCD's X button

What is the problem?

When I press the X button on a RepRap discount LCD, OctoPrint disconnects from the 3D printer.

What did you already try to solve it?

I'm not quite sure if it's realted to OctoPrint or to Marlin. On Marlin 1.1.9, it didn't happen to me.
Since upgradging to Marlin 2.0 (with BIGTREETECH SKR 2) this issue started to occur.

Have you tried running in safe mode?

Yes.

Did running in safe mode solve the problem?

No.

Systeminfo Bundle

octoprint-systeminfo-20220305172839.zip (717.3 KB)

Additional information about your setup

OctoPrint 1.7.3
OctoPi 0.18.0
Python 3.7.3
Any 3D printer with BIGTREETECH SKR 2
Marlin 2.0 version 2.0.9.3 (stable)

The button usually is set as a KILL button in the firmware.
It does a software reset of the printer MCU, that includes the USB connection.

BTW: Please avoid power-cycle the RasPi. Sooner or later you will have a corrupted filesystem on the Pi's SD card.

2 Likes

I see. Is there any way to change the behaviour of the KILL button, to only reset the printer? On Marlin 1.1.9 it was like that.

About the power-cycle, thanks for putting my attention.

You may have to dig into Marlin then.

It also depends on the board. If the reset-lines are hardwired, it can be difficult.

1 Like

On Marlin, under Configuration_adv.h, "SOFT_RESET_VIA_SERIAL" and "EMERGENCY_PARSER" needs to be enabled.

However, it seems like OctoPrint still disconnects from the motherboard (BIGTREETECH SKR 2).

I had another look on your logs.

There is this issue:

2022-03-05 16:16:10,866 - octoprint.util.comm - ERROR - Unexpected error while reading from serial port
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 3940, in _readline
    ret = self._serial.readline()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 6605, in readline
    c = self.read(1)
  File "/home/pi/oprint/lib/python3.7/site-packages/serial/serialposix.py", line 596, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2022-03-05 16:16:10,881 - octoprint.util.comm - ERROR - Please see https://faq.octoprint.org/serialerror for possible reasons of this.
2022-03-05 16:16:10,892 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Offline after error"

You may check your USB connection too:

I assume that this message is because the KILL button shuts off the MCU of the SKR2 and causing a disconnection so this error is presented.

However, I thought about a workaround but not sure if it's possible - is there any GCODE command that can make a connection back to OctoPrint? I was thinking about adding it to the auto0.g file on the SD card, so every-time the printer reboot it will initiate a connection. Is that possible?

This Kill feature is an Emergency-Stop.

If you use it, usually something is going wrong. So disconnecting essential.

No, there isn't a GCODE command to establish a serial/USB connection.
Also, the connection can only be established by the host. In this case OctoPrint.

Well, when I used a MKS Base as the motherboard, pressing the KILL button didn't shut down the whole system and OctoPrint stayed connected.

My workaround is to use the PortLister plugin, it will auto-connect to the SKR 2 after killing the printer.

Anyways, thanks for your help, I appreciate it!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.