From cd71949c8288e7e930e35a2a6ac21ce02bee1e77 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Mon, 10 Mar 2025 17:33:47 +0100 Subject: [PATCH 01/22] refactor length calculation to convert total length to meters before formatting --- html/spoolman.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/spoolman.js b/html/spoolman.js index cbc9c67..b0ffe66 100644 --- a/html/spoolman.js +++ b/html/spoolman.js @@ -86,10 +86,10 @@ function populateVendorDropdown(data, selectedSmId = null) { }); // Nach der Schleife: Formatierung der Gesamtlänge - console.log("Total Length: ", totalLength); - const formattedLength = totalLength > 1000 - ? (totalLength / 1000).toFixed(2) + " km" - : totalLength.toFixed(2) + " m"; + const lengthInM = totalLength / 1000; // erst in m umrechnen + const formattedLength = lengthInM > 1000 + ? (lengthInM / 1000).toFixed(2) + " km" + : lengthInM.toFixed(2) + " m"; // Formatierung des Gesamtgewichts (von g zu kg zu t) const weightInKg = totalWeight / 1000; // erst in kg umrechnen From cdb2d16cf9b958eec7a6f1906f3bc3df8c21ed60 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Mon, 10 Mar 2025 17:34:09 +0100 Subject: [PATCH 02/22] docs: update platformio.ini for version v1.4.1 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index d77087e..ff73ec0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.4.0" +version = "1.4.1" to_old_version = "1.4.0" ## From 4559bae066e9ebc1b327c175473e48fd8e29b6c3 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Mon, 10 Mar 2025 17:34:09 +0100 Subject: [PATCH 03/22] docs: update changelog and header for version v1.4.1 --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b495c74..242c3ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,55 @@ # Changelog +## [1.4.1] - 2025-03-10 +### Added +- added new .step, now with correct individual parts +- added changelog +- Add files via upload +- added .stp files of modifications +- added merged picture +- added pictures of components bought from AliE +- Add files via upload +- added pictures for heat insert location +- added pictures showing heat insert location +- remove unnecessary delay in MQTT setup and add delay before restart +- add new 3D print file for Filaman scale +- added Discord Server + +### Changed +- update platformio.ini for version v1.4.1 +- refactor length calculation to convert total length to meters before formatting +- Merge pull request #16 from spitzbirne32/main +- improved housing to show display better +- removed CAD, as they were all duplicates +- typo in AliE link +- Delete usermod/spitzbirne32/STL/README.md +- Update README.md +- moved pictures of parts into dedicated folders +- Update README.md +- Update README.md +- Update README.md +- Delete usermod/spitzbirne32/STL/ScaleTop_Heatinsert_Location_usermod_spitzbirne32_.png +- Delete usermod/spitzbirne32/STL/Housing_Heatinsert_Location_usermod_spitzbirne32_.png +- created folders +- Update README.md +- Update README.md +- Create README.md +- Update README.md +- Update README.md +- Create README.md +- Merge pull request #15 from ManuelW77/main +- Merge pull request #14 from janecker/scale-calibration-rework +- Reworks the scale calibration handling +- remove redundant scale calibration checks and enhance task management +- enhance AMS data handling and streamline spool auto-setting logic +- adjust stack size and improve scale calibration logic +- update labels and input types for better clarity and functionality +- update documentation for clarity and accuracy + +### Fixed +- correct typo in console log for total length + + ## [1.4.0] - 2025-03-01 ### Added - add support for Spoolman Octoprint Plugin in README files From 94c26590c8a022a8e0cf547546356bf44e6ceec8 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Mon, 10 Mar 2025 17:41:14 +0100 Subject: [PATCH 04/22] remove commented-out subscription topic in MQTT setup --- src/bambu.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index 9b9a67b..3cce9e3 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -623,7 +623,6 @@ bool setupMqtt() { { client.setCallback(mqtt_callback); client.setBufferSize(5120); - // Optional: Topic abonnieren client.subscribe(report_topic.c_str()); //client.subscribe(request_topic.c_str()); Serial.println("MQTT-Client initialisiert"); From 24d91693d9f36836ddf3f97be2f3c82302d3296d Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 15 Mar 2025 15:57:46 +0100 Subject: [PATCH 05/22] update Discord Link --- README.de.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.de.md b/README.de.md index 1dacfa4..be3dbe5 100644 --- a/README.de.md +++ b/README.de.md @@ -9,7 +9,7 @@ Das System integriert sich nahtlos mit der [Spoolman](https://github.com/Donkie/ Weitere Bilder finden Sie im [img Ordner](/img/) oder auf meiner Website: [FilaMan Website](https://www.filaman.app) Deutsches Erklärvideo: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU) -Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/vMAx2gf5) +Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/WbsYwzdW) ### Es gibt jetzt auch ein Wiki, dort sind nochmal alle Funktionen beschrieben: [Wiki](https://github.com/ManuelW77/Filaman/wiki) diff --git a/README.md b/README.md index 1c97400..344c0b7 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The system integrates seamlessly with [Bambulab](https://bambulab.com/en-us) 3D More Images can be found in the [img Folder](/img/) or my website: [FilaMan Website](https://www.filaman.app) german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU) -Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/vMAx2gf5) +Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/WbsYwzdW) ### Now more detailed informations about the usage: [Wiki](https://github.com/ManuelW77/Filaman/wiki) From 3eac0e5ac435562eefe0f6f7fda6d6ee4f249ae5 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 15 Mar 2025 16:02:18 +0100 Subject: [PATCH 06/22] update Discord Link --- README.de.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.de.md b/README.de.md index be3dbe5..eb81f18 100644 --- a/README.de.md +++ b/README.de.md @@ -9,7 +9,7 @@ Das System integriert sich nahtlos mit der [Spoolman](https://github.com/Donkie/ Weitere Bilder finden Sie im [img Ordner](/img/) oder auf meiner Website: [FilaMan Website](https://www.filaman.app) Deutsches Erklärvideo: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU) -Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/WbsYwzdW) +Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) ### Es gibt jetzt auch ein Wiki, dort sind nochmal alle Funktionen beschrieben: [Wiki](https://github.com/ManuelW77/Filaman/wiki) diff --git a/README.md b/README.md index 344c0b7..0415795 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The system integrates seamlessly with [Bambulab](https://bambulab.com/en-us) 3D More Images can be found in the [img Folder](/img/) or my website: [FilaMan Website](https://www.filaman.app) german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaOHU) -Discord Server: [https://discord.gg/vMAx2gf5](https://discord.gg/WbsYwzdW) +Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v) ### Now more detailed informations about the usage: [Wiki](https://github.com/ManuelW77/Filaman/wiki) From e4fe08f54caef80c03a0ee84553ef0c3a759f438 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 10:41:28 +0100 Subject: [PATCH 07/22] increase stack size for BambuMqtt task --- src/bambu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index 3cce9e3..29be378 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -634,7 +634,7 @@ bool setupMqtt() { xTaskCreatePinnedToCore( mqtt_loop, /* Function to implement the task */ "BambuMqtt", /* Name of the task */ - 8192, /* Stack size in words */ + 10240, /* Stack size in words */ NULL, /* Task input parameter */ mqttTaskPrio, /* Priority of the task */ &BambuMqttTask, /* Task handle. */ From a09fd4fda4d73bf4b4cd7f0d69c1fa3e4fb5d961 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:03:51 +0100 Subject: [PATCH 08/22] fix: add WiFi connection check and restart Bambu if not connected --- src/main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 84e45f1..157a0b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -92,12 +92,19 @@ void loop() { unsigned long currentMillis = millis(); // Überprüfe regelmäßig die WLAN-Verbindung - if (intervalElapsed(currentMillis, lastWifiCheckTime, wifiCheckInterval)) { + if (intervalElapsed(currentMillis, lastWifiCheckTime, wifiCheckInterval)) + { checkWiFiConnection(); } // Wenn Bambu auto set Spool aktiv - if (autoSendToBambu && autoSetToBambuSpoolId > 0) { + if (autoSendToBambu && autoSetToBambuSpoolId > 0) + { + if (!bambu_connected) + { + bambu_restart(); + } + if (intervalElapsed(currentMillis, lastAutoSetBambuAmsTime, autoSetBambuAmsInterval)) { if (hasReadRfidTag == 0) From b5279b167ad35ea3b3cfbfcda8d3647193e78500 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:03:57 +0100 Subject: [PATCH 09/22] fix: ensure valid URL format and remove trailing slash in setupWebserver --- src/website.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/website.cpp b/src/website.cpp index 9091d9e..2e01604 100644 --- a/src/website.cpp +++ b/src/website.cpp @@ -286,6 +286,14 @@ void setupWebserver(AsyncWebServer &server) { } String url = request->getParam("url")->value(); + if (url.indexOf("http://") == -1 && url.indexOf("https://") == -1) { + url = "http://" + url; + } + // Remove trailing slash if exists + if (url.length() > 0 && url.charAt(url.length()-1) == '/') { + url = url.substring(0, url.length()-1); + } + bool octoEnabled = (request->getParam("octoEnabled")->value() == "true") ? true : false; String octoUrl = request->getParam("octoUrl")->value(); String octoToken = (request->getParam("octoToken")->value() != "") ? request->getParam("octoToken")->value() : ""; @@ -300,7 +308,7 @@ void setupWebserver(AsyncWebServer &server) { request->send(200, "application/json", jsonResponse); }); - // Route für das Überprüfen der Spoolman-Instanz + // Route für das Überprüfen der Bambu-Instanz server.on("/api/bambu", HTTP_GET, [](AsyncWebServerRequest *request){ if (!request->hasParam("bambu_ip") || !request->hasParam("bambu_serialnr") || !request->hasParam("bambu_accesscode")) { request->send(400, "application/json", "{\"success\": false, \"error\": \"Missing parameter\"}"); From a818dcd3c0422208b649a5425873b475ec1d0b91 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:05:10 +0100 Subject: [PATCH 10/22] fix: increase WiFi connection timeout from 5 to 10 seconds --- src/wlan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan.cpp b/src/wlan.cpp index d7c1781..cbbba38 100644 --- a/src/wlan.cpp +++ b/src/wlan.cpp @@ -59,7 +59,7 @@ void initWiFi() { if(wm_nonblocking) wm.setConfigPortalBlocking(false); //wm.setConfigPortalTimeout(320); // Portal nach 5min schließen wm.setWiFiAutoReconnect(true); - wm.setConnectTimeout(5); + wm.setConnectTimeout(10); oledShowTopRow(); oledShowMessage("WiFi Setup"); From dd7ba3bf5d6024899d5106b3dcbdf23fe3168f48 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:15:38 +0100 Subject: [PATCH 11/22] fix: reload page after firmware update completion --- html/upgrade.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/upgrade.html b/html/upgrade.html index 8e66721..48c2b33 100644 --- a/html/upgrade.html +++ b/html/upgrade.html @@ -129,6 +129,7 @@ if (data.status === 'success' || lastReceivedProgress >= 98) { clearTimeout(wsReconnectTimer); setTimeout(() => { + window.location.reload(true); window.location.href = '/'; }, 30000); } @@ -148,6 +149,7 @@ status.style.display = 'block'; clearTimeout(wsReconnectTimer); setTimeout(() => { + window.location.reload(true); window.location.href = '/'; }, 30000); } else { From af23b07df1a5ab8a935f1c8d781a198a19dea09d Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:24:46 +0100 Subject: [PATCH 12/22] fix: use unique client ID for MQTT connection to avoid conflicts --- src/bambu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index 29be378..e6d9525 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -553,7 +553,8 @@ void reconnect() { oledShowTopRow(); // Attempt to connect - if (client.connect(bambu_serialnr, bambu_username, bambu_accesscode)) { + String clientId = String(bambu_serialnr) + "_" + String(random(0, 100)); + if (client.connect(clientId.c_str(), bambu_username, bambu_accesscode)) { Serial.println("MQTT re/connected"); client.subscribe(report_topic.c_str()); @@ -619,7 +620,8 @@ bool setupMqtt() { // Verbinden mit dem MQTT-Server bool connected = true; - if (client.connect(bambu_serialnr, bambu_username, bambu_accesscode)) + String clientId = String(bambu_serialnr) + "_" + String(random(0, 100)); + if (client.connect(clientId.c_str(), bambu_username, bambu_accesscode)) { client.setCallback(mqtt_callback); client.setBufferSize(5120); From 1702e2396ed9079fecffd574d40b5bcf896352c4 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:25:52 +0100 Subject: [PATCH 13/22] docs: update platformio.ini for version v1.4.2 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index ff73ec0..2303d47 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.4.1" +version = "1.4.2" to_old_version = "1.4.0" ## From d68f6c4a89fa70e0b7d985be642d64ceb5cec40b Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:25:52 +0100 Subject: [PATCH 14/22] docs: update changelog and header for version v1.4.2 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 242c3ae..c4a9ef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [1.4.2] - 2025-03-23 +### Added +- add WiFi connection check and restart Bambu if not connected + +### Changed +- update platformio.ini for version v1.4.2 +- increase stack size for BambuMqtt task +- update Discord Link +- update Discord Link +- remove commented-out subscription topic in MQTT setup + +### Fixed +- use unique client ID for MQTT connection to avoid conflicts +- reload page after firmware update completion +- increase WiFi connection timeout from 5 to 10 seconds +- ensure valid URL format and remove trailing slash in setupWebserver + + ## [1.4.1] - 2025-03-10 ### Added - added new .step, now with correct individual parts From a765b39896eea1278c23bd9cf3ae1efd23b4da4d Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:38:57 +0100 Subject: [PATCH 15/22] docs: update platformio.ini for version v1.4.3 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 2303d47..e86af06 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.4.2" +version = "1.4.3" to_old_version = "1.4.0" ## From 76e0b2039341a5d90d3862b7748114419b5c339c Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 11:38:57 +0100 Subject: [PATCH 16/22] docs: update changelog and header for version v1.4.3 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4a9ef2..92a4b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.4.3] - 2025-03-23 +### Changed +- update platformio.ini for version v1.4.3 + + ## [1.4.2] - 2025-03-23 ### Added - add WiFi connection check and restart Bambu if not connected From 48301ade3677b6e8f1908bd078884fd5d3938a8b Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 15:03:37 +0100 Subject: [PATCH 17/22] fix: adjust weight threshold for tare check to allow negative values --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 157a0b2..d9ead63 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -159,7 +159,7 @@ void loop() { lastWeightReadTime = currentMillis; // Prüfen ob die Waage korrekt genullt ist - if ((weight > 0 && weight < 5) || weight < 0) + if ((weight > 0 && weight < 5) || weight < -1) { if(scaleTareCounter < 5) { From eada54eff2d9605d85452c49b16a6fe4f1025e79 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 16:28:13 +0100 Subject: [PATCH 18/22] fix: add error handling for missing vendor IDs in filament data --- html/spoolman.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/html/spoolman.js b/html/spoolman.js index b0ffe66..5cc2f91 100644 --- a/html/spoolman.js +++ b/html/spoolman.js @@ -147,6 +147,13 @@ function updateFilamentDropdown(selectedSmId = null) { if (vendorId) { const filteredFilaments = spoolsData.filter(spool => { + if (!spool?.filament?.vendor?.id) { + console.log('Problem aufgetreten bei: ', spool?.filament?.vendor); + console.log('Problematische Spulen:', + spoolsData.filter(spool => !spool?.filament?.vendor?.id)); + return false; + } + const hasValidNfcId = spool.extra && spool.extra.nfc_id && spool.extra.nfc_id !== '""' && @@ -240,18 +247,6 @@ async function fetchSpoolData() { } } -/* -// Exportiere Funktionen -window.getSpoolData = () => spoolsData; -window.reloadSpoolData = initSpoolman; -window.populateVendorDropdown = populateVendorDropdown; -window.updateFilamentDropdown = updateFilamentDropdown; -window.toggleFilamentDropdown = () => { - const content = document.getElementById("filament-dropdown-content"); - content.classList.toggle("show"); -}; -*/ - // Event Listener document.addEventListener('DOMContentLoaded', () => { initSpoolman(); From 1069781931f5bd97630a3b6a7cd787f491f36789 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 16:50:29 +0100 Subject: [PATCH 19/22] docs: update platformio.ini for version v1.4.4 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index e86af06..5052653 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.4.3" +version = "1.4.4" to_old_version = "1.4.0" ## From 68cdd8ab40759400a5688c2b49a7e03ba3b37177 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 16:50:29 +0100 Subject: [PATCH 20/22] docs: update changelog and header for version v1.4.4 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92a4b7d..c5c9408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.4.4] - 2025-03-23 +### Added +- add error handling for missing vendor IDs in filament data + +### Changed +- update platformio.ini for version v1.4.4 + +### Fixed +- adjust weight threshold for tare check to allow negative values + + ## [1.4.3] - 2025-03-23 ### Changed - update platformio.ini for version v1.4.3 From 9dfe75ffa21e33f7cf62bf493ad2a0304b388135 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sun, 23 Mar 2025 18:01:53 +0100 Subject: [PATCH 21/22] refactor: rename report_topic to topic and update MQTT subscription logic, switched publish topic to request --- src/bambu.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index e6d9525..5ccb6cc 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -17,7 +17,7 @@ PubSubClient client(sslClient); TaskHandle_t BambuMqttTask; -String report_topic = ""; +String topic = ""; //String request_topic = ""; const char* bambu_username = "bblp"; const char* bambu_ip = nullptr; @@ -91,7 +91,7 @@ bool loadBambuCredentials() { bambu_accesscode = g_bambu_accesscode.c_str(); bambu_serialnr = g_bambu_serialnr.c_str(); - report_topic = "device/" + String(bambu_serialnr) + "/report"; + topic = "device/" + String(bambu_serialnr); //request_topic = "device/" + String(bambu_serialnr) + "/request"; return true; } @@ -199,7 +199,7 @@ FilamentResult findFilamentIdx(String brand, String type) { bool sendMqttMessage(const String& payload) { Serial.println("Sending MQTT message"); Serial.println(payload); - if (client.publish(report_topic.c_str(), payload.c_str())) + if (client.publish((String(topic) + "/request").c_str(), payload.c_str())) { return true; } @@ -557,7 +557,7 @@ void reconnect() { if (client.connect(clientId.c_str(), bambu_username, bambu_accesscode)) { Serial.println("MQTT re/connected"); - client.subscribe(report_topic.c_str()); + client.subscribe((String(topic) + "/report").c_str()); bambu_connected = true; oledShowTopRow(); } else { @@ -625,7 +625,7 @@ bool setupMqtt() { { client.setCallback(mqtt_callback); client.setBufferSize(5120); - client.subscribe(report_topic.c_str()); + client.subscribe((String(topic) + "/report").c_str()); //client.subscribe(request_topic.c_str()); Serial.println("MQTT-Client initialisiert"); From 65d8cd675ffaf6e9539ce42ac1f4ca37b4052a5f Mon Sep 17 00:00:00 2001 From: tugsi Date: Mon, 24 Mar 2025 12:17:28 +0100 Subject: [PATCH 22/22] Fix BufferSize for larger JSONs from X-Series --- src/bambu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index 5ccb6cc..4efdac9 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -624,7 +624,7 @@ bool setupMqtt() { if (client.connect(clientId.c_str(), bambu_username, bambu_accesscode)) { client.setCallback(mqtt_callback); - client.setBufferSize(5120); + client.setBufferSize(15488); client.subscribe((String(topic) + "/report").c_str()); //client.subscribe(request_topic.c_str()); Serial.println("MQTT-Client initialisiert");