|
|
@ -10,7 +10,6 @@ NfcAdapter nfc = NfcAdapter(pn532_i2c);
|
|
|
|
String tagId = "None";
|
|
|
|
String tagId = "None";
|
|
|
|
String cleanString = "";
|
|
|
|
String cleanString = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Serial.begin(9600);
|
|
|
|
Serial.begin(9600);
|
|
|
@ -42,10 +41,11 @@ void initLoRa()
|
|
|
|
|
|
|
|
|
|
|
|
void sendLoRaData(String data)
|
|
|
|
void sendLoRaData(String data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String message = "node3 " + data; // Concatenate "node3 " with the value of cleanString
|
|
|
|
Serial.print("Sending LoRa data: ");
|
|
|
|
|
|
|
|
Serial.println(data);
|
|
|
|
|
|
|
|
|
|
|
|
LoRa.beginPacket();
|
|
|
|
LoRa.beginPacket();
|
|
|
|
LoRa.print(message);
|
|
|
|
LoRa.print("node3 " + data);
|
|
|
|
LoRa.endPacket();
|
|
|
|
LoRa.endPacket();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -75,15 +75,12 @@ void readNFC()
|
|
|
|
String payloadAsString = "";
|
|
|
|
String payloadAsString = "";
|
|
|
|
for (int c = 0; c < payloadLength; c++)
|
|
|
|
for (int c = 0; c < payloadLength; c++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
payloadAsString += (char)payload[c];
|
|
|
|
payloadAsString += String((char)payload[c]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (payloadLength > 0) {
|
|
|
|
|
|
|
|
cleanString = payloadAsString;
|
|
|
|
|
|
|
|
cleanString.remove(0, 3);
|
|
|
|
|
|
|
|
Serial.print("Payload: ");
|
|
|
|
|
|
|
|
Serial.println(cleanString);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanString = payloadAsString;
|
|
|
|
|
|
|
|
cleanString.remove(0, 3);
|
|
|
|
|
|
|
|
Serial.print("Payload: ");
|
|
|
|
|
|
|
|
Serial.println(cleanString);
|
|
|
|
|
|
|
|
|
|
|
|
String uid = record.getId();
|
|
|
|
String uid = record.getId();
|
|
|
|
if (uid != "")
|
|
|
|
if (uid != "")
|
|
|
|