greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
698 stars 59 forks source link

[Bug] A1: Slicer cannot connect to printer if integration is running due to firmware bug limiting to a single active connection. #471

Closed xxgmxx closed 4 months ago

xxgmxx commented 4 months ago

Describe the bug

Hi guys!

I cannot use Bambu or Orca slicer when the HA integration is enabled (LAN only mode). Integration itself is always working, it has never stopped working, but the only way to connect to the printer with Slicer is to disable integration. The error I get is listed as: Code: -6010 Desc : Connection to printer failed Info: Please check the network connection of the printer and Studio.

A1 (v01.01.01.00) with AMS lite Bambu Studio (v1.8.4.5.1) Orca Slicer (v1.9.1)

Snímek obrazovky 2024-02-21 194746

To Reproduce

To reproduce:

  1. Turn on LAN only mode for your A1,
  2. Enable/Install HA-BambuLab integration to your HA and enable it.
  3. Try using Bambu or Orca slicer and get the same error like me
  4. To "solve":

  5. disable the HA integration.
  6. Done, you can use slicer again.

Expected Behaviour

It should hopefully work simultaneously.

What device are you using?

A1

Diagnostic Output

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.2.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.1",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Prague",
    "os_name": "Linux",
    "os_version": "6.1.74-haos",
    "supervisor": "2024.02.0",
    "host_os": "Home Assistant OS 11.5",
    "docker_version": "24.0.7",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "bambu_lab": {
      "version": "2.0.14",
      "requirements": []
    },
    "waste_collection_schedule": {
      "version": "1.45.1",
      "requirements": [
        "icalendar",
        "recurring_ical_events",
        "icalevents",
        "beautifulsoup4",
        "lxml"
      ]
    },
    "samsungtv_tizen": {
      "version": "1.6.1",
      "requirements": [
        "websocket-client>=0.56.0",
        "wakeonlan>=2.0.0",
        "numpy>=1.19.2"
      ]
    },
    "sonoff": {
      "version": "3.6.0",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "adaptive_lighting": {
      "version": "1.20.0",
      "requirements": [
        "ulid-transform"
      ]
    },
    "localtuya": {
      "version": "5.2.1",
      "requirements": []
    },
    "blueiris": {
      "version": "1.0.16",
      "requirements": []
    },
    "hacs": {
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "frigate": {
      "version": "5.0.1",
      "requirements": [
        "pytz==2022.7"
      ]
    },
    "fontawesome": {
      "version": "2.2.1",
      "requirements": []
    },
    "multiscrape": {
      "version": "6.5.0",
      "requirements": [
        "lxml>=4.9.1",
        "beautifulsoup4>=4.12.2"
      ]
    },
    "retry": {
      "version": "v2.7.0",
      "requirements": []
    },
    "lk3": {
      "version": "0.9.1",
      "requirements": []
    },
    "smartir": {
      "version": "1.17.9",
      "requirements": [
        "aiofiles>=0.6.0"
      ]
    },
    "reolink_dev": {
      "version": "0.64",
      "requirements": [
        "reolink==0.0.64",
        "aiosmtpd>=1.4.2"
      ]
    },
    "whatsapp": {
      "version": "1.0.2",
      "requirements": [
        "url-normalize==1.4.3"
      ]
    },
    "watchman": {
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "xiaomi_vacuum": {
      "version": "1.2",
      "requirements": []
    },
    "moonraker": {
      "version": "1.1.0",
      "requirements": [
        "moonraker-api==2.0.5"
      ]
    },
    "nodered": {
      "version": "3.1.3",
      "requirements": []
    },
    "cezdistribuce": {
      "version": "0.4.8",
      "requirements": []
    },
    "browser_mod": {
      "version": "2.3.0",
      "requirements": []
    },
    "mikrotik_router": {
      "version": "0.0.0",
      "requirements": [
        "librouteros>=3.2.0",
        "mac-vendor-lookup>=0.1.12"
      ]
    },
    "nicehash": {
      "version": "0.0.5",
      "requirements": []
    },
    "powercalc": {
      "version": "v1.10.5",
      "requirements": [
        "numpy>=1.21.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "bambu_lab",
    "name": "Bambu Lab",
    "codeowners": [
      "@greghesp",
      "@AdrianGarside"
    ],
    "config_flow": true,
    "dependencies": [
      "device_automation",
      "ffmpeg",
      "mqtt"
    ],
    "documentation": "https://github.com/greghesp/ha-bambulab",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/greghesp/ha-bambulab/issues",
    "ssdp": [
      {
        "st": "urn:bambulab-com:device:3dprinter:1"
      }
    ],
    "version": "2.0.14",
    "is_built_in": false
  },
  "data": {
    "config_entry": {
      "entry_id": "d2e3d8f02390694b38dcd7bd5db94b83",
      "version": 2,
      "minor_version": 1,
      "domain": "bambu_lab",
      "title": "**REDACTED**",
      "data": {
        "device_type": "A1",
        "serial": "**REDACTED**"
      },
      "options": {
        "region": "",
        "email": "",
        "username": "",
        "name": "",
        "host": "192.168.1.16",
        "local_mqtt": true,
        "auth_token": "",
        "access_code": "**REDACTED**",
        "usage_hours": 250.89666666666673
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": true,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    },
    "push_all": {
      "upload": {
        "status": "idle",
        "progress": 0,
        "message": ""
      },
      "nozzle_temper": 26.4375,
      "nozzle_target_temper": 0,
      "bed_temper": 27.59375,
      "bed_target_temper": 0,
      "chamber_temper": 5,
      "mc_print_stage": "1",
      "heatbreak_fan_speed": "0",
      "cooling_fan_speed": "0",
      "big_fan1_speed": "0",
      "big_fan2_speed": "0",
      "mc_percent": 0,
      "mc_remaining_time": 18,
      "ams_status": 0,
      "ams_rfid_status": 0,
      "hw_switch_state": 1,
      "spd_mag": 100,
      "spd_lvl": 2,
      "print_error": 0,
      "lifecycle": "product",
      "wifi_signal": "-54dBm",
      "gcode_state": "FAILED",
      "gcode_file_prepare_percent": "0",
      "queue_number": 0,
      "queue_total": 0,
      "queue_est": 0,
      "queue_sts": 0,
      "project_id": "0",
      "profile_id": "0",
      "task_id": "0",
      "subtask_id": "0",
      "subtask_name": "A1 PMS (Purge Management Syste",
      "gcode_file": "A1 PMS (Purge Management System",
      "stg": [],
      "stg_cur": 0,
      "print_type": "idle",
      "home_flag": 3687832,
      "mc_print_line_number": "2825",
      "mc_print_sub_stage": 1,
      "sdcard": true,
      "force_upgrade": false,
      "mess_production_state": "active",
      "layer_num": 6,
      "total_layer_num": 130,
      "s_obj": [],
      "fan_gear": 0,
      "hms": [],
      "online": {
        "ahb": false,
        "rfid": false,
        "version": 1755671213
      },
      "ams": {
        "ams": [
          {
            "id": "0",
            "humidity": "5",
            "temp": "0.0",
            "tray": [
              {
                "id": "0"
              },
              {
                "id": "1"
              },
              {
                "id": "2",
                "remain": 100,
                "k": 0.02500000037252903,
                "n": 1.399999976158142,
                "tag_uid": "0000000000000000",
                "tray_id_name": "",
                "tray_info_idx": "GFG99",
                "tray_type": "PETG",
                "tray_sub_brands": "",
                "tray_color": "FFFFFFFF",
                "tray_weight": "0",
                "tray_diameter": "0.00",
                "tray_temp": "0",
                "tray_time": "0",
                "bed_temp_type": "0",
                "bed_temp": "0",
                "nozzle_temp_max": "270",
                "nozzle_temp_min": "220",
                "xcam_info": "000000000000000000000000",
                "tray_uuid": "00000000000000000000000000000000"
              },
              {
                "id": "3"
              }
            ]
          }
        ],
        "ams_exist_bits": "1",
        "tray_exist_bits": "4",
        "tray_is_bbl_bits": "4",
        "tray_tar": "2",
        "tray_now": "2",
        "tray_pre": "2",
        "tray_read_done_bits": "4",
        "tray_reading_bits": "0",
        "version": 21,
        "insert_flag": true,
        "power_on_flag": false
      },
      "vt_tray": {
        "id": "254",
        "tag_uid": "0000000000000000",
        "tray_id_name": "",
        "tray_info_idx": "GFG99",
        "tray_type": "PETG",
        "tray_sub_brands": "",
        "tray_color": "AF4CD1FF",
        "tray_weight": "0",
        "tray_diameter": "0.00",
        "tray_temp": "0",
        "tray_time": "0",
        "bed_temp_type": "0",
        "bed_temp": "0",
        "nozzle_temp_max": "270",
        "nozzle_temp_min": "220",
        "xcam_info": "000000000000000000000000",
        "tray_uuid": "00000000000000000000000000000000",
        "remain": 0,
        "k": 0.019999999552965164,
        "n": 1
      },
      "lights_report": [
        {
          "node": "chamber_light",
          "mode": "on"
        }
      ],
      "upgrade_state": {
        "sequence_id": 0,
        "progress": "",
        "status": "",
        "consistency_request": false,
        "dis_state": 0,
        "err_code": 0,
        "force_upgrade": false,
        "message": "0%, 0B/s",
        "module": "",
        "new_version_state": 0,
        "cur_state_code": 0,
        "new_ver_list": []
      },
      "ipcam": {
        "ipcam_dev": "1",
        "ipcam_record": "enable",
        "timelapse": "disable",
        "resolution": "1536x720",
        "mode_bits": 3
      },
      "xcam": {
        "printing_monitor": false,
        "halt_print_sensitivity": "medium"
      },
      "command": "push_status",
      "msg": 0,
      "sequence_id": "12113"
    },
    "get_version": {
      "command": "get_version",
      "sequence_id": "0",
      "module": [
        {
          "name": "ota",
          "project_name": "N2S",
          "sw_ver": "01.01.01.00",
          "hw_ver": "OTA",
          "sn": "**REDACTED**"
        },
        {
          "name": "esp32",
          "project_name": "N2S",
          "sw_ver": "01.07.22.30",
          "hw_ver": "AP05",
          "sn": "**REDACTED**"
        },
        {
          "name": "mc",
          "project_name": "N2S",
          "sw_ver": "00.00.20.63",
          "loader_ver": "00.00.00.32",
          "hw_ver": "MC02",
          "sn": "**REDACTED**"
        },
        {
          "name": "th",
          "project_name": "N2S",
          "sw_ver": "00.00.06.74",
          "loader_ver": "00.00.00.26",
          "hw_ver": "TH01",
          "sn": "**REDACTED**"
        },
        {
          "name": "ams_f1/0",
          "project_name": "",
          "sw_ver": "00.00.07.89",
          "loader_ver": "00.00.00.00",
          "ota_ver": "00.00.00.00",
          "hw_ver": "AMS_F102",
          "sn": "**REDACTED**"
        }
      ],
      "result": "success",
      "reason": ""
    }
  }
}

Log Extracts

No response

Other Information

No response

AdrianGarside commented 4 months ago

What happens if you update to the latest firmware? This issue was fixed in the most recent P1P/S firmware update. And I'm expecting the A1 to get the fix too and there was a recent firmware update (2/6) - which you don't have.

AdrianGarside commented 4 months ago

The workaround until/if Bambu fixes the issue is to not use lan mode, or use manual refresh mode in the integration.

atax112 commented 4 months ago

I have switched to local LAN mode on my A1 after registering etc, running HA integration out of the box...no issues with slicer connection. I print/send/control the printer while HA is up and running/connected/integration online all the time.

HA running on a dedicated HW machine(old laptop), I also have octoprint connected to the A1 from an RPi with https://github.com/jneilliii/OctoPrint-BambuPrinter, works fine even if in early stages.

AdrianGarside commented 4 months ago

@atax112 awesome and presumably you’re running the recently release firmware update?

atax112 commented 4 months ago

Latest yes.

AdrianGarside commented 4 months ago

Thanks I was expecting they would have fixed it in that version even if they didn’t call it out in the release notes (I don’t think they did for the P1 either).