Context: I built myself a button box, tactile buttons, d1 mini, mqtt. Then there's a daemon subscribed to that topic, adding the actual button actions. Lot's of fun with it, OctoPrint is so open for that.
Lighting and job controls were easy, now bed level measurement.
I really like the GCODE I have for that in the bed visualizer plugin so I copied that lines and send them to the api as commands
Works like a charm, really feels like the printer+octoPrint+the remote and programing are a robot. I click a button and the printer turns on, Octoprint connects to it, my program gets all the info about printer state and job state, sends the list of GCODEs , everything get's executed, fine. But!
What is the problem?
After all is successfully done OctoPrint's UI gives me an ugly box with red text top right regarding timeouts and considering the printer dead and advising me to configure long running scripts.
I'm a bit surprised, it's the very same sequence of GCode whether I run it through the blv's 'update mesh now' or from the GCODE sent by my script to octoPrint. M155 S90 and all. G29 takes ages to complete, true. Do I have to configure OctoPrint for it, and where?
Looking at the serial.log it's like green checks all the way down, one or two yellow TBD and then a fat red cross at the last line.
WRITE HERE
What did you already try to solve it?
Scratch my head, mostly. Searched the site and got recommendations to tape the 5V etc., not the problem I have. I know how to avoid the effect but I wonder why it happens.
Have you tried running in safe mode?
no, doesn't apply
Did running in safe mode solve the problem?
no
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
WRITE HERE
octoprint-systeminfo-20210901223339.zip (52.1 KB)
Additional information about your setup
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
WRITE HERE
The piece of code that starts the measurement is:
def doStartLeveling(param):
print("doStartLeveling called")
dJson = {
"commands": [
"M117 Prepare the bed level measuring",
"M140 S60" ,
"M117 Homing all axes",
"G28",
"M117 Heating the bed ",
"M190 S60",
# "M155 S90",
"M117 Start the dance",
"@BEDLEVELVISUALIZER",
"G29 T",
"M500",
"M140 S0",
"M117 fertig!"
]
}
payload = json.dumps(dJson)
command = 'curl -s -X POST -H "Content-Type: application/json" -H "X-Api-Key":"ABCDEFGHIJKLMNO" -d \'{}\' http://kiwi.intern/api/printer/command'.format(payload)
print(command)
stream = os.popen(command)
response=stream.read()
print(response)
When I set a comment in front of "M155 S90",
the error does not happen.
But why does that line (and the significantly less temperature reportings) irritate octoPrint when it passed that via the api while it stays relaxed when the call came from the plugin?