@hiv3d/bambu-types
Version:
TypeScript types and utilities for Bambu Lab 3D printers including error codes, commands, and API types
1,253 lines (1,244 loc) • 1.29 MB
JavaScript
'use strict';
var zod = require('zod');
var deepmerge = require('deepmerge');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var deepmerge__default = /*#__PURE__*/_interopDefault(deepmerge);
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// src/bambu.ts
var PrinterModelNamesShort = /* @__PURE__ */ ((PrinterModelNamesShort2) => {
PrinterModelNamesShort2["X1C"] = "X1C";
PrinterModelNamesShort2["X1"] = "X1";
PrinterModelNamesShort2["X1E"] = "X1E";
PrinterModelNamesShort2["P1P"] = "P1P";
PrinterModelNamesShort2["P1S"] = "P1S";
PrinterModelNamesShort2["A1"] = "A1";
PrinterModelNamesShort2["A1M"] = "A1M";
PrinterModelNamesShort2["H2D"] = "H2D";
PrinterModelNamesShort2["H2S"] = "H2S";
return PrinterModelNamesShort2;
})(PrinterModelNamesShort || {});
var PrinterModelIDs = /* @__PURE__ */ ((PrinterModelIDs2) => {
PrinterModelIDs2["X1C"] = "BL-P001";
PrinterModelIDs2["X1"] = "BL-P002";
PrinterModelIDs2["P1P"] = "C11";
PrinterModelIDs2["P1S"] = "C12";
PrinterModelIDs2["X1E"] = "C13";
PrinterModelIDs2["A1"] = "N2S";
PrinterModelIDs2["A1M"] = "N1";
PrinterModelIDs2["H2D"] = "O1D";
PrinterModelIDs2["H2S"] = "O1S";
return PrinterModelIDs2;
})(PrinterModelIDs || {});
var PRINTER_MODEL_MAP = {
// Official model IDs from machine profiles
["BL-P001" /* X1C */]: "X1C",
// X1 Carbon
["BL-P002" /* X1 */]: "X1",
// X1
["C11" /* P1P */]: "P1P",
// P1P
["C12" /* P1S */]: "P1S",
// P1S
["C13" /* X1E */]: "X1E",
// X1E
["N2S" /* A1 */]: "A1",
// A1
["N1" /* A1M */]: "A1M",
// A1 Mini
["O1D" /* H2D */]: "H2D",
// H2D
["O1S" /* H2S */]: "H2S"
// H2S
};
var PRINTER_MODEL_LONG_NAME_MAP = {
// Full names (for project_settings.config)
["BL-P001" /* X1C */]: "Bambu Lab X1C",
["BL-P002" /* X1 */]: "Bambu Lab X1",
["C12" /* P1S */]: "Bambu Lab P1S",
["C11" /* P1P */]: "Bambu Lab P1P",
["N2S" /* A1 */]: "Bambu Lab A1",
["N1" /* A1M */]: "Bambu Lab A1 Mini",
["C13" /* X1E */]: "Bambu Lab X1C",
["O1D" /* H2D */]: "Bambu Lab H2D",
// H2D
["O1S" /* H2S */]: "Bambu Lab H2S"
// H2S
};
var CONNECT_RETURN_CODE_DESC = {
0: "Connection successful",
1: "Connection refused - incorrect protocol version",
2: "Connection refused - invalid client identifier",
3: "Connection refused - server unavailable",
4: "Connection refused - bad username or password",
5: "Connection refused - not authorised"
};
var AMS_LETTER_MAP = {
"0": "A",
"1": "B",
"2": "C",
"3": "D"
};
// src/printerResponse.ts
var AMSControlAction = /* @__PURE__ */ ((AMSControlAction2) => {
AMSControlAction2["RESUME"] = "resume";
AMSControlAction2["RESET"] = "reset";
AMSControlAction2["PAUSE"] = "pause";
AMSControlAction2["DONE"] = "done";
return AMSControlAction2;
})(AMSControlAction || {});
function isPrintMessage(data) {
return !!data?.print && !!data?.print?.command && ["push_status", "resume", "gcode_line", "gcode_file", "project_file", "ams_filament_setting"].includes(
data.print.command
);
}
var PrintStage = /* @__PURE__ */ ((PrintStage2) => {
PrintStage2["PRINTING"] = "Printing";
PrintStage2["BED_LEVELING"] = "Auto bed leveling";
PrintStage2["HEATBED_PREHEATING"] = "Heatbed preheating";
PrintStage2["XY_MECH_MODE_SWEEP"] = "Sweeping XY mech mode";
PrintStage2["CHANGE_MATERIAL"] = "Changing filament";
PrintStage2["M400_PAUSE"] = "M400 pause";
PrintStage2["FILAMENT_RUNOUT_PAUSE"] = "Paused due to filament runout";
PrintStage2["HOTEND_HEATING"] = "Heating hotend";
PrintStage2["EXTRUDE_COMPENSATION_SCAN"] = "Calibrating extrusion";
PrintStage2["BED_SCAN"] = "Scanning bed surface";
PrintStage2["FIRST_LAYER_SCAN"] = "Inspecting first layer";
PrintStage2["BE_SURFACE_TYPT_IDENTIFICATION"] = "Identifying build plate type";
PrintStage2["SCANNER_EXTRINSIC_PARA_CALI"] = "Calibrating Micro Lidar";
PrintStage2["TOOLHEAD_HOMING"] = "Homing toolhead";
PrintStage2["NOZZLE_TIP_CLEANING"] = "Cleaning nozzle tip";
PrintStage2["EXTRUDER_TEMP_PROTECT_CALI"] = "Checking extruder temperature";
PrintStage2["USER_PAUSE"] = "Printing was paused by the user";
PrintStage2["TOOLHEAD_SHELL_OFF_PAUSE"] = "Pause of front cover falling";
PrintStage2["SCANNER_LASER_PARA_CALI"] = "Calibrating the micro lida";
PrintStage2["EXTRUDER_ABSOLUTE_FLOW_CALI"] = "Calibrating extrusion flow";
PrintStage2["HOTEND_TEMPERATURE_ERROR_PAUSE"] = "Paused due to nozzle temperature malfunction";
PrintStage2["HEATED_BED_TEMPERATURE_ERROR_PAUSE"] = "Paused due to heat bed temperature malfunction";
PrintStage2["FILAMENT_UNLOADING"] = "Filament unloading";
PrintStage2["SKIP_STEP_PAUSE"] = "Skip step pause";
PrintStage2["FILAMENT_LOADING"] = "Filament loading";
PrintStage2["MOTOR_NOISE_CALIBRATION"] = "Motor noise calibration";
PrintStage2["AMS_LOST_PAUSE"] = "Paused due to AMS lost";
PrintStage2["HEAT_BREAK_FAN_PAUSE"] = "Paused due to low speed of the heat break fan";
PrintStage2["CHAMBER_TEMPERATURE_CONTROL_ERROR_PAUSE"] = "Paused due to chamber temperature control error";
PrintStage2["CHAMBER_COOLING"] = "Cooling chamber";
PrintStage2["USER_INSERT_GCODE_PAUSE"] = "Paused by the Gcode inserted by user";
PrintStage2["MOTOR_NOISE_SHOWOFF"] = "Motor noise showoff";
PrintStage2["NOZZLE_FILAMENT_COVERED_DETECTED_PAUSE"] = "Nozzle filament covered detected pause";
PrintStage2["CUTTER_ERROR_PAUSE"] = "Cutter error pause";
PrintStage2["FIRST_LAYER_ERROR_PAUSE"] = "First layer error pause";
PrintStage2["NOZZLE_CLOG_PAUSE"] = "Nozzle clog pause";
return PrintStage2;
})(PrintStage || {});
var stageCurrToStage = {
0: "Printing" /* PRINTING */,
1: "Auto bed leveling" /* BED_LEVELING */,
2: "Heatbed preheating" /* HEATBED_PREHEATING */,
3: "Sweeping XY mech mode" /* XY_MECH_MODE_SWEEP */,
4: "Changing filament" /* CHANGE_MATERIAL */,
5: "M400 pause" /* M400_PAUSE */,
6: "Paused due to filament runout" /* FILAMENT_RUNOUT_PAUSE */,
7: "Heating hotend" /* HOTEND_HEATING */,
8: "Calibrating extrusion" /* EXTRUDE_COMPENSATION_SCAN */,
9: "Scanning bed surface" /* BED_SCAN */,
10: "Inspecting first layer" /* FIRST_LAYER_SCAN */,
11: "Identifying build plate type" /* BE_SURFACE_TYPT_IDENTIFICATION */,
12: "Calibrating Micro Lidar" /* SCANNER_EXTRINSIC_PARA_CALI */,
13: "Homing toolhead" /* TOOLHEAD_HOMING */,
14: "Cleaning nozzle tip" /* NOZZLE_TIP_CLEANING */,
15: "Checking extruder temperature" /* EXTRUDER_TEMP_PROTECT_CALI */,
16: "Printing was paused by the user" /* USER_PAUSE */,
17: "Pause of front cover falling" /* TOOLHEAD_SHELL_OFF_PAUSE */,
18: "Calibrating the micro lida" /* SCANNER_LASER_PARA_CALI */,
19: "Calibrating extrusion flow" /* EXTRUDER_ABSOLUTE_FLOW_CALI */,
20: "Paused due to nozzle temperature malfunction" /* HOTEND_TEMPERATURE_ERROR_PAUSE */,
21: "Paused due to heat bed temperature malfunction" /* HEATED_BED_TEMPERATURE_ERROR_PAUSE */,
22: "Filament unloading" /* FILAMENT_UNLOADING */,
23: "Skip step pause" /* SKIP_STEP_PAUSE */,
24: "Filament loading" /* FILAMENT_LOADING */,
25: "Motor noise calibration" /* MOTOR_NOISE_CALIBRATION */,
26: "Paused due to AMS lost" /* AMS_LOST_PAUSE */,
27: "Paused due to low speed of the heat break fan" /* HEAT_BREAK_FAN_PAUSE */,
28: "Paused due to chamber temperature control error" /* CHAMBER_TEMPERATURE_CONTROL_ERROR_PAUSE */,
29: "Cooling chamber" /* CHAMBER_COOLING */,
30: "Paused by the Gcode inserted by user" /* USER_INSERT_GCODE_PAUSE */,
31: "Motor noise showoff" /* MOTOR_NOISE_SHOWOFF */,
32: "Nozzle filament covered detected pause" /* NOZZLE_FILAMENT_COVERED_DETECTED_PAUSE */,
33: "Cutter error pause" /* CUTTER_ERROR_PAUSE */,
34: "First layer error pause" /* FIRST_LAYER_ERROR_PAUSE */,
35: "Nozzle clog pause" /* NOZZLE_CLOG_PAUSE */
};
var PrintStageDetails = {
["Printing" /* PRINTING */]: {
controllable: true,
critical: true,
description: "Actively printing the model"
},
["Auto bed leveling" /* BED_LEVELING */]: {
controllable: false,
critical: true,
description: "Performing automatic bed leveling calibration"
},
["Heatbed preheating" /* HEATBED_PREHEATING */]: {
controllable: false,
critical: true,
description: "Preheating the build plate to required temperature"
},
["Sweeping XY mech mode" /* XY_MECH_MODE_SWEEP */]: {
controllable: false,
critical: true,
description: "Calibrating XY mechanical movement"
},
["Changing filament" /* CHANGE_MATERIAL */]: {
controllable: true,
critical: false,
description: "Changing filament material"
},
["M400 pause" /* M400_PAUSE */]: {
controllable: false,
critical: false,
description: "Temporary pause for machine commands"
},
["Paused due to filament runout" /* FILAMENT_RUNOUT_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to filament running out"
},
["Heating hotend" /* HOTEND_HEATING */]: {
controllable: false,
critical: true,
description: "Heating nozzle to required temperature"
},
["Calibrating extrusion" /* EXTRUDE_COMPENSATION_SCAN */]: {
controllable: false,
critical: true,
description: "Calibrating extrusion compensation"
},
["Scanning bed surface" /* BED_SCAN */]: {
controllable: false,
critical: true,
description: "Scanning bed surface topology"
},
["Inspecting first layer" /* FIRST_LAYER_SCAN */]: {
controllable: false,
critical: true,
description: "Inspecting first layer quality"
},
["Identifying build plate type" /* BE_SURFACE_TYPT_IDENTIFICATION */]: {
controllable: false,
critical: true,
description: "Identifying build plate surface type"
},
["Calibrating Micro Lidar" /* SCANNER_EXTRINSIC_PARA_CALI */]: {
controllable: false,
critical: true,
description: "Calibrating Micro Lidar parameters"
},
["Homing toolhead" /* TOOLHEAD_HOMING */]: {
controllable: false,
critical: true,
description: "Moving toolhead to home position"
},
["Cleaning nozzle tip" /* NOZZLE_TIP_CLEANING */]: {
controllable: false,
critical: true,
description: "Cleaning nozzle tip"
},
["Checking extruder temperature" /* EXTRUDER_TEMP_PROTECT_CALI */]: {
controllable: false,
critical: true,
description: "Verifying extruder temperature protection"
},
["Printing was paused by the user" /* USER_PAUSE */]: {
controllable: true,
critical: false,
description: "Print manually paused by user"
},
["Pause of front cover falling" /* TOOLHEAD_SHELL_OFF_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to front cover falling"
},
["Calibrating the micro lida" /* SCANNER_LASER_PARA_CALI */]: {
controllable: false,
critical: true,
description: "Calibrating micro lidar laser parameters"
},
["Calibrating extrusion flow" /* EXTRUDER_ABSOLUTE_FLOW_CALI */]: {
controllable: false,
critical: true,
description: "Calibrating absolute extrusion flow"
},
["Paused due to nozzle temperature malfunction" /* HOTEND_TEMPERATURE_ERROR_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to nozzle temperature error"
},
["Paused due to heat bed temperature malfunction" /* HEATED_BED_TEMPERATURE_ERROR_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to bed temperature error"
},
["Filament unloading" /* FILAMENT_UNLOADING */]: {
controllable: true,
critical: false,
description: "Unloading filament from extruder"
},
["Skip step pause" /* SKIP_STEP_PAUSE */]: {
controllable: true,
critical: false,
description: "Print paused for step skipping"
},
["Filament loading" /* FILAMENT_LOADING */]: {
controllable: true,
critical: false,
description: "Loading filament into extruder"
},
["Motor noise calibration" /* MOTOR_NOISE_CALIBRATION */]: {
controllable: false,
critical: false,
description: "Calibrating motor noise reduction"
},
["Paused due to AMS lost" /* AMS_LOST_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to AMS communication loss"
},
["Paused due to low speed of the heat break fan" /* HEAT_BREAK_FAN_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to heat break fan issue"
},
["Paused due to chamber temperature control error" /* CHAMBER_TEMPERATURE_CONTROL_ERROR_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to chamber temperature error"
},
["Cooling chamber" /* CHAMBER_COOLING */]: {
controllable: false,
critical: true,
description: "Cooling print chamber"
},
["Paused by the Gcode inserted by user" /* USER_INSERT_GCODE_PAUSE */]: {
controllable: true,
critical: false,
description: "Print paused by user-inserted GCode"
},
["Motor noise showoff" /* MOTOR_NOISE_SHOWOFF */]: {
controllable: false,
critical: false,
description: "Demonstrating motor noise reduction"
},
["Nozzle filament covered detected pause" /* NOZZLE_FILAMENT_COVERED_DETECTED_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to filament covering nozzle"
},
["Cutter error pause" /* CUTTER_ERROR_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to filament cutter error"
},
["First layer error pause" /* FIRST_LAYER_ERROR_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to first layer error"
},
["Nozzle clog pause" /* NOZZLE_CLOG_PAUSE */]: {
controllable: true,
critical: true,
description: "Print paused due to nozzle clog"
}
};
var SpeedLevel = /* @__PURE__ */ ((SpeedLevel2) => {
SpeedLevel2["SILENT"] = "1";
SpeedLevel2["NORMAL"] = "2";
SpeedLevel2["SPORT"] = "3";
SpeedLevel2["LUDICROUS"] = "4";
return SpeedLevel2;
})(SpeedLevel || {});
var FilamentType = /* @__PURE__ */ ((FilamentType2) => {
FilamentType2["PLA"] = "PLA";
FilamentType2["ABS"] = "ABS";
FilamentType2["TPU"] = "TPU";
FilamentType2["PC"] = "PC";
FilamentType2["ASA"] = "ASA";
FilamentType2["PA_CF"] = "PA-CF";
FilamentType2["PA6_CF"] = "PA6-CF";
FilamentType2["PET_CF"] = "PET-CF";
FilamentType2["PETG"] = "PETG";
FilamentType2["PETG_CF"] = "PETG-CF";
FilamentType2["PLA_AERO"] = "PLA-AERO";
FilamentType2["PLA_CF"] = "PLA-CF";
FilamentType2["PPA_CF"] = "PPA-CF";
FilamentType2["PPA_GF"] = "PPA-GF";
FilamentType2["PA"] = "PA";
FilamentType2["HIPS"] = "HIPS";
FilamentType2["PPS"] = "PPS";
FilamentType2["PPS_CF"] = "PPS-CF";
FilamentType2["PVA"] = "PVA";
FilamentType2["PLA_S"] = "PLA-S";
FilamentType2["PA_S"] = "PLA-S";
return FilamentType2;
})(FilamentType || {});
var AmsRFIDStatus = /* @__PURE__ */ ((AmsRFIDStatus2) => {
AmsRFIDStatus2[AmsRFIDStatus2["IDLE"] = 0] = "IDLE";
AmsRFIDStatus2[AmsRFIDStatus2["READING"] = 1] = "READING";
AmsRFIDStatus2[AmsRFIDStatus2["GCODE_TRANS"] = 2] = "GCODE_TRANS";
AmsRFIDStatus2[AmsRFIDStatus2["GCODE_RUNNING"] = 3] = "GCODE_RUNNING";
AmsRFIDStatus2[AmsRFIDStatus2["ASSISTANT"] = 4] = "ASSISTANT";
AmsRFIDStatus2[AmsRFIDStatus2["SWITCH_FILAMENT"] = 5] = "SWITCH_FILAMENT";
AmsRFIDStatus2[AmsRFIDStatus2["HAS_FILAMENT"] = 6] = "HAS_FILAMENT";
return AmsRFIDStatus2;
})(AmsRFIDStatus || {});
var UpgradeStatusProgressState = /* @__PURE__ */ ((UpgradeStatusProgressState2) => {
UpgradeStatusProgressState2["DOWNLOADING"] = "DOWNLOADING";
UpgradeStatusProgressState2["UPGRADE_REQUEST"] = "UPGRADE_REQUEST";
UpgradeStatusProgressState2["PRE_FLASH_START"] = "PRE_FLASH_START";
UpgradeStatusProgressState2["PRE_FLASH_SUCCESS"] = "PRE_FLASH_SUCCESS";
return UpgradeStatusProgressState2;
})(UpgradeStatusProgressState || {});
var UpgradeStatusFinishState = /* @__PURE__ */ ((UpgradeStatusFinishState2) => {
UpgradeStatusFinishState2["UPGRADE_SUCCESS"] = "UPGRADE_SUCCESS";
UpgradeStatusFinishState2["DOWNLOAD_FAIL"] = "DOWNLOAD_FAIL";
UpgradeStatusFinishState2["FLASH_FAIL"] = "FLASH_FAIL";
UpgradeStatusFinishState2["PRE_FLASH_FAIL"] = "PRE_FLASH_FAIL";
UpgradeStatusFinishState2["UPGRADE_FAIL"] = "UPGRADE_FAIL";
return UpgradeStatusFinishState2;
})(UpgradeStatusFinishState || {});
var UpgradeErrorCode = /* @__PURE__ */ ((UpgradeErrorCode2) => {
UpgradeErrorCode2[UpgradeErrorCode2["UpgradeNoError"] = 0] = "UpgradeNoError";
UpgradeErrorCode2[UpgradeErrorCode2["UpgradeDownloadFailed"] = 1] = "UpgradeDownloadFailed";
UpgradeErrorCode2[UpgradeErrorCode2["UpgradeVerifyFailed"] = 2] = "UpgradeVerifyFailed";
UpgradeErrorCode2[UpgradeErrorCode2["UpgradeFlashFailed"] = 3] = "UpgradeFlashFailed";
UpgradeErrorCode2[UpgradeErrorCode2["UpgradePrinting"] = 4] = "UpgradePrinting";
return UpgradeErrorCode2;
})(UpgradeErrorCode || {});
var UpgradeDisplayState = /* @__PURE__ */ ((UpgradeDisplayState2) => {
UpgradeDisplayState2[UpgradeDisplayState2["UNAVAILABLE"] = 0] = "UNAVAILABLE";
UpgradeDisplayState2[UpgradeDisplayState2["IDLE"] = 1] = "IDLE";
UpgradeDisplayState2[UpgradeDisplayState2["UPGRADING"] = 2] = "UPGRADING";
UpgradeDisplayState2[UpgradeDisplayState2["UPGRADE_FINISHED"] = 3] = "UPGRADE_FINISHED";
return UpgradeDisplayState2;
})(UpgradeDisplayState || {});
var filamentConfigs = {
PLA: {
type: "filament",
name: "PLA",
inherits: "",
from: "",
filament_id: "PLA",
instantiation: "true",
filament_cost: ["20"],
filament_vendor: ["Generic"],
nozzle_temp_min: "190",
nozzle_temp_max: "230",
bed_temp: "60",
bed_temp_type: "normal"
},
ABS: {
type: "filament",
name: "ABS",
inherits: "",
from: "",
filament_id: "ABS",
instantiation: "true",
filament_cost: ["25"],
filament_vendor: ["Generic"],
nozzle_temp_min: "220",
nozzle_temp_max: "270",
bed_temp: "90",
bed_temp_type: "high"
}
};
function getFilamentConfig(id) {
return filamentConfigs[id] ?? null;
}
function getStageFromCurr(stageCurr) {
return stageCurrToStage[stageCurr];
}
function getStagesFromArray(stages) {
return stages.map((stage) => stageCurrToStage[stage]).filter((stage) => stage !== void 0);
}
function getEnrichedStages(currentStage, stageHistory) {
const currentPrintStage = stageCurrToStage[currentStage];
const historyStages = getStagesFromArray(stageHistory);
const currentIndex = historyStages.findIndex((stage) => stage === currentPrintStage);
const enrichedStages = historyStages.map((stage, index) => {
const stageDetails = PrintStageDetails[stage];
return {
stage,
description: stageDetails?.description || "Unknown stage",
controllable: stageDetails?.controllable || false,
critical: stageDetails?.critical || false,
// A stage is completed if it's before the current stage in history
// or if the current stage isn't in history and this is not the last stage
completed: currentIndex >= 0 ? index < currentIndex : index < historyStages.length - 1,
current: stage === currentPrintStage
};
});
if (currentPrintStage && !historyStages.includes(currentPrintStage)) {
const stageDetails = PrintStageDetails[currentPrintStage];
enrichedStages.push({
stage: currentPrintStage,
description: stageDetails?.description || "Unknown stage",
controllable: stageDetails?.controllable || false,
critical: stageDetails?.critical || false,
completed: false,
current: true
});
}
return enrichedStages;
}
function isPushAllCommand(data) {
return data.command === "push_status" && Object.keys(data).length >= 40;
}
var PauseCategory = /* @__PURE__ */ ((PauseCategory2) => {
PauseCategory2["FILAMENT_RUNOUT"] = "filament_runout";
PauseCategory2["USER_PAUSE"] = "user_pause";
PauseCategory2["GCODE_PAUSE"] = "gcode_pause";
PauseCategory2["ERROR"] = "error";
PauseCategory2["DEFAULT"] = "default";
return PauseCategory2;
})(PauseCategory || {});
function stageToPauseCategory(stgCur) {
switch (stgCur) {
// Filament runout
case 6:
return "filament_runout" /* FILAMENT_RUNOUT */;
// User pause
case 16:
return "user_pause" /* USER_PAUSE */;
// G-code pauses
case 5:
// M400_PAUSE
case 30:
return "gcode_pause" /* GCODE_PAUSE */;
// Error pauses
case 20:
// HOTEND_TEMPERATURE_ERROR_PAUSE
case 21:
// HEATED_BED_TEMPERATURE_ERROR_PAUSE
case 26:
// AMS_LOST_PAUSE
case 27:
// HEAT_BREAK_FAN_PAUSE
case 28:
// CHAMBER_TEMPERATURE_CONTROL_ERROR_PAUSE
case 32:
// NOZZLE_FILAMENT_COVERED_DETECTED_PAUSE
case 33:
// CUTTER_ERROR_PAUSE
case 34:
// FIRST_LAYER_ERROR_PAUSE
case 35:
return "error" /* ERROR */;
// All other stages use default pattern
default:
return "default" /* DEFAULT */;
}
}
var lightNodeSchema = zod.z.enum(["chamber_light", "work_light"]);
var lightModeSchema = zod.z.enum(["on", "off", "flashing"]);
var lightOptionsSchema = zod.z.object({
onTime: zod.z.number().optional(),
offTime: zod.z.number().optional(),
loops: zod.z.number().optional(),
interval: zod.z.number().optional()
}).optional();
var fanTypeSchema = zod.z.enum(["1", "2", "3"]).transform((val) => parseInt(val));
var fanSpeedSchema = zod.z.number().min(0).max(100);
var speedLevelSchema = zod.z.enum(["1", "2", "3", "4"]);
var tempPartSchema = zod.z.enum(["bed", "nozzle", "chamber"]);
var temperatureSchema = zod.z.number().min(0).max(300);
var stateSchema = zod.z.enum(["pause", "resume", "stop"]);
var gcodesSchema = zod.z.array(zod.z.string());
zod.z.nativeEnum(AMSControlAction);
var filamentSettingsSchema = zod.z.object({
ams_id: zod.z.number(),
tray_id: zod.z.number(),
filament_id: zod.z.string(),
setting_id: zod.z.string(),
color: zod.z.string(),
filament_type: zod.z.string(),
nozzle_temp_min: zod.z.number(),
nozzle_temp_max: zod.z.number()
});
var loadFilamentSchema = zod.z.object({
trayId: zod.z.number(),
oldTemp: zod.z.number().optional(),
newTemp: zod.z.number().optional()
});
var unloadFilamentSchema = zod.z.object({
oldTemp: zod.z.number().optional(),
newTemp: zod.z.number().optional()
});
var axisSchema = zod.z.enum(["X", "Y", "Z", "E"]);
var axisControlSchema = zod.z.object({
axis: axisSchema,
distance: zod.z.number(),
unit: zod.z.number().optional(),
speed: zod.z.number().optional()
});
var cleanPrintErrorSchema = zod.z.object({
subtaskId: zod.z.string(),
printError: zod.z.number()
});
var powerLossRecoverySchema = zod.z.object({
action: zod.z.enum(["resume", "stop"]),
subtaskId: zod.z.string(),
printError: zod.z.number()
});
var cameraOperationSchema = zod.z.enum(["ipcam_record_set", "ipcam_timelapse", "ipcam_resolution_set"]);
var cameraSchema = zod.z.object({
operation: cameraOperationSchema,
value: zod.z.union([zod.z.boolean(), zod.z.string()])
});
var hmsCommandSchema = zod.z.object({
errorCode: zod.z.string(),
jobId: zod.z.string()
});
var amsUserSettingsSchema = zod.z.object({
amsId: zod.z.number(),
startupReadOption: zod.z.boolean(),
trayReadOption: zod.z.boolean(),
calibrateRemainFlag: zod.z.boolean()
});
var amsCalibrateSchema = zod.z.object({
amsId: zod.z.number()
});
var amsRefreshRfidSchema = zod.z.object({
trayId: zod.z.string()
});
var amsRefreshRfid2Schema = zod.z.object({
amsId: zod.z.number(),
slotId: zod.z.number()
});
var amsSelectTraySchema = zod.z.object({
trayId: zod.z.string()
});
var setNozzleTempNewSchema = zod.z.object({
extruderIndex: zod.z.number(),
targetTemp: temperatureSchema
});
var printingOptionsSchema = zod.z.object({
autoRecovery: zod.z.boolean()
});
var testLightSequenceSchema = zod.z.object({
sequence: zod.z.tuple([zod.z.boolean(), zod.z.boolean(), zod.z.boolean(), zod.z.boolean(), zod.z.boolean()]),
chamberLight: zod.z.boolean(),
workLight: zod.z.boolean(),
loops: zod.z.number().int().min(1).max(10).optional()
});
var commandSchemas = {
updateLight: zod.z.object({
light: lightNodeSchema,
mode: lightModeSchema,
loopOptions: lightOptionsSchema
}),
updateFan: zod.z.object({
fan: fanTypeSchema,
speed: fanSpeedSchema
}),
updateSpeed: zod.z.object({
speed: speedLevelSchema
}),
updateTemp: zod.z.object({
part: tempPartSchema,
temperature: temperatureSchema
}),
updateState: zod.z.object({
state: stateSchema
}),
gcode: zod.z.object({
gcodes: gcodesSchema
}),
resume: zod.z.object({
cleanPrintError: zod.z.boolean().optional(),
printError: zod.z.number().optional(),
subtaskId: zod.z.string().optional()
}),
ams_control: zod.z.object({
param: zod.z.any()
// This can be refined further based on AMSControlAction structure
}),
refreshPrinterState: zod.z.object({}),
ams_filament_settings: filamentSettingsSchema,
loadFilament: loadFilamentSchema,
unloadFilament: unloadFilamentSchema,
axisControl: axisControlSchema,
autoLevel: zod.z.object({}),
goHome: zod.z.object({}),
cleanPrintError: cleanPrintErrorSchema,
powerLossRecovery: powerLossRecoverySchema,
camera: cameraSchema,
taskAbort: zod.z.object({}),
taskCancel: zod.z.object({
jobId: zod.z.string()
}),
// High-priority HMS & system commands
hmsResume: hmsCommandSchema,
hmsIgnore: hmsCommandSchema,
hmsStop: hmsCommandSchema,
stopBuzzer: zod.z.object({}),
getAccessCode: zod.z.object({}),
// Medium-priority AMS commands
amsUserSettings: amsUserSettingsSchema,
amsCalibrate: amsCalibrateSchema,
amsRefreshRfid: amsRefreshRfidSchema,
amsRefreshRfid2: amsRefreshRfid2Schema,
amsSelectTray: amsSelectTraySchema,
amsDryingStop: zod.z.object({}),
// Medium-priority other commands
setNozzleTempNew: setNozzleTempNewSchema,
xyzAbsoluteMode: zod.z.object({}),
printingOptions: printingOptionsSchema,
// Light testing command
testLightSequence: testLightSequenceSchema
};
function validateCommandParams(command, params) {
const schema = commandSchemas[command];
const result = schema.safeParse(params);
if (result.success) {
return { success: true, data: result.data };
} else {
return { success: false, error: result.error };
}
}
// src/commands.ts
var LightEffect = /* @__PURE__ */ ((LightEffect2) => {
LightEffect2["ON"] = "on";
LightEffect2["OFF"] = "off";
LightEffect2["FLASHING"] = "flashing";
return LightEffect2;
})(LightEffect || {});
var LightNode = /* @__PURE__ */ ((LightNode2) => {
LightNode2["CHAMBER"] = "chamber_light";
LightNode2["WORK"] = "work_light";
return LightNode2;
})(LightNode || {});
var CameraOperation = /* @__PURE__ */ ((CameraOperation2) => {
CameraOperation2["RECORD"] = "ipcam_record_set";
CameraOperation2["TIMELAPSE"] = "ipcam_timelapse";
CameraOperation2["RESOLUTION"] = "ipcam_resolution_set";
return CameraOperation2;
})(CameraOperation || {});
var FanType = /* @__PURE__ */ ((FanType2) => {
FanType2[FanType2["PART_COOLING"] = 1] = "PART_COOLING";
FanType2[FanType2["AUXILIARY"] = 2] = "AUXILIARY";
FanType2[FanType2["CHAMBER"] = 3] = "CHAMBER";
return FanType2;
})(FanType || {});
var VALID_COMMANDS = [
"updateLight",
"updateFan",
"updateSpeed",
"updateTemp",
"updateState",
"gcode",
"resume",
"ams_control",
"refreshPrinterState",
"ams_filament_settings",
"loadFilament",
"unloadFilament",
"axisControl",
"autoLevel",
"goHome",
"cleanPrintError",
"powerLossRecovery",
"camera",
"taskAbort",
"taskCancel",
// High-priority HMS & system commands
"hmsResume",
"hmsIgnore",
"hmsStop",
"stopBuzzer",
"getAccessCode",
// Medium-priority AMS commands
"amsUserSettings",
"amsCalibrate",
"amsRefreshRfid",
"amsRefreshRfid2",
"amsSelectTray",
"amsDryingStop",
// Medium-priority other commands
"setNozzleTempNew",
"xyzAbsoluteMode",
"printingOptions",
// Light testing command
"testLightSequence"
];
var createCommand = (command, params) => ({
command,
params
});
var isValidCommand = (command) => VALID_COMMANDS.includes(command);
// src/hms/hms-parser.ts
var ModuleID = /* @__PURE__ */ ((ModuleID2) => {
ModuleID2[ModuleID2["MODULE_UKNOWN"] = 0] = "MODULE_UKNOWN";
ModuleID2[ModuleID2["MODULE_01"] = 1] = "MODULE_01";
ModuleID2[ModuleID2["MODULE_02"] = 2] = "MODULE_02";
ModuleID2[ModuleID2["MODULE_MC"] = 3] = "MODULE_MC";
ModuleID2[ModuleID2["MODULE_04"] = 4] = "MODULE_04";
ModuleID2[ModuleID2["MODULE_MAINBOARD"] = 5] = "MODULE_MAINBOARD";
ModuleID2[ModuleID2["MODULE_06"] = 6] = "MODULE_06";
ModuleID2[ModuleID2["MODULE_AMS"] = 7] = "MODULE_AMS";
ModuleID2[ModuleID2["MODULE_TH"] = 8] = "MODULE_TH";
ModuleID2[ModuleID2["MODULE_09"] = 9] = "MODULE_09";
ModuleID2[ModuleID2["MODULE_10"] = 10] = "MODULE_10";
ModuleID2[ModuleID2["MODULE_11"] = 11] = "MODULE_11";
ModuleID2[ModuleID2["MODULE_XCAM"] = 12] = "MODULE_XCAM";
ModuleID2[ModuleID2["MODULE_13"] = 13] = "MODULE_13";
ModuleID2[ModuleID2["MODULE_14"] = 14] = "MODULE_14";
ModuleID2[ModuleID2["MODULE_15"] = 15] = "MODULE_15";
ModuleID2[ModuleID2["MODULE_MAX"] = 16] = "MODULE_MAX";
return ModuleID2;
})(ModuleID || {});
var HMSMessageLevel = /* @__PURE__ */ ((HMSMessageLevel2) => {
HMSMessageLevel2[HMSMessageLevel2["HMS_UNKNOWN"] = 0] = "HMS_UNKNOWN";
HMSMessageLevel2[HMSMessageLevel2["HMS_FATAL"] = 1] = "HMS_FATAL";
HMSMessageLevel2[HMSMessageLevel2["HMS_SERIOUS"] = 2] = "HMS_SERIOUS";
HMSMessageLevel2[HMSMessageLevel2["HMS_COMMON"] = 3] = "HMS_COMMON";
HMSMessageLevel2[HMSMessageLevel2["HMS_INFO"] = 4] = "HMS_INFO";
HMSMessageLevel2[HMSMessageLevel2["HMS_MSG_LEVEL_MAX"] = 5] = "HMS_MSG_LEVEL_MAX";
return HMSMessageLevel2;
})(HMSMessageLevel || {});
var HMSQuery = class {
constructor() {
this.hmsInfoJsons = /* @__PURE__ */ new Map();
this.hmsActionJsons = /* @__PURE__ */ new Map();
this.hmsLocalImages = /* @__PURE__ */ new Map();
// image name -> base64 or path
this.cloudHmsLastUpdateTime = /* @__PURE__ */ new Map();
}
/**
* Load HMS error messages from JSON file
* @param deviceIdType - Device ID type (e.g., "094")
* @param langCode - Language code (e.g., "en", "zh-cn")
* @returns Promise<boolean> - True if loaded successfully
*/
async loadHmsInfo(deviceIdType, langCode = "en") {
try {
const fileName = `hms_${langCode}_${deviceIdType}.json`;
const response = await fetch(fileName);
if (!response.ok) {
console.warn(`Failed to load HMS info file: ${fileName}`);
return false;
}
const data = await response.json();
this.hmsInfoJsons.set(deviceIdType, data);
return true;
} catch (error) {
console.error(`Error loading HMS info for device ${deviceIdType}:`, error);
return false;
}
}
/**
* Load HMS actions from JSON file
* @param deviceIdType - Device ID type (e.g., "094")
* @returns Promise<boolean> - True if loaded successfully
*/
async loadHmsActions(deviceIdType) {
try {
const fileName = `hms_action_${deviceIdType}.json`;
const response = await fetch(fileName);
if (!response.ok) {
console.warn(`Failed to load HMS actions file: ${fileName}`);
return false;
}
const data = await response.json();
this.hmsActionJsons.set(deviceIdType, data);
return true;
} catch (error) {
console.error(`Error loading HMS actions for device ${deviceIdType}:`, error);
return false;
}
}
/**
* Query HMS error message for a given error code
* @param deviceIdType - Device ID type
* @param longErrorCode - Long error code (e.g., "07FFC010")
* @param langCode - Language code (default: "en")
* @returns Human-readable error message or empty string if not found
*/
queryHmsMsg(deviceIdType, longErrorCode, langCode = "en") {
if (longErrorCode.length === 0) {
return "";
}
const hmsInfo = this.hmsInfoJsons.get(deviceIdType);
if (!hmsInfo) {
console.error(`No HMS info found for device: ${deviceIdType}`);
return "";
}
const deviceError = hmsInfo.data?.device_error;
if (!deviceError) {
console.error("Invalid HMS info structure: missing device_error");
return "";
}
const langMessages = deviceError[langCode];
if (langMessages && Array.isArray(langMessages)) {
for (const item of langMessages) {
if (item.ecode && item.ecode.toUpperCase() === longErrorCode.toUpperCase() && item.intro) {
return item.intro;
}
}
}
if (langCode !== "en") {
for (const [lang, messages] of Object.entries(deviceError)) {
if (lang === "ver") continue;
if (Array.isArray(messages)) {
for (const item of messages) {
if (item.ecode && item.ecode.toUpperCase() === longErrorCode.toUpperCase() && item.intro) {
console.log(`Found message in language: ${lang}`);
return item.intro;
}
}
}
}
}
console.error(`No HMS message found for error code: ${longErrorCode}, device: ${deviceIdType}, lang: ${langCode}`);
return "";
}
/**
* Query HMS action for a given error code
* @param deviceIdType - Device ID type
* @param longErrorCode - Long error code
* @returns HMS action object or null if not found
*/
queryHmsAction(deviceIdType, longErrorCode) {
const hmsAction = this.hmsActionJsons.get(deviceIdType);
if (!hmsAction) {
return null;
}
for (const item of hmsAction.data) {
if (item.ecode && item.ecode.toUpperCase() === longErrorCode.toUpperCase()) {
if (item.device && (item.device.toUpperCase() === deviceIdType.toUpperCase() || item.device === "default")) {
return item;
}
}
}
return null;
}
/**
* Check if an error is internal (has no user-facing message)
* @param deviceIdType - Device ID type
* @param longErrorCode - Long error code
* @param langCode - Language code
* @returns True if internal error
*/
isInternalError(deviceIdType, longErrorCode, langCode = "en") {
const message = this.queryHmsMsg(deviceIdType, longErrorCode, langCode);
return message.length === 0;
}
/**
* Get all available languages for a device
* @param deviceIdType - Device ID type
* @returns Array of language codes
*/
getAvailableLanguages(deviceIdType) {
const hmsInfo = this.hmsInfoJsons.get(deviceIdType);
if (!hmsInfo?.data?.device_error) {
return [];
}
return Object.keys(hmsInfo.data.device_error).filter((key) => key !== "ver");
}
/**
* Clear all loaded HMS data
*/
clearHmsInfo() {
this.hmsInfoJsons.clear();
this.hmsActionJsons.clear();
this.hmsLocalImages.clear();
this.cloudHmsLastUpdateTime.clear();
}
};
var hmsQuery = new HMSQuery();
function parseHmsInfo(attr, code) {
const module_id_int = attr >> 24 & 255;
const module_num = attr >> 16 & 255;
const part_id = attr >> 8 & 255;
const reserved = attr >> 0 & 255;
const msg_level_int = code >> 16;
const msg_level = msg_level_int < 5 /* HMS_MSG_LEVEL_MAX */ ? msg_level_int : 0 /* HMS_UNKNOWN */;
const msg_code = code & 65535;
return {
module_id: module_id_int,
module_num,
part_id,
reserved,
msg_level,
msg_code,
already_read: false
};
}
function getLongErrorCode(hmsItem) {
return `${hmsItem.module_id.toString(16).padStart(2, "0").toUpperCase()}${hmsItem.module_num.toString(16).padStart(2, "0").toUpperCase()}${hmsItem.part_id.toString(16).padStart(2, "0").toUpperCase()}00000${hmsItem.msg_level.toString(16).toUpperCase()}${hmsItem.msg_code.toString(16).padStart(4, "0").toUpperCase()}`;
}
function getLongErrorCodeFromRaw(attr, code) {
const hmsItem = parseHmsInfo(attr, code);
return getLongErrorCode(hmsItem);
}
function getModuleName(moduleId) {
switch (moduleId) {
case 3 /* MODULE_MC */:
return "MC";
case 5 /* MODULE_MAINBOARD */:
return "MainBoard";
case 7 /* MODULE_AMS */:
return "AMS";
case 8 /* MODULE_TH */:
return "TH";
case 12 /* MODULE_XCAM */:
return "XCam";
default:
return `Unknown0x${moduleId.toString(16).toUpperCase()}`;
}
}
function getHmsMessageLevelString(level) {
switch (level) {
case 1 /* HMS_FATAL */:
return "Fatal";
case 2 /* HMS_SERIOUS */:
return "Serious";
case 3 /* HMS_COMMON */:
return "Common";
case 4 /* HMS_INFO */:
return "Info";
default:
return "Unknown";
}
}
function parseHmsInfoDetailed(attr, code) {
const hmsItem = parseHmsInfo(attr, code);
const longErrorCode = getLongErrorCode(hmsItem);
return {
...hmsItem,
longErrorCode,
moduleName: getModuleName(hmsItem.module_id),
messageLevelString: getHmsMessageLevelString(hmsItem.msg_level),
// Additional computed properties
isFatal: hmsItem.msg_level === 1 /* HMS_FATAL */,
isSerious: hmsItem.msg_level === 2 /* HMS_SERIOUS */,
isCommon: hmsItem.msg_level === 3 /* HMS_COMMON */,
isInfo: hmsItem.msg_level === 4 /* HMS_INFO */,
isUnknown: hmsItem.msg_level === 0 /* HMS_UNKNOWN */
};
}
function isValidLongErrorCode(errorCode) {
if (errorCode.length !== 16) {
return false;
}
const hexRegex = /^[0-9A-Fa-f]+$/;
if (!hexRegex.test(errorCode)) {
return false;
}
if (errorCode.substring(6, 11) !== "00000") {
return false;
}
return true;
}
function parseLongErrorCode(longErrorCode) {
if (!isValidLongErrorCode(longErrorCode)) {
return null;
}
try {
const moduleId = parseInt(longErrorCode.substring(0, 2), 16);
const moduleNum = parseInt(longErrorCode.substring(2, 4), 16);
const partId = parseInt(longErrorCode.substring(4, 6), 16);
const msgLevel = parseInt(longErrorCode.substring(11, 12), 16);
const msgCode = parseInt(longErrorCode.substring(12, 16), 16);
return {
module_id: moduleId,
module_num: moduleNum,
part_id: partId,
reserved: 0,
// Not stored in long error code
msg_level: msgLevel,
msg_code: msgCode,
already_read: false
};
} catch {
return null;
}
}
function isFatalError(hmsItem) {
return hmsItem.msg_level === 1 /* HMS_FATAL */;
}
function isSeriousError(hmsItem) {
return hmsItem.msg_level === 2 /* HMS_SERIOUS */;
}
function isCommonError(hmsItem) {
return hmsItem.msg_level === 3 /* HMS_COMMON */;
}
function isInfoMessage(hmsItem) {
return hmsItem.msg_level === 4 /* HMS_INFO */;
}
function getErrorSeverity(hmsItem) {
return hmsItem.msg_level;
}
function isFromModule(hmsItem, moduleId) {
return hmsItem.module_id === moduleId;
}
function isAmsError(hmsItem) {
return isFromModule(hmsItem, 7 /* MODULE_AMS */);
}
function isMcError(hmsItem) {
return isFromModule(hmsItem, 3 /* MODULE_MC */);
}
function isThError(hmsItem) {
return isFromModule(hmsItem, 8 /* MODULE_TH */);
}
function isXcamError(hmsItem) {
return isFromModule(hmsItem, 12 /* MODULE_XCAM */);
}
async function parseHmsErrorComplete(deviceIdType, attr, code, langCode = "en") {
const hmsItem = parseHmsInfo(attr, code);
const longErrorCode = getLongErrorCode(hmsItem);
await hmsQuery.loadHmsInfo(deviceIdType, langCode);
await hmsQuery.loadHmsActions(deviceIdType);
const errorMessage = hmsQuery.queryHmsMsg(deviceIdType, longErrorCode, langCode);
const action = hmsQuery.queryHmsAction(deviceIdType, longErrorCode);
const isInternal = hmsQuery.isInternalError(deviceIdType, longErrorCode, langCode);
return {
hmsItem,
longErrorCode,
errorMessage,
action,
isInternal,
moduleName: getModuleName(hmsItem.module_id),
messageLevelString: getHmsMessageLevelString(hmsItem.msg_level)
};
}
async function getHmsErrorMessage(deviceIdType, longErrorCode, langCode = "en") {
await hmsQuery.loadHmsInfo(deviceIdType, langCode);
return hmsQuery.queryHmsMsg(deviceIdType, longErrorCode, langCode);
}
async function getHmsAction(deviceIdType, longErrorCode) {
await hmsQuery.loadHmsActions(deviceIdType);
return hmsQuery.queryHmsAction(deviceIdType, longErrorCode);
}
// src/errors.ts
var ERROR_CODES_JOB_FAILED = [
83902466,
83902467,
83902468,
83902469,
83902470,
83902471,
83902472,
83902473,
83902474,
83902475,
117456897,
83902476,
83902477,
83902478,
83902484,
83902485,
83902486,
83902509,
83902510,
83902511,
83902519,
83902520,
83902522,
83918867,
83935248,
83968052,
50348032,
50348033,
50348034,
50348045,
50364424,
50364430,
50364432
];
var LOCAL_CANCEL_CODE = 50348044;
var ALL_ERRORS = {
5324857: "Device login has expired, please try to bind again.",
50348032: "Printing stopped because homing Z axis failed.",
50348033: "The printer timed out waiting for the nozzle to cool down before homing.",
50348034: "Printing Stopped because Auto Bed Leveling failed.",
50348037: "The nozzle fan speed is abnormal.",
50348038: "The nozzle is clogged.",
50348040: "The AMS failed to change filament.",
50348041: "Homing XY axis failed.",
50348042: "Mechanical resonance frequency identification failed.",
50348043: "Internal communication exception.",
50348044: "Printing was cancelled.",
50348045: "Resume failed after power loss.",
50348046: "The motor self-check failed.",
50364416: 'Printing was paused for unknown reason. You can tap "Resume" to resume the print job.',
50364417: 'Printing was paused by the user. You can tap "Resume" to resume the print job.',
50364418: "First layer defects were detected by the Micro Lidar. Please check the quality of the printed model before continuing your print.",
50364419: "Spaghetti defects were detected by the AI Print Monitoring. Please check the quality of the printed model before continuing your print.",
50364420: "Filament ran out. Please load new filament.",
50364421: "Toolhead front cover fell off. Please remount the front cover and check to make sure your print is going okay.",
50364422: "The build plate marker was not detected. Please confirm the build plate is correctly positioned on the heatbed with all four corners aligned, and the maker is clear.",
50364423: "There was an unfinished print job when the printer lost power. If the model is still adhered to the build plate, you can try resuming the print job.",
50364424: "Printing Stopped because nozzle temperature problem.",
50364425: "Heatbed temperature malfunction.",
50364426: "A Filament pile-up was detected by the AI Print Monitoring. Please clean the filament from the waste chute.",
50364427: "The cutter is stuck. Please make sure the cutter handle is out.",
50364428: "Skipping step detected, auto-recover complete; please resume print and check if there are any layer shift problems.",
50364429: 'Some objects have fallen down, or the extruder is not extruding normally. If the defects are acceptable, click "Resume" button to resume the print job.',
50364430: "The print file is not available. Please check to see if the storage media has been removed.",
50364431: "The door seems to be open, so printing was paused.",
50364432: "Printing stopped because the hotend fan speed is abnormal.",
50364433: "Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.",
50364435: 'Printing was paused by the user. You can select "Resume" to continue printing.',
50364436: 'The nozzle is covered with filaments, or the build plate is installed incorrectly. Please cancel this printing and clean the nozzle or adjust the build plate according to the actual status, or tap "Resume" button to resume the print job.',
50364437: 'The filament has run out, please load new filament in the "filament" page.',
50364438: 'The nozzle is clogged up with filaments. Please cancel this printing and clean the nozzle according to the actual status, or tap "Resume" button to resume the print job.',
50364439: 'Foreign objects detected on hotbed, Please check and clean the hotbed, Then tap "Resume" button to resume the print job.',
50364440: "Chamber temperature malfunction.",
50364441: "No build plate is placed.",
83902465: "Failed to connect to Bambu Cloud. Please check your network connection.",
83902466: "Unsupported print file path or name. Please resend the printing job.",
83902467: "Printing stopped because the printer was unable to parse the file. Please resend your print job.",
83902468: "The printer can't receive new print jobs while printing. Resend after the current print finishes.",
83902469: "Print jobs are not allowed to be sent while updating firmware.",
83902470: "There is not enough free storage space for the print job. Restoring to factory settings can release available space.",
83902471: "Print jobs are not allowed to be sent while force updating or when repair updating is required.",
83902472: "Starting printing failed. please power cycle the printer and resend the print job.",
83902473: "Print jobs are not allowed to be sent while updating logs.",
83902474: "The file name is not supported. Please rename and restart the printing job.",
83902475: "There was a problem downloading a file. Please check you network connection and resend the printing job.",
83902476: "Please insert a MicroSD card and restart the printing job.",
83902477: "Please run a self-test and restart the printing job.",
83902478: "Printing was cancelled.",
83902484: "Slicing for the print job failed. Please check your settings and restart the print job.",
83902485: "There is not enough free storage space for the print job. Please format or clean MicroSD card to release available space.",
83902486: "The MicroSD Card is write-protected. Please replace the MicroSD Card.",
83902487: "Binding failed. Please retry or restart the printer and retry.",
83902488: "Binding configuration information parsing failed, please try again.",
83902489: "The printer has already been bound. Please unbind it and try again.",
83902490: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration and then try again.",
83902491: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.",
83902492: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.",
83902493: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.",
83902494: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.",
83902495: "Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.",
83902496: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.",
83902497: "Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.",
83902498: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.",
83902499: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.",
83902500: "Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the printer closer to the router or checking the router configuration before you try again.",
83902501: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.",
83902502: "Cloud access rejected. If you have tried multiple times and are still failing, please contact customer service.",
83902503: "Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.",
83902504: "Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer service.",
83902505: "Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer service.",
83902506: "Failed to connect to the router, which may be caused by wireless interference or being too far away from the router. Please try again or move the printer closer to the router and try again.",
83902507: "Router connection failed due to incorrect password. Please check the password and try again.",
83902508: "Failed to obtain IP address, which may be caused by wireless interference resulting in data transmission failure or DHCP address pool of the router being full. Please move the printer closer to the router and try again. If the issue persists, please check router settings to see whether the IP addresses have been exhausted.",
83902509: "System exception.",
83902510: "The system does not support the file system currently used by the Micro SD card. Please replace the Micro SD card or format the current Micro SD card to FAT32.",
83902511: "The Micro SD card sector data is damaged. Please use the SD card repair tool to repair or format it. If it still cannot be identified, please replace the Micro SD card.",
83902519: "Your sliced file is not compatible with current printer model. This file can't be printed