RFID fertig, empfangen geht name wird angezeigt
This commit is contained in:
@@ -145,6 +145,7 @@ ws.onmessage = (event) => {
|
|||||||
const name1Element = document.getElementById("name1");
|
const name1Element = document.getElementById("name1");
|
||||||
const name2Element = document.getElementById("name2");
|
const name2Element = document.getElementById("name2");
|
||||||
|
|
||||||
|
|
||||||
if (name1 && name1.trim() !== "") {
|
if (name1 && name1.trim() !== "") {
|
||||||
name1Element.textContent = name1;
|
name1Element.textContent = name1;
|
||||||
name1Element.style.display = "block";
|
name1Element.style.display = "block";
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
#include <PicoMQTT.h>
|
#include <PicoMQTT.h>
|
||||||
|
|
||||||
#include <statusled.h>
|
#include "statusled.h"
|
||||||
#include "timesync.h"
|
#include "timesync.h"
|
||||||
#include "buttonassigh.h"
|
#include "buttonassigh.h"
|
||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
#include <debug.h>
|
#include "debug.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <databasebackend.h>
|
#include "databasebackend.h"
|
||||||
#include <webserverrouter.h>
|
#include "webserverrouter.h"
|
||||||
|
|
||||||
struct TimestampData {
|
struct TimestampData {
|
||||||
uint64_t lastMessageTimestamp; // Timestamp from the device
|
uint64_t lastMessageTimestamp; // Timestamp from the device
|
||||||
|
|||||||
@@ -96,6 +96,18 @@ void checkAutoReset() {
|
|||||||
timerData.endTime1 = 0;
|
timerData.endTime1 = 0;
|
||||||
timerData.finishedSince1 = 0;
|
timerData.finishedSince1 = 0;
|
||||||
timerData.isReady1 = true; // Zurücksetzen auf "Bereit"
|
timerData.isReady1 = true; // Zurücksetzen auf "Bereit"
|
||||||
|
|
||||||
|
JsonDocument messageDoc;
|
||||||
|
messageDoc["firstname"] ="";
|
||||||
|
messageDoc["lastname"] = "";
|
||||||
|
messageDoc["lane"] = "start1"; // Add lane information
|
||||||
|
|
||||||
|
String message;
|
||||||
|
serializeJson(messageDoc, message);
|
||||||
|
|
||||||
|
// Push the message to the frontend
|
||||||
|
pushUpdateToFrontend(message);
|
||||||
|
|
||||||
Serial.println("Bahn 1 automatisch auf 'Bereit' zurückgesetzt");
|
Serial.println("Bahn 1 automatisch auf 'Bereit' zurückgesetzt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,6 +118,19 @@ void checkAutoReset() {
|
|||||||
timerData.endTime2 = 0;
|
timerData.endTime2 = 0;
|
||||||
timerData.finishedSince2 = 0;
|
timerData.finishedSince2 = 0;
|
||||||
timerData.isReady2 = true; // Zurücksetzen auf "Bereit"
|
timerData.isReady2 = true; // Zurücksetzen auf "Bereit"
|
||||||
|
|
||||||
|
JsonDocument messageDoc;
|
||||||
|
messageDoc["firstname"] = "";
|
||||||
|
messageDoc["lastname"] = "";
|
||||||
|
messageDoc["lane"] = "start2"; // Add lane information
|
||||||
|
|
||||||
|
String message;
|
||||||
|
serializeJson(messageDoc, message);
|
||||||
|
|
||||||
|
// Push the message to the frontend
|
||||||
|
pushUpdateToFrontend(message);
|
||||||
|
|
||||||
|
|
||||||
Serial.println("Bahn 2 automatisch auf 'Bereit' zurückgesetzt");
|
Serial.println("Bahn 2 automatisch auf 'Bereit' zurückgesetzt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/rfid.h
10
src/rfid.h
@@ -32,9 +32,6 @@ void setupRFID() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void handleAutomaticRFID() {
|
void handleAutomaticRFID() {
|
||||||
if (!mfrc522.PICC_IsNewCardPresent()) {
|
if (!mfrc522.PICC_IsNewCardPresent()) {
|
||||||
return;
|
return;
|
||||||
@@ -236,16 +233,9 @@ server.on("/api/users/insert", HTTP_POST, [](AsyncWebServerRequest *request) {},
|
|||||||
request->send(200, "application/json", jsonString);
|
request->send(200, "application/json", jsonString);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// API Funktion: RFID Reader Status prüfen
|
// API Funktion: RFID Reader Status prüfen
|
||||||
bool checkRFIDReaderStatus() {
|
bool checkRFIDReaderStatus() {
|
||||||
byte version = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
|
byte version = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const char* passwordAP = nullptr;
|
|||||||
char* ssidSTA = strdup("Obiwlankenobi");
|
char* ssidSTA = strdup("Obiwlankenobi");
|
||||||
char* passwordSTA = strdup("Delfine1!");
|
char* passwordSTA = strdup("Delfine1!");
|
||||||
|
|
||||||
PrettyOTA OTAUpdates;
|
PrettyOTA OTAUpdates;
|
||||||
|
|
||||||
String getUniqueSSID();
|
String getUniqueSSID();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user