From 15d51f3a0cd8ff1b9249354134b796924ad190d2 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 14 Jun 2024 20:54:09 -0700 Subject: [PATCH 1/7] Add data about block 16 --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25edfd8..6256472 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ We are currently working on a way to submit the tag data in a secure way so anal * [Block 12](#block-12) * [Block 13](#block-13) * [Block 14](#block-14) + * [Block 16](#block-16) * [Compatible RFID tags - By generation](#compatible-rfid-tags----by-generation) @@ -274,7 +275,7 @@ Summary of what kind of data is stored in each block. Detailed info for each blo | 3 | 1 | [Block 13](#block-13) **Unknown** | | 3 | 2 | [Block 14](#block-14) **Unknown** | | 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | -| 4 | 0 | **Empty** | +| 4 | 0 | [Block 16](#block-16) Second Color Code, **Unknown** | | 4 | 1 | **Empty** | | 4 | 2 | **Empty** | | 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | @@ -375,7 +376,7 @@ Example Data: | position | length | type | Description | | -------- | ------ | ----------- | -------------------------------------------- | -| 0 (AA) | 4 | RGBA | Color in hex RBGA | +| 0 (AA) | 4 | RGBA | Color in hex RGBA | | 4 (BB) | 2 | uint16 (LE) | Spool Weight in grams (`E8 03` --> 1000 g) | | 8 (CC) | 8 | float (LE) | Filament Diameter in milimeters | @@ -448,6 +449,16 @@ Example Data: | -------- | ------ | ----------- | --------------------------------- | | 4 (AA) | 2 | uint16 (LE) | **Filament length in meters...?** | +### Block 16 + +Example Data: +`AA AA AA AA BB BB BB BB __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | ---------------------------------- | +| 0 (AA) | 4 | **Unknown** | **Unknown** | +| 4 (BB) | 4 | RGBA | Second color in _reverse_ hex ABGR | + ## Compatible RFID tags - By generation Gen 1 --> **Not compatible**(due to AMS checking if tag is unlockable with command 0x40) From 7a4a57b0aae7ae7cea8fdb1e9a8694068c354374 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 14 Jun 2024 21:03:56 -0700 Subject: [PATCH 2/7] Update parsing script to handle a second color --- parse.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parse.py b/parse.py index 9ffbc9f..47fb7f4 100644 --- a/parse.py +++ b/parse.py @@ -118,9 +118,12 @@ class Tag(): "production_date": bytes_to_date(self.blocks[12]), "unknown": bytes_to_string(self.blocks[13]), # Appears to be some sort of date -- on some tags, this is identical to the production date, but not always - } + # Check for a second color + if self.blocks[16][4]: + self.data["filament_color"] += " / #" + bytes_to_hex(self.blocks[16][4:8][::-1]) + def __str__(self, blocks_to_output = IMPORTANT_BLOCKS): result = "" From 3073f81c9f5c4c9003e93604ea0b649fc99a3d4b Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 14 Jun 2024 21:11:52 -0700 Subject: [PATCH 3/7] Add Color Count --- README.md | 7 ++++--- parse.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6256472..ce72079 100644 --- a/README.md +++ b/README.md @@ -452,12 +452,13 @@ Example Data: ### Block 16 Example Data: -`AA AA AA AA BB BB BB BB __ __ __ __ __ __ __ __` +`AA AA BB BB CC CC CC CC __ __ __ __ __ __ __ __` | position | length | type | Description | | -------- | ------ | ----------- | ---------------------------------- | -| 0 (AA) | 4 | **Unknown** | **Unknown** | -| 4 (BB) | 4 | RGBA | Second color in _reverse_ hex ABGR | +| 0 (AA) | 2 | **Unknown** | **Unknown** | +| 2 (BB) | 2 | uint16 (LE) | **Color Count...?** | +| 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | ## Compatible RFID tags - By generation diff --git a/parse.py b/parse.py index 47fb7f4..adddf9c 100644 --- a/parse.py +++ b/parse.py @@ -97,6 +97,7 @@ class Tag(): "uid": bytes_to_hex(self.blocks[0][0:4]), "filament_type": bytes_to_string(self.blocks[2]), "detailed_filament_type": bytes_to_string(self.blocks[4]), + "filament_color_count": bytes_to_int(self.blocks[16][2:4]), "filament_color": "#" + bytes_to_hex(self.blocks[5][0:4]), "spool_weight": Unit(bytes_to_int(self.blocks[5][4:6]), "g"), "filament_length": Unit(bytes_to_int(self.blocks[14][4:6]), "m"), @@ -121,7 +122,7 @@ class Tag(): } # Check for a second color - if self.blocks[16][4]: + if self.data["filament_color_count"] == 2: self.data["filament_color"] += " / #" + bytes_to_hex(self.blocks[16][4:8][::-1]) def __str__(self, blocks_to_output = IMPORTANT_BLOCKS): From c5ae72178967f5049e45cb39cd4560d8c7c726fb Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 14 Jun 2024 21:12:13 -0700 Subject: [PATCH 4/7] Add additional unknown values to parse script --- parse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse.py b/parse.py index adddf9c..ec44d57 100644 --- a/parse.py +++ b/parse.py @@ -118,7 +118,9 @@ class Tag(): "tray_uid": self.blocks[9], "production_date": bytes_to_date(self.blocks[12]), - "unknown": bytes_to_string(self.blocks[13]), # Appears to be some sort of date -- on some tags, this is identical to the production date, but not always + "unknown_1": bytes_to_string(self.blocks[13]), # Appears to be some sort of date -- on some tags, this is identical to the production date, but not always + "unknown_2": self.blocks[16][0:2], # So far, always "0200" + "unknown_3": self.blocks[17][0:2], # Only been "0100" on the PLA Silk Dual Color, "0000" otherwise } # Check for a second color From 4b9c718a26e2498d00c40f62f8763ec6d40100dc Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 14 Jun 2024 21:12:55 -0700 Subject: [PATCH 5/7] Add data about block 17 --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce72079..08ce968 100644 --- a/README.md +++ b/README.md @@ -275,8 +275,8 @@ Summary of what kind of data is stored in each block. Detailed info for each blo | 3 | 1 | [Block 13](#block-13) **Unknown** | | 3 | 2 | [Block 14](#block-14) **Unknown** | | 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | -| 4 | 0 | [Block 16](#block-16) Second Color Code, **Unknown** | -| 4 | 1 | **Empty** | +| 4 | 0 | [Block 16](#block-16) Color Count, Second Color Code, **Unknown** | +| 4 | 1 | [Block 17](#block-17) **Unknown** | | 4 | 2 | **Empty** | | 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | | 5 | 0 | **Empty** | @@ -460,6 +460,15 @@ Example Data: | 2 (BB) | 2 | uint16 (LE) | **Color Count...?** | | 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | +### Block 17 + +Example Data: +`AA AA __ __ __ __ __ __ __ __ __ __ __ __ __ __` + +| position | length | type | Description | +| -------- | ------ | ----------- | ---------------------------------- | +| 0 (AA) | 2 | **Unknown** | **Unknown** | + ## Compatible RFID tags - By generation Gen 1 --> **Not compatible**(due to AMS checking if tag is unlockable with command 0x40) From b0d990317b55aa02e1dd48994975eaced85f7230 Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 1 Nov 2024 09:38:46 -0700 Subject: [PATCH 6/7] Update info based on @pelrun's response --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08ce968..fc45d64 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ Summary of what kind of data is stored in each block. Detailed info for each blo | 3 | 1 | [Block 13](#block-13) **Unknown** | | 3 | 2 | [Block 14](#block-14) **Unknown** | | 3 | 3 | [Block 15](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | -| 4 | 0 | [Block 16](#block-16) Color Count, Second Color Code, **Unknown** | +| 4 | 0 | [Block 16](#block-16) Extra Color Info | | 4 | 1 | [Block 17](#block-17) **Unknown** | | 4 | 2 | **Empty** | | 4 | 3 | [Block 19](#mifare-encryption-keys) MIFARE encryption keys, Unrelated to BambuLab | @@ -456,10 +456,14 @@ Example Data: | position | length | type | Description | | -------- | ------ | ----------- | ---------------------------------- | -| 0 (AA) | 2 | **Unknown** | **Unknown** | -| 2 (BB) | 2 | uint16 (LE) | **Color Count...?** | +| 0 (AA) | 2 | uint16 (LE) | Format Identifier | +| 2 (BB) | 2 | uint16 (LE) | Color Count | | 4 (CC) | 4 | RGBA | Second color in _reverse_ hex ABGR | +Known Format Identifiers: +- 00 00 = Empty +- 02 00 = Color Info + ### Block 17 Example Data: From 1403baaab410ecdcbd25373a97736626604601df Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" Date: Fri, 1 Nov 2024 09:42:04 -0700 Subject: [PATCH 7/7] Update parse script to handle block 16 better --- parse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parse.py b/parse.py index ec44d57..746cdec 100644 --- a/parse.py +++ b/parse.py @@ -93,11 +93,13 @@ class Tag(): print(f"Warning! Block {bi} is blank!") # Parse the data + has_extra_color_info = self.blocks[16][0:2] == b'\x02\x00' + self.data = { "uid": bytes_to_hex(self.blocks[0][0:4]), "filament_type": bytes_to_string(self.blocks[2]), "detailed_filament_type": bytes_to_string(self.blocks[4]), - "filament_color_count": bytes_to_int(self.blocks[16][2:4]), + "filament_color_count": bytes_to_int(self.blocks[16][2:4]) if has_extra_color_info else 1, "filament_color": "#" + bytes_to_hex(self.blocks[5][0:4]), "spool_weight": Unit(bytes_to_int(self.blocks[5][4:6]), "g"), "filament_length": Unit(bytes_to_int(self.blocks[14][4:6]), "m"), @@ -119,8 +121,7 @@ class Tag(): "production_date": bytes_to_date(self.blocks[12]), "unknown_1": bytes_to_string(self.blocks[13]), # Appears to be some sort of date -- on some tags, this is identical to the production date, but not always - "unknown_2": self.blocks[16][0:2], # So far, always "0200" - "unknown_3": self.blocks[17][0:2], # Only been "0100" on the PLA Silk Dual Color, "0000" otherwise + "unknown_2": self.blocks[17][0:2], # Only been "0100" on the PLA Silk Dual Color, "0000" otherwise } # Check for a second color