Open spuder opened 1 month 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.
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": ""
}
}
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.
https://github.com/capull0/BambuAMSCtrl I coded this flask application, which will make the Bambulab RFID tags obsolete. Is working flawless since weeks.
Sounds amazing. I'll be following this pretty closely.
I coded this flask application, which will make the Bambulab RFID tags obsolete.
That sounds really cool! Is the following valid from your opinion to recognize custom filaments with the AMS?
Equipment
Work Flow
Is that right or is something missing? Thanks in advance for your help.
I coded this flask application, which will make the Bambulab RFID tags obsolete.
That sounds really cool! Is the following valid from your opinion to recognize custom filaments with the AMS?
Equipment
- Proxmark 3 easy RFID Reader
- compatible 13.56MHz RFID chip as described in this issue
- Any computer running your flask app
Work Flow
- Set new custom filament in Bambu Studio, generating a unique ID for it
- Have RFID reader connected to computer running flask app
- Flask app connects to Bambu Lab printer via API and MQTT
- Scan RFID chip via flask app
- App retrieves filament list with newly generated custom filament data
- App connects RFID chip data with new custom filament ID and writes back to Bambu Lab printer
- Stick RFID chip to custom filament spool
- Printer will recognize the spool from now on with all data
Is that right or is something missing? Thanks in advance for your help.
No, it's much easier. Right now i'm using a barcode reader, the module for reading RFID chips is not yet implemented. Since only the unique Filament ID and color is read from the QR-code or from the RFID tag (when implemented), you don't need a Proxmark3 and you can use any RFID tag. At the QR-code or the RFID tag (when implemented) is only the UUID and the color-code stored, everything else is configured in your Bambu Studio filament profiles.
Work Flow: prepare a filament spool:
print with this filament:
This is absolutely amazing, you rock! 🤩 Have to try that asap. Will the RFID option utilize the onboard reader of the AMS to recognize inserted spools?
Dumping the mqtt messages I've identified an internal code that is used for filaments
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