Monoprice Mini V2 doesn't connect before homing

What is the problem?

I turn on my printer, try to connect with Octoprint, and it times out.

What did you already try to solve it?

I open a serial connection to the printer with screen /dev/ttyACM0 9600 and home it with G28.
After it homes and responds, I close the serial connection and connect successfully with Octoprint. This is an easy workaround, except now I have to ssh into my server rather than simply using the beautiful Octoprint gui.

I looked in GCODE Scripts for a place where I can change the connection routine, but the "After serial connection" seems to happen after the connection is confirmed, rather than merely after the serial port is opened.

I also tried the Malayan/Monoprice fix plugin. This changes the behavior but doesn't seem to fix anything, and since I don't really know what it does, I removed it again.

Have you tried running in safe mode?

No

Did running in safe mode solve the problem?

N/A

Systeminfo Bundle

octoprint-systeminfo-20240412222925.zip (9.8 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

I'm looking for a way to send the G28 command when the serial port is opened, but before communication is "established".

This isn't something you can do with the settings in OctoPrint. It would probably be a plugin job.

That said, OctoPrint will normally send an M110 command as a "hello", and after that is responded correctly the connection is confirmed. This command has no side effects so it's considered "safe" to send when we don't know what's on the other side.

You could configure this command in the settings to be G28. Obviously the downside is you will home the printer every time it connects, which has potential to cause damage if you're not prepared for it.

One other possible solution is to write a script to do the serial command as if you were in the terminal (can't really help with specifics here) and then make use of OctoPrint's system commands, so you press the button to execute the command and then connect. Making it more explicit.

1 Like

Have you tried this?

Thanks for the tips.
I’ll take a look at the plugins tutorial and see if I can make something to change the hello command.
I will also try manually sending M110 from a serial terminal to see if there’s something else going on, such as CTS or RTS signals.

Well, it's not the G-code command.
I can send the exact same N0 M110 N0*125 to the printer from screen and it responds fine.
And yet, pressing "connecting" twice from Octoprint doesn't work.

I wrote a small python script to try to isolate the issue, using similar settings to Octoprint. I'm using the home command because it gives me some external feedback that communication is happening. What's strange is that the printer always homes, but doesn't always reply.

import serial

port = '/dev/ttyACM0'
baud = 9600

with serial.Serial(str(port), baud, timeout=10, writeTimeout=1,
            parity=serial.PARITY_NONE) as serial_obj2:
    serial_obj2.write(b"G28 Y\n")
    print(serial_obj2.read(20))