Skip to content

Expose chamber heater and remaining fans to web UIs on Kobra S1 / S1 Max - #95

Open
SirDragonClaw wants to merge 1 commit into
rinkhals-community:developfrom
SirDragonClaw:feature/ks1-expose-chamber-temp-and-fans
Open

Expose chamber heater and remaining fans to web UIs on Kobra S1 / S1 Max#95
SirDragonClaw wants to merge 1 commit into
rinkhals-community:developfrom
SirDragonClaw:feature/ks1-expose-chamber-temp-and-fans

Conversation

@SirDragonClaw

Copy link
Copy Markdown

Summary

On the Kobra S1 / S1 Max, the chamber heater is invisible to Mainsail and Fluidd even though
GoKlipper serves it happily. This adds it, plus the S1 Max's chamber, exhaust and mainboard fans, to
the synthesised objects list.

Background

Because GoKlipper's objects/list is unusable, patch_objects_list() in kobra.py synthesises the
list that Moonraker reports to web clients. Clients subscribe only to what that list contains, so any
object missing from it is unreachable from the UI regardless of whether GoKlipper can serve it.

For KS1 / KS1M the list only appended fan_generic air_filter_fan and fan_generic box_fan.

The significant omission is chamber_temp. In the stock printer.cfg it is a PID-controlled
heater:

[chamber_temp]
heater_pin: PB8
sensor_iio_path: /sys/bus/iio/devices/iio:device0/in_voltage1_raw
sensor_type: NTC 100K beta 3950
min_temp: -30
max_temp: 65
control: pid

and GoKlipper already reports it as a heater:

"heaters": {
  "available_heaters": ["heater_bed", "chamber_temp", "extruder"],
  "available_sensors": ["heater_bed", "chamber_temp", "extruder"]
}

M141 / M191 also already work from the console. So the hardware, the firmware and the macros were
all in place. Only the objects list entry was missing, which meant S1 Max owners had no chamber
temperature readout or setpoint anywhere in the web UI
.

Changes

Added for KS1 / KS1M:

Object Notes
chamber_temp Chamber heater: reading, setpoint and duty

Added for KS1M only:

Object Pin Notes
fan_generic chamber_fan PB6 Chamber circulation fan
fan_generic exhaust_fan PB4 External exhaust fan
controller_fan controller_fan PB3 Mainboard fan

Verification

Tested on a Kobra S1 Max (KOBRA_MODEL_CODE=KS1M, KOBRA_MODEL_ID=20029, Anycubic firmware
2.7.1.4, Rinkhals 20260716_02).

Before: 134 objects listed, no chamber anything. After: 138 objects.

All four return live data via objects/query, and also via a Fluidd-style
printer.objects.subscribe, which is what actually matters for the UI:

chamber_temp                       {"power": 0, "target": 0, "temperature": 26}
fan_generic chamber_fan            {"name": "chamber_fan", "speed": 0}
fan_generic exhaust_fan            {"name": "exhaust_fan", "speed": 0}
controller_fan controller_fan      {"rpm": 0, "speed": 0}

chamber_temp also streams live notify_status_update frames, so it graphs correctly rather than
sitting static:

update: {"chamber_temp": {"temperature": 25}}
update: {"chamber_temp": {"temperature": 26}}

gklib was not restarted; only Moonraker. No regression seen in existing panels.

Scoping note for reviewers

chamber_temp is added for KS1 as well as KS1M on the basis that the S1 shares the
heated-chamber design, but it was only tested on an S1 Max, so a second pair of eyes from a KS1
owner would be welcome. The three extra fans are deliberately gated to KS1M because only that
model's printer.cfg was inspected.

Objects that do not exist return {} from GoKlipper rather than erroring, so a wrong model gate here
degrades to a cosmetic empty entry rather than a failure.

GoKlipper's objects/list is unusable, so patch_objects_list() synthesises the
list that Moonraker reports to Mainsail/Fluidd. For KS1/KS1M it only appended
air_filter_fan and box_fan, so several objects that GoKlipper happily serves
were invisible to both web UIs.

Most notably the chamber heater. [chamber_temp] is a PID-controlled heater in
the stock printer.cfg (max_temp 65, sensor via sensor_iio_path) and GoKlipper
already reports it in heaters.available_heaters, but because it was missing
from this list no client ever subscribed to it. S1 Max owners therefore had no
chamber temperature readout or setpoint in the web UI at all, despite the
hardware supporting a heated chamber and M141/M191 already working from the
console.

Adds for KS1/KS1M:
  chamber_temp

Adds for KS1M only:
  fan_generic chamber_fan          (chamber circulation fan, PB6)
  fan_generic exhaust_fan          (external exhaust fan, PB4)
  controller_fan controller_fan    (mainboard fan, PB3)

Verified on a Kobra S1 Max, firmware 2.7.x, Rinkhals 20260716_02. All four
objects return live data over both objects/query and a Fluidd-style
printer.objects.subscribe, and chamber_temp streams notify_status_update
temperature frames. chamber_temp is added for KS1 as well since the S1 shares
the heated-chamber design; the three extra fans are gated to KS1M because only
that model's printer.cfg was inspected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant