This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

OOB pairing via NFC

Hi, I want to OOB pair two equal devices (pca10040 + NFC shield) via NFC. Since its not clear which of the two devices will act as NFC initiator (active) or tag (passive), I think I need to use P2P NFC mode.

I planned using the adafruit NFC shield and the related library for this purpose, but the Infocenter does not explicitly say that P2P is supported by the library. So I assume P2P is not supported.

So i would like to know whether P2P is the only way to achieve my goal?

Further ideas where:

  1. set up the passive NFC tags on each pca10040 and let these poll by the opposite NFC shield. aka "using two antennas"
  2. "Custom role switching" of the PN532 (the NFC shield IC) between initiator and target .. dont think i will manage this

Feel free to correct me and giving advises, i am at the very beginning in this topic

Thanks!

  • Hi.

    According to NXP PN532 the chipset indeed supports "NFC Peer to peer" communication (see chapter 7.5.5 of User manual). However I wouldn't go that way. If you will have always only two boards then simply assign ISO14443 PCD role ("reader" = active device) to one and ISO14443 PICC ("card" or "tag" if you want = passive device) to another. If you have more devices in the ecosystem then use rotating roles where each of them polls for "tags" as PCD (typically 80-90% of time) and in the rest it listens as PICC to nearby readers. Then first time they both appear in right PCD-PICC combination the transaction is processed. It has one advantage that such device will be compatible with other PICC ("tag") only devices such as bare nRF52. But indeed you might settle down to the mode explained in NXP manual because of simplicity...

    Cheers!

  • Thanks for your answer! yes, it is planned that more devices of the described type can be paired with each other (but just in BLE connection mode, no broadcasting etc). I like the way you proposed, I understand it as follows:

    1.) setting up the pn532 as PCD (reader) with the adafruitlib, as this is a covered functionality (working example from nordic..)

    2.) For the PICC setup there would be two ways right? I could choose the nrf52832 integrated NFC-tag or implementing a cardemulation aka configure the pn532 as tag (possible according to the datasheet). The latter should be possible with the adafruitlib functions like adafruit_pn532_command_write() and so on, right?

    3.) Im not sure about the rotating roles.. Should this be done randomly in fixed time intervals? I think it could happen that two polling devices meet up each other and never get to the point where they hit the right PCD-PICC combination. Do you have any information on the timing behavior/duration of the polling events, "resting-in-tag-mode" etc? since the devices should pair within "the time of a touch" ;)

  • Yes, first two points are in-line with my understanding. The third one is indeed the biggest weakness and hard to solve it here on the paper. Some devices are switching roles in 90:10ms, some are having cycles as long as 1s. You will need to experiment and hope that your (for NFC fairly stupid) requirement of transaction within time of the touch is achievable...

Related