Reproduction files (6)
# Repro for issue #17352 — chamber temp M191 emitted although printer "support_chamber_temp_control" is off
Reproduced on main (commit f939e2b1e, OrcaSlicer 2.6.0-dev) using the CLI only — no GUI needed,
because the bug is in gcode emission, not in the GUI.
## Setup
- `repro/cube.stl` — plain 25x25x10 mm cube.
- `repro/machine.json` — machine preset json, `support_chamber_temp_control = 0`,
with `machine_start_gcode` starting with `;MACHINE_START_MARKER` so we can see where the
M191 lands relative to the user's machine start gcode. (`repro/machine_on.json` is the same
with `support_chamber_temp_control = 1`.) Extra keys `use_relative_e_distances=0` and
`layer_gcode=G92 E0` are only there to make validation pass with a bare-bones machine config.
- `repro/filament.json` — filament preset json with `activate_chamber_temp_control = 1`,
`chamber_temperature = 50` (the state described in the issue: printer capability later
switched off, leaving this checkbox hidden but still enabled). `repro/filament_off.json` is
the same with `activate_chamber_temp_control = 0`.
- `repro/run.sh` — runs all three cases.
## Steps
$ORCA_BIN --load-settings repro/machine.json --load-filaments repro/filament.json \
--slice 0 --outputdir repro/out repro/cube.stl
grep -n "M191\|M141" repro/out/plate_1.gcode
Note: the json presets must contain `"from": "user"`, otherwise the CLI exits with -5
("from unsupported").
## Result (bug)
`repro/out/plate_1.gcode` (printer capability OFF, filament flag ON):
line 25: M191 S50 ;set chamber_temperature and wait for it to be reached <- right before machine_start_gcode
line 26: ;MACHINE_START_MARKER
line 8112: M141 S0;set chamber_temperature <- after machine_end_gcode
and the config echo in the same file proves the capability flag was off during the slice:
; activate_chamber_temp_control = 1
; chamber_temperature = 50
; support_chamber_temp_control = 0
This matches the issue's excerpt exactly (M106 P2 wrappers appear only when `auxiliary_fan` is set; not needed for the M191 itself).
## Controls
- `support_chamber_temp_control=1` + filament on -> M191 emitted (correct, `repro/out_on/`).
- `support_chamber_temp_control=0` + filament off -> no M191 (correct, `repro/out_off/`).
So the hidden/stale filament flag alone still drives M191/M141 output, exactly as reported.
## Cause (code)
- `src/libslic3r/GCode.cpp:4022-4027`: `activate_chamber_temp_control` / `max_chamber_temp`
are computed only from the per-extruder filament settings `m_config.activate_chamber_temp_control`
/ `m_config.chamber_temperature`.
- `src/libslic3r/GCode.cpp:4413-4416` writes `set_chamber_temperature(max, wait=true)` -> `M191 S<n>`
before machine_start_gcode, and `GCode.cpp:4915-4916` writes `M141 S0` at the end, both gated only
on that filament-derived flag.
- `GCodeWriter::set_chamber_temperature` (`src/libslic3r/GCodeWriter.cpp:400-422`) emits the M191 text.
- The printer capability `support_chamber_temp_control` is referenced nowhere in libslic3r gcode
generation; it is only used by the GUI to show/hide the filament checkbox
(`src/slic3r/GUI/Tab.cpp:5325 toggle_line(...)`; also `src/slic3r/GUI/ConfigManipulation.cpp:247`).
## Expected fix direction
Gate the two `if (activate_chamber_temp_control && max_chamber_temp > 0)` sites on
`m_config.support_chamber_temp_control` as well (wiki documents M191 requires BOTH checkboxes).
#!/bin/bash
# Reproduction for OrcaSlicer issue #17352: M191 chamber-temp control is emitted
# even though the printer option support_chamber_temp_control is disabled (the
# filament checkbox activate_chamber_temp_control is then hidden in the GUI but
# its stored value still drives the gcode).
#
# Run from the worktree root. Requires $ORCA_BIN.
set -x
cd "$(dirname "$0")/.."
# Case A (BUG): printer support_chamber_temp_control=0, filament activate_chamber_temp_control=1, chamber_temperature=50
# Expected: no M191 anywhere. Actual: "M191 S50" before machine_start_gcode, "M141 S0" at the end.
$ORCA_BIN --debug 1 --load-settings repro/machine.json --load-filaments repro/filament.json \
--slice 0 --outputdir repro/out repro/cube.stl
grep -n "M191\|MACHINE_START_MARKER\|support_chamber_temp_control =\|activate_chamber_temp_control =" repro/out/plate_1.gcode
# Case B (control, capability on): support_chamber_temp_control=1 + filament on -> M191 present (correct)
$ORCA_BIN --debug 1 --load-settings repro/machine_on.json --load-filaments repro/filament.json \
--slice 0 --outputdir repro/out_on repro/cube.stl
grep -c "M191" repro/out_on/plate_1.gcode
# Case C (control, filament off): support_chamber_temp_control=0 + filament off -> no M191 (correct)
$ORCA_BIN --debug 1 --load-settings repro/machine.json --load-filaments repro/filament_off.json \
--slice 0 --outputdir repro/out_off repro/cube.stl
grep -c "M191" repro/out_off/plate_1.gcode
M201 X1000 Y1000 Z500 E5000
M203 X500 Y500 Z12 E120
M204 P1500 R1500 T1500
M205 X10.00 Y10.00 Z0.20 E2.50 ; sets the jerk limits, mm/sec
M190 S35 ; set bed temperature and wait for it to be reached
M104 S200 ; set nozzle temperature
;TYPE:Custom
M191 S50 ;set chamber_temperature and wait for it to be reached
;MACHINE_START_MARKER
G28
G90
G21
...
;MACHINE_END_MARKER
M84
M141 S0;set chamber_temperature
M73 P100 R0
...
; activate_chamber_temp_control = 1
; chamber_temperature = 50
; support_chamber_temp_control = 0
{
"type": "machine",
"from": "user",
"name": "chamber test machine",
"instantiation": "true",
"support_chamber_temp_control": "0",
"support_air_filtration": "0",
"support_pause_printer": "0",
"machine_start_gcode": ";MACHINE_START_MARKER\nG28\n",
"machine_end_gcode": ";MACHINE_END_MARKER\nM84\n",
"relative_extrusion": "0",
"layer_gcode": "G92 E0\n",
"use_relative_e_distances": "0"
}
{
"type": "filament",
"from": "user",
"name": "chamber test",
"instantiation": "true",
"filament_type": ["PLA"],
"filament_diameter": ["1.75"],
"temperature": ["210"],
"temperature_vitrification": ["60"],
"hot_plate_temp": ["55"],
"hot_plate_temp_initial_layer": ["60"],
"filament_max_volumetric_speed": ["12"],
"activate_chamber_temp_control": ["1"],
"chamber_temperature": ["50"]
}
solid cube
facet normal 0.000000 0.000000 -625.000000
outer loop
vertex 0.000000 0.000000 0.000000
vertex 25.000000 25.000000 0.000000
vertex 25.000000 0.000000 0.000000
endloop
endfacet
facet normal 0.000000 0.000000 -625.000000
outer loop
vertex 0.000000 0.000000 0.000000
vertex 0.000000 25.000000 0.000000
vertex 25.000000 25.000000 0.000000
endloop
endfacet
facet normal 0.000000 0.000000 625.000000
outer loop
vertex 0.000000 0.000000 10.000000
vertex 25.000000 0.000000 10.000000
vertex 25.000000 25.000000 10.000000
endloop
endfacet
facet normal 0.000000 0.000000 625.000000
outer loop
vertex 0.000000 0.000000 10.000000
vertex 25.000000 25.000000 10.000000
vertex 0.000000 25.000000 10.000000
endloop
endfacet
facet normal 0.000000 -250.000000 0.000000
outer loop
vertex 0.000000 0.000000 0.000000
vertex 25.000000 0.000000 0.000000
vertex 25.000000 0.000000 10.000000
endloop
endfacet
facet normal 0.000000 -250.000000 0.000000
outer loop
vertex 0.000000 0.000000 0.000000
vertex 25.000000 0.000000 10.000000
vertex 0.000000 0.000000 10.000000
endloop
endfacet
facet normal 250.000000 0.000000 0.000000
outer loop
vertex 25.000000 0.000000 0.000000
vertex 25.000000 25.000000 0.000000
vertex 25.000000 25.000000 10.000000
endloop
endfacet
facet normal 250.000000 0.000000 0.000000
outer loop
vertex 25.000000 0.000000 0.000000
vertex 25.000000 25.000000 10.000000
vertex 25.000000 0.000000 10.000000
endloop
endfacet
facet normal 0.000000 250.000000 0.000000
outer loop
vertex 25.000000 25.000000 0.000000
vertex 0.000000 25.000000 0.000000
vertex 0.000000 25.000000 10.000000
endloop
endfacet
facet normal 0.000000 250.000000 0.000000
outer loop
vertex 25.000000 25.000000 0.000000
vertex 0.000000 25.000000 10.000000
vertex 25.000000 25.000000 10.000000
endloop
endfacet
facet normal -250.000000 0.000000 0.000000
outer loop
vertex 0.000000 25.000000 0.000000
vertex 0.000000 0.000000 0.000000
vertex 0.000000 0.000000 10.000000
endloop
endfacet
facet normal -250.000000 0.000000 0.000000
outer loop
vertex 0.000000 25.000000 0.000000
vertex 0.000000 0.000000 10.000000
vertex 0.000000 25.000000 10.000000
endloop
endfacet
endsolid cube