Custom gcode not working from gcode but from terminal

What is the problem?

For some reason my custom gcode instructions that are inside the gcode file are not executed when printing, but are executed when I type them into the terminal in OctoPrint.
No heating up, no speaker beeps, etc. It's just skipped and the terminal writes "unknown command: xyz" and resumes with the normal printing moves.
Again, I can always execute them successfully from the terminal while the print is running or in idle.

This makes a temperature tower or other more involved printing projects impossible.

What did you already try to solve it?

Tried looking at the file the slicer outputs, the code is there, it's not a parsing issue.
Tried uploading and then downloading the file from the octoprint file list, it's not a corruption issue, the files are correct.

Tried writing a simple gcode file for example:
1 beeps at very start
2 waits for heating up to 100Β°
3 beeps
4 wait for cooldown to 50Β°
5 beeps
4 moves a short distance
5 beeps and done

m300 s500 p500
m109 R100
m300 s500 p500
m109 R50
m300 s500 p500
G1 X50 Y50 F1000
m300 s1000 p500

The entire command line is skipped except for the move command.
If I add an extrude move to it, the printer responds with a "prevented cold extrusion" warning, obviously it knows that it is not at extrusion temperature, since it skipped the command, why?
Why does it skip and "not know" any command except the movements when they are coming from the gcode file?
Why are they working at the same time when I input them into the terminal?
Makes no immediate sense to me.

A normal generated slicer gcode output works perfectly, but since I want to add temperature changes that will not suffice.

It will only set the temperature at the start and ignore when I manually add the m109 lines into the slicer file. That's insane to me.

I'd appreciate any input.
Thanks.

Have you tried running in safe mode?

Yes.

Did running in safe mode solve the problem?

No change.

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
octoprint-systeminfo-20250627033928.zip (7.7 KB)

Additional information about your setup

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

Im using Prusaslicer and Fusion 360, sometimes Cura for the mold feature.

share the gcode file.

Hi,

It's in my post.
that's literally all the gcode I used to test this issue.

Have you tried with capital letters?

2 Likes

Oh my god.

Yes, this seems to cause the problem with OctoPrint.
I never would have thought gcode has to be ALL uppercase since the printer accepts any form of inputs from me in the terminal.

Seems it internally translates the terminal commands to be uppercase, but not from a gcode file?
Maybe that is an oversight in the file funtion of OctoPrint?

The printer now does what I tell it to.
Thanks a lot!

2 Likes