Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---
Expand Down
10 changes: 5 additions & 5 deletions docs/firmware/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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": [
Expand Down
Binary file modified docs/firmware/openspool-esp32s2.factory.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/firmware/openspool-esp32s2.factory.bin.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ff62443682a1aa96da63465ece35f693
da98b83714098dae8d01d4c407659c99
Binary file modified docs/firmware/openspool-esp32s2.ota.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/firmware/openspool-esp32s2.ota.bin.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7fb01acd9baa67eaded2ad43b291416e
c655020654c1f8896785503b2ee867a5
Binary file modified docs/firmware/openspool-esp32s3.factory.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/firmware/openspool-esp32s3.factory.bin.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ddf258822a514fc62d5c0caa3278e96
fc68ec9ebd2e39d18106da3f181c61f1
Binary file modified docs/firmware/openspool-esp32s3.ota.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/firmware/openspool-esp32s3.ota.bin.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ce2e7bda63b8f1dc7147363c7da5bd6f
5e39e32f026390e7095ca37ab5de19bd
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<div class="install-container">
<script type="module" src="https://unpkg.com/esp-web-tools@8.0.6/dist/web/install-button.js"></script>
Expand Down
18 changes: 15 additions & 3 deletions firmware/bambu.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace bambulabs

// Special cases for brand-specific codes
const std::unordered_map<std::string, std::unordered_map<std::string, std::string>> 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"}}},
Expand All @@ -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 = "")
Expand All @@ -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")
Expand All @@ -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);
}

Expand Down
71 changes: 65 additions & 6 deletions firmware/conf.d/automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ script:
StaticJsonDocument<256> doc;
JsonObject root = doc.to<JsonObject>();

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);
Expand Down Expand Up @@ -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") {
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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") {
Expand All @@ -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") {
Expand All @@ -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") {
Expand Down
11 changes: 7 additions & 4 deletions firmware/conf.d/filament.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions firmware/conf.d/pn532_rfid-solo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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");
2 changes: 1 addition & 1 deletion firmware/conf.d/version.yaml
Original file line number Diff line number Diff line change
@@ -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"