Hello,
I’ve started a small program allowing to receive & decode Bambu Lab X1C events sent through MQTT (also working with latest firmwares / the ones with TLS activated).
For now, there is only one feature allowing to build a continuous list / summary of what is printed, openable under EXCEL (or anything else), in order to track what you have printed, when, and how many minutes / hours have been taken for each print. Extra features could be added in the future (i would like also to track the amount of filament being consumed, if possible).
I would be interested to have a few beta testers :
- To validate that this program is working for other peoples than me
- To see if you are encountering some MQTT events that i’ve not detected yet in my usage (these messages would be printed in logs as “unknown event”, if this is ever happening)
- And of course to give me any feedback regarding that tooling, in case you would have some ideas for extra features to be implemented.
Example of the continuously generated CSV content :
(the CSV can be edited / altered anytime)
Binaries are there : https://github.com/SR-G/bambu-lab-observer/releases/download/1.0.0-SNAPSHOT/bambu-lab-observer-1.0.0-SNAPSHOT.zip
It is working on any platform (linux, windows, macos, and i386/amd64) (however only tested on my side on linux) :
(docker image is ready but not published yet)
Documentation is rather trivial, one just has to configure the JSON configuration file (for example to be hosted in the same folder than the binary - as the examples included in the .ZIP distribution) :
(“BambuLabsIP” field is mandatory - and this should work with several printers, and also is (for recent firmware) the “MQTTPassword” field - all other fields are optional (and are explained in the (draft) documentation here : GitHub - SR-G/bambu-lab-observer: Bambu Lab observer, receiving events from Bambu Lab printers and building a .CSV file listing all printed timings)
Example of logs at runtime :
2023-02-06 20:10:28 INFO configuration.go:43 Will use configuration file provided through --config parameter, path is [../resources/configuration/bambu-lab-observer.json]
2023-02-06 20:10:28 INFO configuration.go:65 Configuration file found under [../resources/configuration/bambu-lab-observer.json], now reading content
2023-02-06 20:10:28 INFO bambu-lab-observer.go:100 Application [bambu-lab-observer], version [1.0.0-SNAPSHOT], built on [2023-02-06T13:55:44Z]
2023-02-06 20:10:28 INFO bambu-lab-observer.go:101 Configured policy about detecting beginning of prints [FIRST_MESSAGE_TIMESTAMP]
2023-02-06 20:10:28 INFO bambu-lab-observer.go:69 Starting events processor
2023-02-06 20:10:28 INFO bambu-lab-observer.go:75 Starting MQTT receiver
2023-02-06 20:10:28 INFO events_processor.go:205 Starting events processor
2023-02-06 20:10:28 INFO events_processor.go:209 Dump of all events avativated - to be dumped inside folder [../resources/events/campaigns/2023-02-06/]
2023-02-06 20:10:28 INFO mqtt_connector.go:61 Starting MQTTConnector on broker [tcp://192.168.8.130:1883], with clientId [bambu-lab-observer-192.168.8.130-XSxupcexAanpTPOJ]
2023-02-06 20:10:28 INFO mqtt_connector.go:78 Trying to connect on [tcp://192.168.8.130:1883], retry interval [0] sec
2023-02-06 20:10:28 INFO mqtt_connector.go:96 MQTTConnector connected to the broker [tcp://192.168.8.130:1883]
2023-02-06 20:10:28 INFO mqtt_connector.go:104 About to (re-)subscribe to all configured subscription topics
2023-02-06 20:10:28 INFO mqtt_connector.go:108 Now subscribing to topic [device/+/report]
2023-02-06 20:10:28 WARNING events_processor.go:66 Discarded content #1 (IDLE) (and next events) : {Command:push_status GCodeStartTime:0 GCodeState:IDLE MCPercent:0 MCRemainingTime:0 MCPrintStage:1 PrintName: PrintErrorCode:0 SequenceID:2021}
2023-02-06 20:10:52 WARNING events_processor.go:69 Discarded content #2 (PREPARE) : {Command:push_status GCodeStartTime:0 GCodeState:PREPARE MCPercent:0 MCRemainingTime:0 MCPrintStage:1 PrintName:sharpening-angle-gauge_plate_1 PrintErrorCode:0 SequenceID:2021}
2023-02-06 20:10:53 INFO events_processor.go:233 Status [START DETECTED] (0%), model [sharpening-angle-gauge_plate_1] from printer [00M00A261900054] (print duration : 0 seconds)
2023-02-06 20:11:57 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (1%), model [sharpening-angle-gauge_plate_1] from printer [00M00A261900054] (print duration : 1 minute 4 seconds) (remaining : 30 minutes)
2023-02-06 20:13:36 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (16%), model [sharpening-angle-gauge_plate_1] from printer [00M00A261900054] (print duration : 2 minutes 43 seconds) (remaining : 25 minutes)
2023-02-06 20:14:16 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (17%), model [sharpening-angle-gauge_plate_1] from printer [00M00A261900054] (print duration : 3 minutes 23 seconds) (remaining : 25 minutes)
2023-02-06 20:18:13 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (18%), model [sharpening-angle-gauge_plate_1] from printer [00M00A261900054] (print duration : 7 minutes 20 seconds) (remaining : 25 minutes)
(...)
2023-02-06 21:57:54 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (98%), model [sharpening-angle-gauge_plate_2] from printer [00M00A261900054] (print duration : 48 minutes 32 seconds) (remaining : 0 seconds)
2023-02-06 21:58:23 INFO events_processor.go:241 Status [PRINT IN PROGRESS] (99%), model [sharpening-angle-gauge_plate_2] from printer [00M00A261900054] (print duration : 49 minutes 1 second) (remaining : 0 seconds)
2023-02-06 21:59:14 INFO events_processor.go:235 Status [END DETECTED] (100%), model [sharpening-angle-gauge_plate_2] from printer [00M00A261900054] (print duration : 49 minutes 52 seconds)
2023-02-06 21:59:14 INFO events_processor.go:57 Removed entry for source IP [192.168.8.130], number of remaining entries [0]
For now it’s only a command line version (easy to be launched anywhere, like a NAS, or somewhere in a docker image, whatever).
It’s a first quick draft (in GOLANG) and works fine on my side - feel free to give me any feedbacks if you see some usage (or forecasted usage) for that kind of tooling.