diff --git a/README.md b/README.md index f5e07eb..724be70 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # OpenSpool **Your filament wants to be free** -![](https://img.shields.io/badge/openspool-1.19.1-magenta) +![](https://img.shields.io/badge/openspool-1.20.0-magenta) [![Discord](https://img.shields.io/discord/1298381115706576907?logo=discord)](https://discord.gg/4EaXHu9CEj) [![Reddit](https://img.shields.io/badge/reddit-join-orange?logo=reddit)](https://www.reddit.com/r/openspool) --- diff --git a/docs/firmware/manifest.json b/docs/firmware/manifest.json index 69876b6..442ad6f 100644 --- a/docs/firmware/manifest.json +++ b/docs/firmware/manifest.json @@ -1,13 +1,13 @@ { "name": "OpenSpool", - "version": "1.19.1", + "version": "1.20.0", "builds": [ { "chipFamily": "ESP32-S2", "ota": { "path": "openspool-esp32s2.ota.bin", - "md5": "7fb01acd9baa67eaded2ad43b291416e", - "summary": "Pin esphome version", + "md5": "c655020654c1f8896785503b2ee867a5", + "summary": "Merge pull request #58 from raihei/main%0A%0AFixed Sunlu filaments and created LED feedback for write tag finished", "release_url": "https://openspool.io/firmware" }, "parts": [ @@ -21,8 +21,8 @@ "chipFamily": "ESP32-S3", "ota": { "path": "openspool-esp32s3.ota.bin", - "md5": "ce2e7bda63b8f1dc7147363c7da5bd6f", - "summary": "Pin esphome version", + "md5": "5e39e32f026390e7095ca37ab5de19bd", + "summary": "Merge pull request #58 from raihei/main%0A%0AFixed Sunlu filaments and created LED feedback for write tag finished", "release_url": "https://openspool.io/firmware" }, "parts": [ diff --git a/docs/firmware/openspool-esp32s2.factory.bin b/docs/firmware/openspool-esp32s2.factory.bin index a587bf2..1bdc6a7 100644 Binary files a/docs/firmware/openspool-esp32s2.factory.bin and b/docs/firmware/openspool-esp32s2.factory.bin differ diff --git a/docs/firmware/openspool-esp32s2.factory.bin.md5 b/docs/firmware/openspool-esp32s2.factory.bin.md5 index 99c17d3..6874710 100644 --- a/docs/firmware/openspool-esp32s2.factory.bin.md5 +++ b/docs/firmware/openspool-esp32s2.factory.bin.md5 @@ -1 +1 @@ -ff62443682a1aa96da63465ece35f693 +da98b83714098dae8d01d4c407659c99 diff --git a/docs/firmware/openspool-esp32s2.ota.bin b/docs/firmware/openspool-esp32s2.ota.bin index 70b396b..b0f9873 100644 Binary files a/docs/firmware/openspool-esp32s2.ota.bin and b/docs/firmware/openspool-esp32s2.ota.bin differ diff --git a/docs/firmware/openspool-esp32s2.ota.bin.md5 b/docs/firmware/openspool-esp32s2.ota.bin.md5 index 79bb87a..5e71fbd 100644 --- a/docs/firmware/openspool-esp32s2.ota.bin.md5 +++ b/docs/firmware/openspool-esp32s2.ota.bin.md5 @@ -1 +1 @@ -7fb01acd9baa67eaded2ad43b291416e +c655020654c1f8896785503b2ee867a5 diff --git a/docs/firmware/openspool-esp32s3.factory.bin b/docs/firmware/openspool-esp32s3.factory.bin index f825580..d90c7aa 100644 Binary files a/docs/firmware/openspool-esp32s3.factory.bin and b/docs/firmware/openspool-esp32s3.factory.bin differ diff --git a/docs/firmware/openspool-esp32s3.factory.bin.md5 b/docs/firmware/openspool-esp32s3.factory.bin.md5 index 58efb9f..9ead76b 100644 --- a/docs/firmware/openspool-esp32s3.factory.bin.md5 +++ b/docs/firmware/openspool-esp32s3.factory.bin.md5 @@ -1 +1 @@ -2ddf258822a514fc62d5c0caa3278e96 +fc68ec9ebd2e39d18106da3f181c61f1 diff --git a/docs/firmware/openspool-esp32s3.ota.bin b/docs/firmware/openspool-esp32s3.ota.bin index f7e5403..503f8a6 100644 Binary files a/docs/firmware/openspool-esp32s3.ota.bin and b/docs/firmware/openspool-esp32s3.ota.bin differ diff --git a/docs/firmware/openspool-esp32s3.ota.bin.md5 b/docs/firmware/openspool-esp32s3.ota.bin.md5 index 2b11b5f..636f0d2 100644 --- a/docs/firmware/openspool-esp32s3.ota.bin.md5 +++ b/docs/firmware/openspool-esp32s3.ota.bin.md5 @@ -1 +1 @@ -ce2e7bda63b8f1dc7147363c7da5bd6f +5e39e32f026390e7095ca37ab5de19bd diff --git a/docs/index.md b/docs/index.md index 3555b38..9365e9a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ nav_order: 1 # 📟 OpenSpool Firmware Installation -![](https://img.shields.io/badge/openspool-1.19.1-magenta) +![](https://img.shields.io/badge/openspool-1.20.0-magenta)
diff --git a/firmware/bambu.h b/firmware/bambu.h index 58041ad..3ea4087 100644 --- a/firmware/bambu.h +++ b/firmware/bambu.h @@ -40,7 +40,7 @@ namespace bambulabs // Special cases for brand-specific codes const std::unordered_map> brand_specific_codes = { - {"PLA", {{"Bambu", "GFA00"}, {"PolyTerra", "GFL01"}, {"PolyLite", "GFL00"}, {"Sunlu", "SNL02"}}}, + {"PLA", {{"Bambu", "GFA00"}, {"PolyTerra", "GFL01"}, {"PolyLite", "GFL00"}, {"Sunlu", "GFSNL03"}}}, {"PLA Aero", {{"Bambu", "GFG01"}}}, {"TPU", {{"Bambu", "GFU01"}}}, {"ABS", {{"Bambu", "GFB00"}, {"PolyLite", "GFB60"}}}, @@ -50,7 +50,7 @@ namespace bambulabs {"PET-CF", {{"Bambu", "GFT00"}}}, {"PETG HF", {{"Bambu", "GFG02"}}}, {"PETG Translucent", {{"Bambu", "GFG01"}}}, - {"PETG", {{"Bambu", "GFG00"}, {"PolyLite", "GFG60"}, {"Sunlu", "SNL08"}}}}; + {"PETG", {{"Bambu", "GFG00"}, {"PolyLite", "GFG60"}, {"Sunlu", "GFSNL08"}}}}; // Function with two parameters inline std::string get_bambu_code(const std::string &type, const std::string &brand = "") @@ -76,7 +76,7 @@ namespace bambulabs return ""; // Unknown type } - // Function with three parameters (for Bambu PLA subtypes) + // Function with three parameters (for Bambu & Sunlu PLA subtypes) inline std::string get_bambu_code(const std::string &type, const std::string &brand, const std::string &subtype) { if (type == "PLA" && brand == "Bambu") @@ -89,6 +89,18 @@ namespace bambulabs return "GFA03"; return "GFA00"; // Default to Basic for unknown subtypes } + else if (type == "PLA" && brand == "Sunlu") + { + if (subtype == "Matte") + return "GFSNL02"; + if (subtype == "Silk") + return "GFSNL05"; + if (subtype == "Marble") + return "GFSNL06"; + if (subtype == "Wood") + return "GFSNL06"; + return "GFSNL03"; // Default to Basic for unknown subtypes + } return get_bambu_code(type, brand); } diff --git a/firmware/conf.d/automation.yaml b/firmware/conf.d/automation.yaml index 1f124dd..d402469 100644 --- a/firmware/conf.d/automation.yaml +++ b/firmware/conf.d/automation.yaml @@ -10,18 +10,18 @@ script: StaticJsonDocument<256> doc; JsonObject root = doc.to(); - root["protocol"] = "openspool"; root["version"] = "1.0"; - root["brand"] = id(filament_brand).state.c_str(); + root["protocol"] = "openspool"; if (id(filament_include_alpha).state == true){ root["color_hex"] = id(filament_color_hexaa).state.c_str(); } else{ root["color_hex"] = id(filament_color_hex).state.c_str(); } + root["type"] = id(filament_type).state.c_str(); root["min_temp"] = id(filament_min_temp).state; root["max_temp"] = id(filament_max_temp).state; - root["type"] = id(filament_type).state.c_str(); + root["brand"] = id(filament_brand).state.c_str(); std::string output; serializeJsonPretty(doc, output); @@ -141,6 +141,27 @@ script: } else if (id(filament_brand).state == "PolyLite") { id(filament_brand_code).publish_state("GFL00"); id(filament_sub_brand).publish_state("PolyLite PLA"); + } else if (id(filament_brand).state == "Sunlu") { + // Check for Sunlu PLA variants + if (id(filament_variant).state == "Basic") { + id(filament_brand_code).publish_state("GFSNL03"); + id(filament_sub_brand).publish_state("PLA Basic"); + } else if (id(filament_variant).state == "Marble") { + id(filament_brand_code).publish_state("GFSNL06"); + id(filament_sub_brand).publish_state("PLA Marble"); + } else if (id(filament_variant).state == "Matte") { + id(filament_brand_code).publish_state("GFSNL02"); + id(filament_sub_brand).publish_state("PLA Matte"); + } else if (id(filament_variant).state == "Silk") { + id(filament_brand_code).publish_state("GFSNL05"); + id(filament_sub_brand).publish_state("PLA Silk"); + } else if (id(filament_variant).state == "Wood") { + id(filament_brand_code).publish_state("GFSNL07"); + id(filament_sub_brand).publish_state("PLA Wood"); + } else { // Default to Basic if no variant specified + id(filament_brand_code).publish_state("GFSNL03"); + id(filament_sub_brand).publish_state("PLA Basic"); + } } else if (id(filament_brand).state == "Bambu") { // Check for Bambu PLA variants if (id(filament_variant).state == "Basic") { @@ -164,12 +185,20 @@ script: id(filament_sub_brand).publish_state("PLA"); } } + // PLA High Speed + else if (id(filament_type).state == "PLA High Speed") { + // Generic + id(filament_brand_code).publish_state("GFL95"); + id(filament_sub_brand).publish_state("PLA High Speed"); + } // PETG else if (id(filament_type).state == "PETG") { if (id(filament_brand).state == "Overture") { // TODO: find overture PETG brand code id(filament_brand_code).publish_state("GFG99"); // Using generic for now id(filament_sub_brand).publish_state("PETG"); + } else if (id(filament_brand).state == "Sunlu") { + id(filament_brand_code).publish_state("GFSNL08"); } else { // Generic id(filament_brand_code).publish_state("GFG99"); id(filament_sub_brand).publish_state("PETG"); @@ -280,10 +309,32 @@ script: id(filament_max_temp).publish_state(250); } } - else if (id(filament_type).state == "PLA") { + else if (id(filament_type).state == "PLA" || id(filament_type).state == "PLA High Speed") { if (id(filament_brand).state == "Generic") { id(filament_min_temp).publish_state(190); id(filament_max_temp).publish_state(240); + } else if (id(filament_brand).state == "Sunlu") { + if (id(filament_variant).state == "Basic"){ + id(filament_min_temp).publish_state(190); + id(filament_max_temp).publish_state(240); + } else if (id(filament_variant).state == "Matte"){ + id(filament_min_temp).publish_state(205); + id(filament_max_temp).publish_state(245); + } else if (id(filament_variant).state == "Marble"){ + id(filament_min_temp).publish_state(190); + id(filament_max_temp).publish_state(260); + } else if (id(filament_variant).state == "Silk"){ + id(filament_min_temp).publish_state(190); + id(filament_max_temp).publish_state(240); + } else if (id(filament_variant).state == "Wood"){ + id(filament_min_temp).publish_state(195); + id(filament_max_temp).publish_state(260); + } else { + ESP_LOGW("main", "Unknown temperatures for Variant: %s", id(filament_variant).state.c_str()); + id(filament_min_temp).publish_state(190); + id(filament_max_temp).publish_state(240); + } + } else { ESP_LOGW("main", "Unknown temperatures for PLA: %s", id(filament_brand).state.c_str()); id(filament_min_temp).publish_state(190); @@ -302,9 +353,12 @@ script: } else if (id(filament_type).state == "ASA") { if (id(filament_brand).state == "Generic") { - //TODO: find temps for ASA + id(filament_min_temp).publish_state(240); + id(filament_max_temp).publish_state(280); } else { ESP_LOGW("main", "Unknown temperatures for ASA: %s", id(filament_brand).state.c_str()); + id(filament_min_temp).publish_state(240); + id(filament_max_temp).publish_state(280); } } else if (id(filament_type).state == "ABS") { @@ -313,6 +367,8 @@ script: id(filament_max_temp).publish_state(280); } else { ESP_LOGW("main", "Unknown temperatures for ABS: %s", id(filament_brand).state.c_str()); + id(filament_min_temp).publish_state(240); + id(filament_max_temp).publish_state(280); } } else if (id(filament_type).state == "PVA") { @@ -337,9 +393,12 @@ script: } else if (id(filament_type).state == "PC") { if (id(filament_brand).state == "Generic") { - //TODO: find temps for PC + id(filament_min_temp).publish_state(260); + id(filament_max_temp).publish_state(290); } else { ESP_LOGW("main", "Unknown temperatures for PC: %s", id(filament_brand).state.c_str()); + id(filament_min_temp).publish_state(260); + id(filament_max_temp).publish_state(290); } } else if (id(filament_type).state == "PA") { diff --git a/firmware/conf.d/filament.yaml b/firmware/conf.d/filament.yaml index 3a6d03b..e8b6d30 100644 --- a/firmware/conf.d/filament.yaml +++ b/firmware/conf.d/filament.yaml @@ -54,12 +54,15 @@ select: sorting_group_id: sorting_group_filament_settings sorting_weight: 40 options: - - Basic + - Basic + - Impact + - Marble - Matte - Metal - - Impact - - G - - W + - Silk + - Wood + #- Support G -> Create own filament type? Theoretically not needed at all, because only available from Bambu + #- Support W -> Create own filament type? Theoretically not needed at all, because only available from Bambu # TODO: add the rest of the options on_value: then: diff --git a/firmware/conf.d/pn532_rfid-solo.yaml b/firmware/conf.d/pn532_rfid-solo.yaml index 4a11a4a..5a99403 100644 --- a/firmware/conf.d/pn532_rfid-solo.yaml +++ b/firmware/conf.d/pn532_rfid-solo.yaml @@ -311,6 +311,8 @@ button: tag: "rfid" format: "Finished writing tag" level: INFO + - lambda: |- + id(set_led_green).execute(0); else: - lambda: |- ESP_LOGI("rfid", "NFC Tag not present"); diff --git a/firmware/conf.d/version.yaml b/firmware/conf.d/version.yaml index fdad592..6a7f8a2 100644 --- a/firmware/conf.d/version.yaml +++ b/firmware/conf.d/version.yaml @@ -1,4 +1,4 @@ --- # Do not modify, github actions will update the number on each new release substitutions: - version: "1.19.1" + version: "1.20.0"