I’m working with an ESP32 and a PN532 NFC tag reader, and I’ve successfully used the code
below to read NFC tags.
Now, I’d like to identify a phone (Android/iPhone) by placing it near the PN532. I’ve tried using the NFC Tool app to simulate writing text data to the card (and tried to send that data to pn532), but when I place the phone near the PN532, I don’t see any data being read by it.
Is there a way or any suggestions on how I can use a phone to get a serial ID or some data to the PN532 so i can identify that its my phone and do some task based on that
i need something like this video: https://youtu.be/_kW7hPiGi2o?t=27
i check his code (the one he added in youtube desciption rdiot-s192/basic_test.ino at master · rdiot/rdiot-s192 · GitHub ) but idk how the phone send the uid, my android phone send everytime different UID , and iphone is not sending anything
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532i2c);
void setup() {
nfc.begin();
nfc.setPassiveActivationRetries(0x02);
nfc.SAMConfig();
}
void loop() {
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
uint8_t uidLength;
if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength, 100)) {
String hexString = "";
for (int i = 0; i < uidLength; i++) {
hexString += String(uid[i] >> 4, HEX);
hexString += String(uid[i] & 0x0F, HEX);
}
Serial.print(hexString);
}
}