Skip to content

Add support for bambu tags#8

Open
spuder wants to merge 41 commits intomainfrom
bambu-rfid
Open

Add support for bambu tags#8
spuder wants to merge 41 commits intomainfrom
bambu-rfid

Conversation

@spuder
Copy link
Owner

@spuder spuder commented Dec 8, 2024

This PR implements the ability to read bambu tags on openspool hardware

Example from the logs of success

[22:03:54][I][main:057]: Connecting to Bambu printer
[22:04:44][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:09:55][D][pn532:364]: Mifare classic
[22:09:55][D][bambu:069]: Key 0: 63e5af2c1d75
[22:09:55][D][bambu:069]: Key 1: 40d146ce6e01
[22:09:55][D][bambu:069]: Key 2: 6a66957dcc91
[22:09:55][D][bambu:069]: Key 3: 15e7041f68d9
[22:09:55][D][bambu:069]: Key 4: 7ee1ac7fa75f
[22:09:55][D][bambu:069]: Key 5: 55cbbad18673
[22:09:55][D][bambu:069]: Key 6: ce5901af9416
[22:09:55][D][bambu:069]: Key 7: a223a193e6a3
[22:09:55][D][bambu:069]: Key 8: 24f4d022f402
[22:09:55][D][bambu:069]: Key 9: 7df999dd836b
[22:09:55][D][bambu:069]: Key 10: b0dac4a48903
[22:09:55][D][bambu:069]: Key 11: b026ab566f11
[22:09:55][D][bambu:069]: Key 12: 8b495d5a0b44
[22:09:55][D][bambu:069]: Key 13: 7ebef1cb3e94
[22:09:55][D][bambu:069]: Key 14: 4685790c6e01
[22:09:55][D][bambu:069]: Key 15: 3f00144c7b4a
[22:09:56][V][pn532.mifare_classic:097]: Creating tag with raw data
[22:09:56][V][NFC:047]: Checking tag for raw data
[22:09:56][V][NFC:049]: Tag has raw data flag set
[22:09:56][D][NFC:053]: Raw data: 50.4C.41.20.42.61.73.69.63.00.00.00.00.00.00.00.FF.6A.13.FF.FA.00.00.00.00.00.E0.3F.00.00.00.00.37.00.08.00.00.00.00.00.E6.00.BE.00.00.00.00.00.00.00.00.00.00.00.87.87.87.69.00.00.00.00.00.00.88.13.10.0E.E8.03.E8.03.9A.99.19.3F.CD.CC.4C.3E.4D.E7.F7.5A.11.F7.47.D6.A4.95.8C.B4.2C.A1.87.65.00.00.00.00.E1.19.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.87.87.87.69.00.00.00.00.00.00.32.30.32.34.5F.30.37.5F.30.34.5F.31.30.5F.34.33.32.34.5F.30.37.5F.30.34.5F.31.30.00.00.00.00.00.
[22:09:56][D][bambu:161]: Parsing tag data
[22:09:56][V][bambu:172]: UID: 504c4120
[22:09:56][V][bambu:175]: Material Variant: ff6a13fffa000000
[22:09:56][V][bambu:176]: Unique Material Type: 0000e03f00000000
[22:09:56][V][bambu:181]: Filament Type Ascii: 7
[22:09:56][V][bambu:184]: Detailed Filament Type: 8813100ee803e8039a99193fcdcc4c3e
[22:09:56][V][bambu:221]: Block 4 Data: 8813100ee803e8039a99193fcdcc4c3e
[22:09:56][V][bambu:187]: Color Code: 4de7f75a
[22:09:56][V][bambu:189]: Spool Weight: 11f7
[22:09:56][V][bambu:190]: Filament Diameter: a4958cb4
[22:09:56][V][bambu:221]: Block 5 Data: 4de7f75a11f747d6a4958cb42ca18765
[22:09:56][V][bambu:193]: Temperatures: 00000000e1190000
[22:09:56][V][bambu:194]: Drying Info: 0000000000000000
[22:09:56][V][bambu:221]: Block 6 Data: 00000000e11900000000000000000000
[22:09:56][V][bambu:197]: X Cam Info: 323032345f30375f
[22:09:56][V][bambu:198]: Nozzle Diameter: 30345f31305f3433
[22:09:56][V][bambu:221]: Block 8 Data: 323032345f30375f30345f31305f3433
[22:09:56][V][bambu:201]: Tray UID: 32345f30375f30345f31300000000000
[22:09:56][V][bambu:221]: Block 9 Data: 32345f30375f30345f31300000000000
[22:09:56][V][bambu:204]: Spool Width: 00000000520000000000000000000000
[22:09:56][V][bambu:221]: Block 10 Data: 00000000520000000000000000000000
[22:09:56][V][bambu:207]: Production Date/Time: 02000100000000000000000000000000
[22:09:56][V][bambu:221]: Block 12 Data: 02000100000000000000000000000000
[22:09:56][V][bambu:210]: Short Production Date/Time: 00000000000000000000000000000000
[22:09:56][V][bambu:221]: Block 13 Data: 00000000000000000000000000000000
[22:09:56][V][bambu:213]: Filament Length: 00000000000000000000000000000000
[22:09:56][V][bambu:221]: Block 14 Data: 00000000000000000000000000000000
[22:09:56][I][NFC:105]: Tag found without NDEF message
[22:09:56][D][pn532:200]: Found new tag '5A-C9-00-A6'
[22:09:56][D][pn532:381]: Waiting to read next tag

Known issues (feedback/ideas appreciated)

  • read_mifare_classic_tag_ breaks reading Mifare Classic tags with NDEF messages, (should be fixable)
  • Memory Leak causes stack overflow after reading multiple tags.
  • Filament Type Ascii is logging incorrect ascii values
  • Currently only supports color and type mappings
    struct FilamentInfo {
        std::string color_code;
        std::string type;
    };
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant