PN532 nfc tag emulation issue

Hey guys, I am trying to get NFC tag emulation working but have no success so far, so I am asking for help :) My setup: I have Arduino Uno and to it I have a PN532 board connected over SPI. I can write and read tags using example code with no problem, but when I try to emulate a tag and send a NDEF message to a android device (device is scanning for a tag using NXP tag reader app and have tried bunch of other apps), nothing happens. For some reason looks like it is just no doing anything, the serial monitor just says it is sending a message and the correct message length.

The example code I am using is this: https://github.com/Seeed-Studio/PN532/blob/master/PN532/examples/emulate_tag_ndef/emulate_tag_ndef.ino

Am I getting something wrong? As I understand it should be possible to PN532 module to act as a tag and send ndef messages to the phone.

X/Y explanation: All I want to do is send a string (32 symbols) from Arduino to a mobile app, that will do some stuff with this string.

Any help, guidance would be greatly appreciated.

If you still need some info about it, please see my issue: https://github.com/Seeed-Studio/PN532/issues/88

It works, you just need to modify a little bit the library so it will send the right data to the PN532 and it will emulate your NFC Tag.

There are some bugs in the PN532 library and many bugs in the NDEF library... But they works if you can set update the library with the uncommited codes.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :)

Adrianotiger: If you still need some info about it, please see my issue: https://github.com/Seeed-Studio/PN532/issues/88

It works, you just need to modify a little bit the library so it will send the right data to the PN532 and it will emulate your NFC Tag.

There are some bugs in the PN532 library and many bugs in the NDEF library... But they works if you can set update the library with the uncommited codes.

I read the github issue, but I did not get it how we should change the library. Do you know what I should do? Thank you.

darwin_neutron: I read the github issue, but I did not get it how we should change the library. Do you know what I should do? Thank you.

I updated the library for my project, to test it. But there are many reasons if you can't read the tag. Maybe your module is not powered correctly. Or the antenna is weak.

If you just put the right Felica-Ids, you should be able to read it with the NXP-app.

If you just want a single Tag, you can also use the NDEF library. If you want more than 1 Tag, you have to commit manually the changes made by others.

Adrianotiger i read your post on https://github.com/Seeed-Studio/PN532/issues/88 and also try to use your code which sets the first 2 bytes to the correct values 0x01, 0xFE, namely i modify my installed seeedstudio library (emulatingtag.cpp) to below. However, strangely, when i did so, i can't read the PN532 with NXP TagInfo reader app of the NFC Tools reader. if i don't change the library, i get the screenshot you show on https://github.com/Seeed-Studio/PN532/issues/88

uint8_t command[] = {
      PN532_COMMAND_TGINITASTARGET,
      0x05,                  // MODE: 0x04 = PICC only, 0x01 = Passive only (0x02 = DEP only)

      // MIFARE PARAMS
      0x04, 0x00,         // SENS_RES (seeeds studio set it to 0x04, nxp to 0x08)
      0x00, 0x00, 0x00,   // NFCID1t (is set over sketch with setUID())
      0x20,               // SEL_RES    (0x20=Mifare DelFire, 0x60=custom)

      // FELICA PARAMS
      0x01, 0xFE,         // NFCID2t (8 bytes) https://github.com/adafruit/Adafruit-PN532/blob/master/Adafruit_PN532.cpp FeliCa NEEDS TO BEGIN WITH 0x01 0xFE!
      0x05, 0x01, 0x86,
      0x04, 0x02, 0x02,
      0x03, 0x00,         // PAD (8 bytes)
      0x4B, 0x02, 0x4F, 
      0x49, 0x8A, 0x00,   
      0xFF, 0xFF,         // System code (2 bytes)
      
      0x01, 0x01, 0x66,   // NFCID3t (10 bytes)
      0x6D, 0x01, 0x01, 0x10,
      0x02, 0x00, 0x00,

  0x00, // length of general bytes
      0x00  // length of historical bytes
 }