Aetrius / Bambulabs-Exporter

BambuLabs Prometheus Exporter by Aetrius
GNU General Public License v3.0
45 stars 5 forks source link

Reverse Engineering MQTT Messages and Adding Support for the P1P #15

Open Matthew-Beckett opened 1 year ago

Matthew-Beckett commented 1 year ago

Hey,

I was wondering if you could shed some light on how you managed to define the struct for the X1C as I would like to do something similar and expand support to both printers.

I intend to create a new struct similar to the existing X1C struct and then allow users to pass a .env property to set which printer model they have (or maybe we can figure it out from serial number).

Aetrius commented 1 year ago

Yeah, when it comes to the data for building object models it's super simple.

You can export the data using MQTT Exporter, which will spit out a JSON string. You can take a JSON string and use a conversion tool online with like JSON -> GOLANG STRUCT.

I doubt the X1C is much different, but if you get me a sample json/struct I could help you with it.