diff --git a/src/api.cpp b/src/api.cpp index 152c013..5daf09c 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -211,7 +211,7 @@ void filamanApiTask(void* pvParameters) { } filamanApiState = API_IDLE; } - vTaskDelay(pdMS_TO_TICKS(1000)); + vTaskDelay(pdMS_TO_TICKS(100)); } } diff --git a/src/main.cpp b/src/main.cpp index fb30194..db8400a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -212,7 +212,7 @@ void loop() { lastWeight = weight; // Wenn ein Tag erkannt wurde und das Gewicht stabil ist, an FilaMan senden - if (weightCounterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false) + if (weightCounterToApi > 1 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false) { tagProcessed = true; diff --git a/src/nfc.cpp b/src/nfc.cpp index b97c18e..c30b4dc 100644 --- a/src/nfc.cpp +++ b/src/nfc.cpp @@ -2099,13 +2099,12 @@ void scanRfidTask(void * parameter) { // Add a pause after successful reading to prevent immediate re-reading if (nfcReaderState == NFC_READ_SUCCESS) { - Serial.println("Tag erfolgreich gelesen - warte 3 Sekunden vor nächstem Scan"); - vTaskDelay(pdMS_TO_TICKS(3000)); - // Reduced from 5 seconds to 3 seconds + // After tag is processed, slow down scanning to give API time + Serial.println("Tag processed - slowing scan to 2 seconds"); + vTaskDelay(pdMS_TO_TICKS(2000)); } else { // Faster scanning when no tag or idle state - vTaskDelay(pdMS_TO_TICKS(250)); - // Faster scan interval + vTaskDelay(pdMS_TO_TICKS(500)); } // aktualisieren der Website wenn sich der Status ändert