# 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` 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).