(Gelöst) BambuLab X1c und MQTT

Begonnen von paul79, 30 März 2023, 21:39:32

Vorheriges Thema - Nächstes Thema

paul79

Hallo,

ich möchte gern meinen BambuLab X1c 3d Drucker mit MQTT abfragen leider bekomme ich keine Verbindung mit MQTT2_CLIENT hin.

meine Device sieht so aus:

nternals:
  BUF       
  Clients    :MQTT2_DEVICE:MQTT_GENERIC_BRIDGE:
  ClientsKeepOrder 1
  DEF        192.168.16.43:8883
  DeviceName 192.168.16.43:8883
  FUUID      6425a908-f33f-c290-1a01-0f7fab11cb39cf27
  NAME      BambuLab
  NEXT_OPEN  1680200568.46674
  NR        1096
  PARTIAL   
  SSL        1
  STATE      disconnected
  TYPE      MQTT2_CLIENT
  WBCallback
  clientId  bblp
  connecting 1
  eventCount 3869
  lastMsgTime 1680200421.28537
  nextOpenDelay 5
  nrConnects 357769
  qosCnt    0
  wantRead  1
  MatchList:
    1:MQTT2_DEVICE ^.
    2:MQTT_GENERIC_BRIDGE ^.
  READINGS:
    2023-03-30 20:22:43  state          disconnected
  hmccu:
Attributes:
  SSL        1
  autocreate simple
  clientId  bblp
  mqttVersion 3.1.1
  qosMaxQueueLength 0
  room      Hardware
  subscriptions device/00x00xxx0xxxxx0
  username  bblp
  verbose    3

Mit dem MQTT Explorer bekomme ich eine Verbindung hin. siehe Anhang

Mehr Infos gibt es einmal hier:

https://forum.iobroker.net/topic/61585/bambu-lab-3d-drucker-mqtt-integration/9

und hier https://wiki.bambulab.com/en/x1/manual/X1-X1C-AMS-firmware-release-history

BambuLab hat erst vor kurzem MQTT auf TLS 1.2 umgestellt, vielleicht ist ein Hinweis.

Zitata. In "LAN only" mode, TLS v1.2 is enabled in MQTT which is used for the direct connection between the printer and Bambu Studio. This improves LAN printer control security.

Über eine Lösung wäre ich sehr glücklich.

Gruß Paul


FHEM5.7 auf Pi3
Busware CUL433 (IT), JeeLink Lacrosse, HM-MOD-RPI-PCB, HM, TabletUI

rudolfkoenig

TLS 1.2 ist in einer halbwegs aktuellen Distribution (bzw. openssl Bibliothek) vorhanden, und MQTT2_CLIENT sollte es deswegen automatisch verwenden.

Steht was Auswertbares im FHEM-Log oder im Log des MQTT-Servers?

paul79

Hallo,

an den MQTT-Server selbst komme ich nicht ran, ist in der Firmware von Drucker.

Ein oder zweimal hat Fhem Daten wohl empfangen und es ein MQTT2_DEVICE angelegt.

2023.03.31 19:50:50 5: BambuLab: sending CONNECT (16)!(0)(4)MQTT(4)(194)(0)(30)(0)(5)fhem2(0)(4)bblp(0)(8)1601f7f6
2023.03.31 19:50:50 5: DevIo_SimpleWrite BambuLab: 102100044d51545404c2001e00056668656d32000462626c7000083136303166376636
2023.03.31 19:50:50 5: BambuLab: received SUBACK (0)L(0)
2023.03.31 19:50:50 5: BambuLab: sending SUBSCRIBE (130)(6)(0)L(0)(1)#(0)
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: connect to https://192.168.16.43:8883 timed out
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:50:50 1: BambuLab: Can't connect to 192.168.16.43:8883: connect to https://192.168.16.43:8883 timed out
2023.03.31 19:50:50 1: 192.168.16.43:8883 disconnected, waiting to reappear (BambuLab)
2023.03.31 19:50:50 5: HttpUtils url=https://192.168.16.43:8883/ NonBlocking via https
2023.03.31 19:50:50 4: IP: 192.168.16.43 -> 192.168.16.43

dann kam noch viel dieses

2023.03.31 19:47:56 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:56 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:56 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:56 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:56 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:47:57 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory

und das noch

2023.03.31 19:36:58 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:36:58 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:36:58 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:36:58 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:36:58 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:36:59 1: BambuLab: Can't connect to 192.168.16.43:8883: No such file or directory
2023.03.31 19:36:59 1: BambuLab: Can't connect to 192.168.16.43:8883: start_SSL https://192.168.16.43:8883 timed out
2023.03.31 19:37:46 1: 192.168.16.43:8883 disconnected, waiting to reappear (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:39:44 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:40:14 2: BambuLab: No CONNACK, disconnecting
2023.03.31 19:40:14 1: 192.168.16.43:8883 disconnected, waiting to reappear (BambuLab)
2023.03.31 19:47:54 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 1: 192.168.16.43:8883 reappeared (BambuLab)
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883
2023.03.31 19:47:54 3: Opening BambuLab device 192.168.16.43:8883

Mit dem MQTT Explorer empfange ich Daten ohne Aussetzer oder werden disconnected.

Gruß Paul
FHEM5.7 auf Pi3
Busware CUL433 (IT), JeeLink Lacrosse, HM-MOD-RPI-PCB, HM, TabletUI

paul79

Hallo,

ich habe jetzt einen ein anderes Programm gefunden MQTTX was auch wunderbar funktioniert und wo ich eine Log vom dem Verbindungsaufbau habe.

Dabei ist mir aufgefallen MQTTX zu mqtts:// als Protokoll wählt und FHEM https://

Connect client BambuLab, MQTT/SSL connection: mqtts://192.168.16.43:8883

[2023-04-01 09:38:01] [INFO] APP init
[2023-04-01 09:40:07] [INFO] First time created, Name: BambuLab, ID: 5026bb96-9655-4676-9a9a-306ae007337e
[2023-04-01 09:40:08] [INFO] MQTTX client with ID 5026bb96-9655-4676-9a9a-306ae007337e assigned
[2023-04-01 09:40:08] [INFO] Connect client BambuLab, MQTT/SSL connection: mqtts://192.168.16.43:8883 with Properties: {"sessionExpiryInterval":0,"receiveMaximum":null,"maximumPacketSize":null,"topicAliasMaximum":null,"requestResponseInformation":null,"requestProblemInformation":null,"authenticationMethod":null}
[2023-04-01 09:40:14] [INFO] BambuLab connect success, MQTT.js onConnect trigger
[2023-04-01 09:40:37] [INFO] Saved topic: testtopic/#
[2023-04-01 09:40:37] [INFO] Topic: testtopic/# successfully subscribed, Subscription Identifier: undefined, No Local flag: undefined, Retain as Published flag: undefined, Retain Handling: undefined
[2023-04-01 09:40:58] [INFO] Removed topic: testtopic/#
[2023-04-01 09:40:58] [INFO] Unsubscribe topic: testtopic/#
[2023-04-01 09:41:21] [INFO] Saved topic: #
[2023-04-01 09:41:21] [INFO] Topic: # successfully subscribed, Subscription Identifier: undefined, No Local flag: undefined, Retain as Published flag: undefined, Retain Handling: undefined
[2023-04-01 09:41:21] [INFO] Message Arrived with topic: device/00M00????0?????0/report
[2023-04-01 09:41:21] [INFO] BambuLab message arrived: message added "message_5fd8ddff-b764-485d-a0df-1e09c1ae9d5f" and added to topic: "device/00M00A2C0603330/report", payload: "{\n    \"print\": {\n        \"ams\": {\n            \"ams\": [\n                {\n                    \"humidity\": \"4\",\n                    \"id\": \"0\",\n                    \"temp\": \"25.4\",\n                    \"tray\": [\n                        {\n                            \"bed_temp\": \"0\",\n                            \"bed_temp_type\": \"0\",\n                            \"drying_temp\": \"0\",\n                            \"drying_time\": \"0\",\n                            \"id\": \"0\",\n                            \"nozzle_temp_max\": \"230\",\n                            \"nozzle_temp_min\": \"190\",\n                            \"remain\": 0,\n                            \"tag_uid\": \"0000000000000000\",\n                            \"tray_color\": \"000000FF\",\n                            \"tray_diameter\": \"0.00\",\n                            \"tray_id_name\": \"\",\n                            \"tray_info_idx\": \"GFL99\",\n                            \"tray_sub_brands\": \"\",\n                            \"tray_type\": \"PLA\",\n                            \"tray_uuid\": \"00000000000000000000000000000000\",\n                            \"tray_weight\": \"0\",\n                            \"xcam_info\": \"000000000000000000000000\"\n                        },\n                        {\n                            \"bed_temp\": \"45\",\n                            \"bed_temp_type\": \"1\",\n                            \"drying_temp\": \"55\",\n                            \"drying_time\": \"8\",\n                            \"id\": \"1\",\n                            \"nozzle_temp_max\": \"230\",\n                            \"nozzle_temp_min\": \"190\",\n                            \"remain\": 0,\n                            \"tag_uid\": \"17D512BA00000100\",\n                            \"tray_color\": \"FF6A13FF\",\n                            \"tray_diameter\": \"1.75\",\n                            \"tray_id_name\": \"A00-A0\",\n                            \"tray_info_idx\": \"GFA00\",\n                            \"tray_sub_brands\": \"PLA Basic\",\n                            \"tray_type\": \"PLA\",\n                            \"tray_uuid\": \"C155ADB88DD945B8815C6329FD5AC7AF\",

Kann das der Fehler sein?

Gruß Paul
FHEM5.7 auf Pi3
Busware CUL433 (IT), JeeLink Lacrosse, HM-MOD-RPI-PCB, HM, TabletUI

paul79

Hallo,

nachdem ich jetzt noch einmal alles rebootet habe funktioniert es wohl jetzt.

das sind Einstellungen:
defmod BambuLab MQTT2_CLIENT 192.168.16.43:8883
attr BambuLab SSL 1
attr BambuLab autocreate simple
attr BambuLab clientId fhem1
attr BambuLab clientOrder MQTT2_DEVICE
attr BambuLab mqttVersion 3.1.1
attr BambuLab qosMaxQueueLength 0
attr BambuLab room MQTT2_DEVICE
attr BambuLab username bblp
attr BambuLab verbose 3

setstate BambuLab opened
setstate BambuLab 2023-04-01 13:27:42 state opened

PS: Username ist fest von BambuLab vergeben bblp das Passwort ist der Lan only Access Code im Drucker Display.

Gruß Paul
FHEM5.7 auf Pi3
Busware CUL433 (IT), JeeLink Lacrosse, HM-MOD-RPI-PCB, HM, TabletUI

wing350

Moin,

soweit bin ich auch!

Ich tu mich nur unheimlich schwer, aus dem json-String readings oder set-commands zu extrahieren. Deswegen habe ich erstmal den Weg über Homeassistent gewählt und mir die Integration für BambuLab installiert. Ich bin aber ein unverbesserlicher FHEM-Freund und würde die Daten gerne in FHEM haben. Gibts da vielleicht schon eine Template?

Gruß
Reimer

P.S. Ich hab einen P1P und bin total begeistert.
FHEM auf Ubuntu VM/QNAP, FHEM-Native, CUL868, RFTRX433 und Jeelink auf RPi über ser2net an VM angebunden, PCA301/LaCrosse-Gateway (WLAN), FHTs, FS20-Aktoren, FBDECT, div. HM- und HMIP-Komponenten, Raspberrymatic VM auf QNAP, Signalduino für Somfy, optolink-WLAN für Viessmann, div. Shelly

paul79

Hallo Reiner,

ein Template habe ich noch nicht gesehen, ich lasse mir die Readings einfach alle über "attr xxxxxx autocreate simple" selbst anlegen.

Gruß Paul
FHEM5.7 auf Pi3
Busware CUL433 (IT), JeeLink Lacrosse, HM-MOD-RPI-PCB, HM, TabletUI