Bambu-Research-Group / RFID-Tag-Guide

Instructions on how to read out the bambulab nfc tags
680 stars 62 forks source link

Filament Internal Code #42

Open spuder opened 3 weeks ago

spuder commented 3 weeks ago

Dumping the mqtt messages I've identified an internal code that is used for filaments

Screenshot 2024-10-22 at 19 06 36

WolfWithSword has documented most of these internal filament codes

https://github.com/WolfwithSword/ha-bambulab/blob/78cc6bda14ef0f82e74b59afc745cc5534c01a5e/custom_components/bambu_lab/pybambu/const.py#L40-L62

    "default": "Unknown",
    "GFU99": "Generic TPU",
    "GFS99": "Generic PVA",
    "GFL98": "Generic PLA-CF",
    "GFL99": "Generic PLA",
    "GFG99": "Generic PETG",
    "GFC99": "Generic PC",
    "GFN98": "Generic PA-CF",
    "GFN99": "Generic PA",
    "GFB98": "Generic ASA",
    "GFB99": "Generic ABS",
    "GFU01": "Bambu TPU 95A",
    "GFS00": "Bambu Support W",
    "GFS01": "Bambu Support G",
    "GFA01": "Bambu PLA Matte",
    "GFA00": "Bambu PLA Basic",
    "GFC00": "Bambu PC",
    "GFN03": "Bambu PA-CF",
    "GFB00": "Bambu ABS",
    "GFL01": "PolyTerra PLA",
    "GFL00": "PolyLite PLA"
}
CodeBradley commented 1 week ago

You sir are a gentleman and a scholar. How are you dumping the mqtt messages like this btw? His script looked home assistant based.

spuder commented 1 week ago

To get the mqtt messages use mqttx

mqttx sub -t 'device/$SERIAL_NUMBER/report' -u -P $LAN_ACCESS_CODE --mqtt-version 3.1.1 -h $IP_ADDRESS -p 8883 -l mqtts --insecure

The mqtt api is documented here:

https://github.com/Doridian/OpenBambuAPI/blob/main/mqtt.md

The 2 main endpoints are /report and /request

For example to change the filament color you would do a request with a json payload like this

{
    "print": {
        "sequence_id": "0",
        "command": "ams_filament_setting",
        "ams_id": 0,
        "tray_id": 0,
        "tray_info_idx": "GFG99",
        "tray_color": "F72323FF",
        "nozzle_temp_min": 220,
        "nozzle_temp_max": 270,
        "tray_type": "PETG",
        "setting_id": ""
    }
}
capull0 commented 6 days ago

you can query the Bambulab API and you will get a full filament list, also with your custom profiles. each filament has a uniq ID, also the custom profiles. You can have a look here, how you can read the filament list over the API: https://github.com/capull0/BambuAMSCtrl I coded this flask application, which will make the Bambulab RFID tags obsolete. Is working flawless since weeks.