From a04cc371902248944402abce1e290d0afb8329a6 Mon Sep 17 00:00:00 2001 From: ManuelW77 Date: Sun, 20 Sep 2026 13:44:05 +0200 Subject: [PATCH 1/2] docs: update platformio.ini for version v3.4.9 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 8ea8388..d24c044 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "3.4.8" +version = "3.4.9" to_old_version = "3.4.0" [env:esp32dev] From 3662422c1c956d10f59254608e4b37678ff28278 Mon Sep 17 00:00:00 2001 From: anderl1969 Date: Wed, 30 Sep 2026 16:23:45 +0200 Subject: [PATCH 2/2] style: fix indentation in main loop --- src/main.cpp | 74 ++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e6dd013..68dbef6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -234,51 +234,51 @@ void loop() { weightSend = 0; } - lastWeight = weight; + lastWeight = weight; - // Wenn ein Tag erkannt wurde und das Gewicht stabil ist (4+ seconds), an FilaMan senden - if (!scanRequestActive && weightCounterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false) - { - tagProcessed = true; + // Wenn ein Tag erkannt wurde und das Gewicht stabil ist (4+ seconds), an FilaMan senden + if (!scanRequestActive && weightCounterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false) + { + tagProcessed = true; - // Check if it's a Bambu tag - if so, send only UUID without spoolId - if (isBambuTag) { - sendWeightAsync(0, activeTagUuid, weight); - Serial.println("Bambu weight queued for FilaMan (UUID only)"); - } else { - // Normal NTAG: send spoolId + UUID - int sId = activeSpoolId.toInt(); - sendWeightAsync(sId, activeTagUuid, weight); - Serial.println("Weight queued for FilaMan"); - } - weightSend = 1; - - // Feedback to user - oledShowProgressBar(3, 4, tr(STR_SPOOL_TAG), tr(STR_SENDING)); - oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000); - } - - // Handle successful tag write - if (!scanRequestActive && nfcReaderState == NFC_WRITE_SUCCESS && tagProcessed == false) - { - tagProcessed = true; - - // Only send weight if a valid spoolId exists (spool tag, not location tag) - if (activeSpoolId.length() > 0 && activeSpoolId != "0") { - int sId = activeSpoolId.toInt(); - sendWeightAsync(sId, activeTagUuid, weight); + // Check if it's a Bambu tag - if so, send only UUID without spoolId + if (isBambuTag) { + sendWeightAsync(0, activeTagUuid, weight); + Serial.println("Bambu weight queued for FilaMan (UUID only)"); + } else { + // Normal NTAG: send spoolId + UUID + int sId = activeSpoolId.toInt(); + sendWeightAsync(sId, activeTagUuid, weight); + Serial.println("Weight queued for FilaMan"); + } weightSend = 1; - Serial.println("Weight queued for FilaMan after spool tag write"); // Feedback to user - oledShowProgressBar(3, 4, tr(STR_TAG_WRITTEN), tr(STR_SENDING)); + oledShowProgressBar(3, 4, tr(STR_SPOOL_TAG), tr(STR_SENDING)); oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000); - } else { - // Location tag written - no weight to send - Serial.println("Location tag written successfully - no weight send needed"); + } + + // Handle successful tag write + if (!scanRequestActive && nfcReaderState == NFC_WRITE_SUCCESS && tagProcessed == false) + { + tagProcessed = true; + + // Only send weight if a valid spoolId exists (spool tag, not location tag) + if (activeSpoolId.length() > 0 && activeSpoolId != "0") { + int sId = activeSpoolId.toInt(); + sendWeightAsync(sId, activeTagUuid, weight); + weightSend = 1; + Serial.println("Weight queued for FilaMan after spool tag write"); + + // Feedback to user + oledShowProgressBar(3, 4, tr(STR_TAG_WRITTEN), tr(STR_SENDING)); + oledSetPriority(DISPLAY_PRIORITY_ACTION, 2000); + } else { + // Location tag written - no weight to send + Serial.println("Location tag written successfully - no weight send needed"); + } } } } - } esp_task_wdt_reset(); }