G Code error crashes connection


#1

What is the problem?

When running a fairly simple motion program, I encounter an error after the first motion. I've attempted to run the program by sending commands hitting the api/printer/command endpoint and by running G code from the file.

Jogging the machine works correctly.

What did you already try to solve it?

Inspected G Code to be valid. The following will trigger it when sent to the command end point:

{
	"commands": [
		"G00 X140 Y0 F6000",
		"Z10",
		"Z100",
		"X-140",
		"Z0",
		"Z100",
		"X140"
		]
}

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

On a He 3D K280 - Mega Delta 3D Printer Kit (runs Repetier firmware).
OctoPrint version : 1.3.6
OctoPi version : 0.14.0

2018-03-14 10:44:34,546 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2018-03-14 10:44:34,589 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2018-03-14 10:44:34,749 - octoprint.util.comm - INFO - Printer reports firmware name "Repetier_0.92.9"
2018-03-14 10:44:34,750 - octoprint.util.comm - INFO - Detected Repetier firmware, enabling relevant features for issue free communication
2018-03-14 10:45:09,795 - octoprint.util.comm - INFO - Got a resend request from the printer: requested line = 10, current line = 11
| Last lines in terminal:
| Send: N5 G91*20
| Recv: ok 5
| Send: N6 G28 X0 Y0 Z0*94
| Recv: ok 6
| Send: N7 G90*23
| Recv: SelectExtruder:0
| Recv: FlowMultiply:100
| Recv: X:0.00 Y:0.00 Z:608.000 E:0.0000
| Recv: ok 7
| Recv: wait
| Recv: wait
| Send: N8 G01 X140 Y0 F6000*116
| Recv: ok 8
| Send: N9 G4 P50*81
| Recv: ok 9
| Send: Z0
| Send: N10 G4 P200*94
| Recv: Error:Format error
| Recv:
| Recv: Resend:10
2018-03-14 10:45:10,006 - octoprint.util.comm - INFO - Ignoring resend request for line 11 == current line, we haven't sent that yet so the printer got N-1 twice from us, probably due to a timeout
2018-03-14 10:45:10,011 - octoprint.util.comm - INFO - Ignoring resend request for line 11 == current line, we haven't sent that yet so the printer got N-1 twice from us, probably due to a timeout
2018-03-14 10:45:10,015 - octoprint.util.comm - WARNING - Received an error from the printer's firmware: Missing linenumber

I'm likely overlooking something simple, but in addition, I'd like a better error message to be returned than "missing line number"...

Thanks! (So far, loved the project, it's really great)


#2

You haven't provided your terminal output here, which definitely would help, but your gcode commands there aren't gcode. Z10 isn't a command. Neither are all the others apart from your first G00 line. OctoPrint by default won't send commands that aren't gcode with line numbers (since some firmwares like smoothieware support in band shell commands that must not be sent with the usual number and checksum) and this is what it does here as well, making your printer (not OctoPrint) complain about a missing line number.

What are you trying to do with this set of commands? It's certainly not doing what you expect it to do.


#3

A friend is currently using the machine so I'm unable to post the terminal (flooded with waits at the moment).

Thank you for the clarification, so I was under the impression that this worked similar to a CNC machine, where G codes are modal (command once, and next command will inherit it), but it appears I will need to specify motion code and feed rates for all lines when hitting this endpoint. The example in the API Docs show commands as M codes, so I inferred that commands meant G code.

I'm still learning how to use this software but essentially what I am trying to do is move the axes, and soon will try to do a "pick and place" of metal parts, using an eletro-magnet connected to the head, and operated by M code.

I will try this when I have access to the printer again in a little bit, thank you for your help!


#4

Feedrate is modal. But that's about it. This may look like gcode as you know it from CNC but that's fairly misleading sadly (and causes a lot of these kinds of problems for people coming over from the CNC world).

When it comes to 3d printing, best forget everything you learnt about gcode while working with CNCs, otherwise you'll just make your life a lot harder than it has to be :wink: