Skip to content

bambuconfig

bambuconfig contains the BambuConfig class used for managing configuration data

Classes:

Name Description
BambuConfig

This is the main configuration class for BambuPrinter and is how it knows where to connect to a printer,

PrinterCapabilities

Hardware capabilities discovered during the initial handshake or telemetry analysis.

BambuConfig dataclass

Python
BambuConfig(
    hostname: str,
    access_code: str,
    serial_number: str,
    mqtt_port: int = 8883,
    mqtt_client_id: str = "studio_client_id:0c1f",
    mqtt_username: str = "bblp",
    watchdog_timeout: int = 30,
    external_chamber: bool = False,
    capabilities: PrinterCapabilities = PrinterCapabilities(),
    bpm_cache_path: Path | None = None,
    printer_model: PrinterModel = UNKNOWN,
    firmware_version: str = "",
    ams_firmware_version: str = "",
    auto_recovery: bool = False,
    filament_tangle_detect: bool = False,
    sound_enable: bool = False,
    auto_switch_filament: bool = False,
    startup_read_option: bool = False,
    tray_read_option: bool = False,
    calibrate_remain_flag: bool = False,
    buildplate_marker_detector: bool = False,
    spaghetti_detector: bool = False,
    spaghetti_detector_sensitivity: str = "medium",
    purgechutepileup_detector: bool = False,
    purgechutepileup_detector_sensitivity: str = "medium",
    nozzleclumping_detector: bool = False,
    nozzleclumping_detector_sensitivity: str = "medium",
    airprinting_detector: bool = False,
    airprinting_detector_sensitivity: str = "medium",
    nozzle_blob_detect: bool = False,
    air_print_detect: bool = False,
    verbose: bool = False,
)

This is the main configuration class for BambuPrinter and is how it knows where to connect to a printer, what access code, and serial # to use. Further, it contains a number of printer behavioral settings and capabability values.

Methods:

Name Description
__post_init__

Post-initialization logic to handle defaults.

set_new_bpm_cache_path

Enables changing the bpm cache directory at runtime. Will orphan previous contents.

Attributes:

Name Type Description
access_code str

8-character LAN-only access code for MQTT authentication.

air_print_detect bool

Toggles air-print detection to detect clogging or filament grinding conditions.

airprinting_detector bool

Toggles AI air-printing detection.

airprinting_detector_sensitivity str

Sensitivity level for air-printing pause behavior (low|medium|high).

ams_firmware_version str

Semantic version string of the primary AMS controller.

auto_recovery bool

Firmware-level toggle for resuming prints after step-loss.

auto_switch_filament bool

Enables automatic AMS failover to redundant spools.

bpm_cache_path Path | None

The underlying directory BPM uses for managing cache / metadata.

buildplate_marker_detector bool

Toggles the AI vision ArUco marker scanning system used to verify build surface compatibility.

calibrate_remain_flag bool

Enablement for the spool-weight based estimation of the remaining filament length in the AMS.

capabilities PrinterCapabilities

Pre-defined or discovered hardware feature set.

external_chamber bool

If True, ignores internal CTC telemetry to allow manual sensor injection.

filament_tangle_detect bool

Master switch for AMS tension-based monitor logic.

firmware_version str

Semantic version string of the main printer firmware.

hostname str

IP address or DNS name of the printer on the local subnet.

mqtt_client_id str

Unique identifier used during the MQTT handshake protocol.

mqtt_port int

Network port for the SSL-encrypted MQTT broker (Default: 8883).

mqtt_username str

Authentication username for the local MQTT broker (Default: 'bblp').

nozzle_blob_detect bool

Toggles the AI vision system used to detect nozzle blobs / clumps.

nozzleclumping_detector bool

Toggles AI nozzle clumping detection.

nozzleclumping_detector_sensitivity str

Sensitivity level for nozzle clumping pause behavior (low|medium|high).

printer_model PrinterModel

Read-only classification of the printer hardware (e.g. A1, H2D) derived from the serial number prefix.

purgechutepileup_detector bool

Toggles AI purge-chute pileup detection.

purgechutepileup_detector_sensitivity str

Sensitivity level for purge-chute pileup pause behavior (low|medium|high).

serial_number str

Unique hardware identifier used to derive the printer model.

sound_enable bool

Controls the machine's internal speaker for user notifications.

spaghetti_detector bool

Toggles AI spaghetti detection for failed-print strand detection.

spaghetti_detector_sensitivity str

Sensitivity level for spaghetti detection pause behavior (low|medium|high).

startup_read_option bool

Configures whether the AMS unit performs a full RFID scan of all slots upon printer power-on.

tray_read_option bool

Toggles the automatic RFID identification sequence when a new filament spool is inserted or detected.

verbose bool

Provides an additional log level for dumping all messages

watchdog_timeout int

Duration in seconds before a connection is flagged as stale.

access_code instance-attribute

Python
access_code: str

8-character LAN-only access code for MQTT authentication.

air_print_detect class-attribute instance-attribute

Python
air_print_detect: bool = False

Toggles air-print detection to detect clogging or filament grinding conditions.

airprinting_detector class-attribute instance-attribute

Python
airprinting_detector: bool = False

Toggles AI air-printing detection.

airprinting_detector_sensitivity class-attribute instance-attribute

Python
airprinting_detector_sensitivity: str = 'medium'

Sensitivity level for air-printing pause behavior (low|medium|high).

ams_firmware_version class-attribute instance-attribute

Python
ams_firmware_version: str = ''

Semantic version string of the primary AMS controller.

auto_recovery class-attribute instance-attribute

Python
auto_recovery: bool = False

Firmware-level toggle for resuming prints after step-loss.

auto_switch_filament class-attribute instance-attribute

Python
auto_switch_filament: bool = False

Enables automatic AMS failover to redundant spools.

bpm_cache_path class-attribute instance-attribute

Python
bpm_cache_path: Path | None = None

The underlying directory BPM uses for managing cache / metadata.

buildplate_marker_detector class-attribute instance-attribute

Python
buildplate_marker_detector: bool = False

Toggles the AI vision ArUco marker scanning system used to verify build surface compatibility.

calibrate_remain_flag class-attribute instance-attribute

Python
calibrate_remain_flag: bool = False

Enablement for the spool-weight based estimation of the remaining filament length in the AMS.

capabilities class-attribute instance-attribute

Python
capabilities: PrinterCapabilities = field(default_factory=PrinterCapabilities)

Pre-defined or discovered hardware feature set.

external_chamber class-attribute instance-attribute

Python
external_chamber: bool = False

If True, ignores internal CTC telemetry to allow manual sensor injection.

filament_tangle_detect class-attribute instance-attribute

Python
filament_tangle_detect: bool = False

Master switch for AMS tension-based monitor logic.

firmware_version class-attribute instance-attribute

Python
firmware_version: str = ''

Semantic version string of the main printer firmware.

hostname instance-attribute

Python
hostname: str

IP address or DNS name of the printer on the local subnet.

mqtt_client_id class-attribute instance-attribute

Python
mqtt_client_id: str = 'studio_client_id:0c1f'

Unique identifier used during the MQTT handshake protocol.

mqtt_port class-attribute instance-attribute

Python
mqtt_port: int = 8883

Network port for the SSL-encrypted MQTT broker (Default: 8883).

mqtt_username class-attribute instance-attribute

Python
mqtt_username: str = 'bblp'

Authentication username for the local MQTT broker (Default: 'bblp').

nozzle_blob_detect class-attribute instance-attribute

Python
nozzle_blob_detect: bool = False

Toggles the AI vision system used to detect nozzle blobs / clumps.

nozzleclumping_detector class-attribute instance-attribute

Python
nozzleclumping_detector: bool = False

Toggles AI nozzle clumping detection.

nozzleclumping_detector_sensitivity class-attribute instance-attribute

Python
nozzleclumping_detector_sensitivity: str = 'medium'

Sensitivity level for nozzle clumping pause behavior (low|medium|high).

printer_model class-attribute instance-attribute

Python
printer_model: PrinterModel = UNKNOWN

Read-only classification of the printer hardware (e.g. A1, H2D) derived from the serial number prefix.

purgechutepileup_detector class-attribute instance-attribute

Python
purgechutepileup_detector: bool = False

Toggles AI purge-chute pileup detection.

purgechutepileup_detector_sensitivity class-attribute instance-attribute

Python
purgechutepileup_detector_sensitivity: str = 'medium'

Sensitivity level for purge-chute pileup pause behavior (low|medium|high).

serial_number instance-attribute

Python
serial_number: str

Unique hardware identifier used to derive the printer model.

sound_enable class-attribute instance-attribute

Python
sound_enable: bool = False

Controls the machine's internal speaker for user notifications.

spaghetti_detector class-attribute instance-attribute

Python
spaghetti_detector: bool = False

Toggles AI spaghetti detection for failed-print strand detection.

spaghetti_detector_sensitivity class-attribute instance-attribute

Python
spaghetti_detector_sensitivity: str = 'medium'

Sensitivity level for spaghetti detection pause behavior (low|medium|high).

startup_read_option class-attribute instance-attribute

Python
startup_read_option: bool = False

Configures whether the AMS unit performs a full RFID scan of all slots upon printer power-on.

tray_read_option class-attribute instance-attribute

Python
tray_read_option: bool = False

Toggles the automatic RFID identification sequence when a new filament spool is inserted or detected.

verbose class-attribute instance-attribute

Python
verbose: bool = False

Provides an additional log level for dumping all messages

watchdog_timeout class-attribute instance-attribute

Python
watchdog_timeout: int = 30

Duration in seconds before a connection is flagged as stale.

__post_init__

Python
__post_init__()

Post-initialization logic to handle defaults.

Source code in src/bpm/bambuconfig.py
Python
def __post_init__(self):
    """
    Post-initialization logic to handle defaults.
    """
    self.printer_model = getPrinterModelBySerial(self.serial_number)

    # Default bpm_cache_path and creation
    if self.bpm_cache_path is None:
        self.bpm_cache_path = Path("~/.bpm").expanduser()
    self.set_new_bpm_cache_path(self.bpm_cache_path)

set_new_bpm_cache_path

Python
set_new_bpm_cache_path(path: Path)

Enables changing the bpm cache directory at runtime. Will orphan previous contents.

Source code in src/bpm/bambuconfig.py
Python
def set_new_bpm_cache_path(self, path: Path):
    """Enables changing the bpm cache directory at runtime.  Will orphan previous contents."""
    self.bpm_cache_path = path
    metadata = self.bpm_cache_path / "metadata"
    metadata.mkdir(parents=True, exist_ok=True)

PrinterCapabilities dataclass

Python
PrinterCapabilities(
    has_ams: bool = False,
    has_lidar: bool = False,
    has_camera: bool = False,
    has_dual_extruder: bool = False,
    has_air_filtration: bool = False,
    has_chamber_temp: bool = False,
    has_chamber_door_sensor: bool = False,
    has_sound_enable_support: bool = False,
    has_auto_recovery_support: bool = False,
    has_auto_switch_filament_support: bool = False,
    has_filament_tangle_detect_support: bool = False,
    has_nozzle_blob_detect_support: bool = False,
    has_air_print_detect_support: bool = False,
    has_buildplate_marker_detector_support: bool = False,
    has_spaghetti_detector_support: bool = False,
    has_purgechutepileup_detector_support: bool = False,
    has_nozzleclumping_detector_support: bool = False,
    has_airprinting_detector_support: bool = False,
)

Hardware capabilities discovered during the initial handshake or telemetry analysis.

Attributes:

Name Type Description
has_air_filtration bool

Indicates the motorized airduct and filtration subsystem is physically installed.

has_air_print_detect_support bool

Indicates whether air-print detection control is supported by firmware telemetry flags.

has_airprinting_detector_support bool

Indicates whether air-printing detector control is supported by xcam telemetry.

has_ams bool

Indicates an active AMS unit is detected on the hardware bus via the ams block.

has_auto_recovery_support bool

Indicates whether auto-recovery control is supported by explicit support telemetry keys.

has_auto_switch_filament_support bool

Indicates whether AMS auto-switch control is supported by explicit support telemetry keys.

has_buildplate_marker_detector_support bool

Indicates whether buildplate marker detector control is supported by xcam telemetry.

has_camera bool

Verified availability of the onboard AI camera module.

has_chamber_door_sensor bool

Verification that the front glass enclosure is equipped with a hall-effect sensor.

has_chamber_temp bool

Confirmed presence of the Chamber Thermal Controller (CTC) ambient sensor.

has_dual_extruder bool

Identifies the H2D dual-path architecture where independent hotend monitoring is required.

has_filament_tangle_detect_support bool

Indicates whether filament tangle detection control is supported by firmware telemetry flags.

has_lidar bool

Confirmed presence of the Micro LiDAR sensor based on xcam telemetry existence.

has_nozzle_blob_detect_support bool

Indicates whether nozzle blob detection control is supported by firmware telemetry flags.

has_nozzleclumping_detector_support bool

Indicates whether nozzle-clumping detector control is supported by xcam telemetry.

has_purgechutepileup_detector_support bool

Indicates whether purge-chute pileup detector control is supported by xcam telemetry.

has_sound_enable_support bool

Indicates whether prompt sound control is supported by firmware telemetry flags.

has_spaghetti_detector_support bool

Indicates whether spaghetti detector control is supported by xcam telemetry.

has_air_filtration class-attribute instance-attribute

Python
has_air_filtration: bool = False

Indicates the motorized airduct and filtration subsystem is physically installed.

has_air_print_detect_support class-attribute instance-attribute

Python
has_air_print_detect_support: bool = False

Indicates whether air-print detection control is supported by firmware telemetry flags.

has_airprinting_detector_support class-attribute instance-attribute

Python
has_airprinting_detector_support: bool = False

Indicates whether air-printing detector control is supported by xcam telemetry.

has_ams class-attribute instance-attribute

Python
has_ams: bool = False

Indicates an active AMS unit is detected on the hardware bus via the ams block.

has_auto_recovery_support class-attribute instance-attribute

Python
has_auto_recovery_support: bool = False

Indicates whether auto-recovery control is supported by explicit support telemetry keys.

has_auto_switch_filament_support class-attribute instance-attribute

Python
has_auto_switch_filament_support: bool = False

Indicates whether AMS auto-switch control is supported by explicit support telemetry keys.

has_buildplate_marker_detector_support class-attribute instance-attribute

Python
has_buildplate_marker_detector_support: bool = False

Indicates whether buildplate marker detector control is supported by xcam telemetry.

has_camera class-attribute instance-attribute

Python
has_camera: bool = False

Verified availability of the onboard AI camera module.

has_chamber_door_sensor class-attribute instance-attribute

Python
has_chamber_door_sensor: bool = False

Verification that the front glass enclosure is equipped with a hall-effect sensor.

has_chamber_temp class-attribute instance-attribute

Python
has_chamber_temp: bool = False

Confirmed presence of the Chamber Thermal Controller (CTC) ambient sensor.

has_dual_extruder class-attribute instance-attribute

Python
has_dual_extruder: bool = False

Identifies the H2D dual-path architecture where independent hotend monitoring is required.

has_filament_tangle_detect_support class-attribute instance-attribute

Python
has_filament_tangle_detect_support: bool = False

Indicates whether filament tangle detection control is supported by firmware telemetry flags.

has_lidar class-attribute instance-attribute

Python
has_lidar: bool = False

Confirmed presence of the Micro LiDAR sensor based on xcam telemetry existence.

has_nozzle_blob_detect_support class-attribute instance-attribute

Python
has_nozzle_blob_detect_support: bool = False

Indicates whether nozzle blob detection control is supported by firmware telemetry flags.

has_nozzleclumping_detector_support class-attribute instance-attribute

Python
has_nozzleclumping_detector_support: bool = False

Indicates whether nozzle-clumping detector control is supported by xcam telemetry.

has_purgechutepileup_detector_support class-attribute instance-attribute

Python
has_purgechutepileup_detector_support: bool = False

Indicates whether purge-chute pileup detector control is supported by xcam telemetry.

has_sound_enable_support class-attribute instance-attribute

Python
has_sound_enable_support: bool = False

Indicates whether prompt sound control is supported by firmware telemetry flags.

has_spaghetti_detector_support class-attribute instance-attribute

Python
has_spaghetti_detector_support: bool = False

Indicates whether spaghetti detector control is supported by xcam telemetry.