|
|
@@ -2049,8 +2049,10 @@ class BambuMQTTClient:
|
|
|
slot_id = tray_id % 4
|
|
|
ams_mapping2.append({"ams_id": ams_id, "slot_id": slot_id})
|
|
|
|
|
|
- # H2D series requires integer values (0/1) for boolean fields
|
|
|
- # Other printers (X1C, P1S, A1, etc.) require actual booleans
|
|
|
+ # H2D series requires integer values (0/1) for calibration/leveling fields
|
|
|
+ # but use_ams MUST remain boolean — H2D Pro firmware interprets integer
|
|
|
+ # values as nozzle index (1 = deputy nozzle), causing wrong extruder routing
|
|
|
+ # Other printers (X1C, P1S, A1, etc.) require actual booleans for all fields
|
|
|
is_h2d = self.model and self.model.upper().strip() in ("H2D", "H2D PRO", "H2DPRO", "H2C", "H2S")
|
|
|
|
|
|
command = {
|
|
|
@@ -2068,7 +2070,7 @@ class BambuMQTTClient:
|
|
|
"flow_cali": (1 if flow_cali else 0) if is_h2d else flow_cali,
|
|
|
"vibration_cali": (1 if vibration_cali else 0) if is_h2d else vibration_cali,
|
|
|
"layer_inspect": (1 if layer_inspect else 0) if is_h2d else layer_inspect,
|
|
|
- "use_ams": (1 if use_ams else 0) if is_h2d else use_ams,
|
|
|
+ "use_ams": use_ams,
|
|
|
"cfg": "0",
|
|
|
"extrude_cali_flag": 0,
|
|
|
"extrude_cali_manual_mode": 0,
|
|
|
@@ -2082,7 +2084,10 @@ class BambuMQTTClient:
|
|
|
}
|
|
|
|
|
|
if is_h2d:
|
|
|
- logger.info("[%s] H2D series detected: using integer format for boolean fields", self.serial_number)
|
|
|
+ logger.info(
|
|
|
+ "[%s] H2D series detected: using integer format for calibration fields (use_ams stays boolean)",
|
|
|
+ self.serial_number,
|
|
|
+ )
|
|
|
|
|
|
# P2S-specific parameter adjustments
|
|
|
# P2S printer doesn't support vibration calibration like X1/P1 series
|