Someone experience with Grove NFC?


#1

This is probably a very long shot, but is there anyone with experience with the RBLink and the Grove - NFC Tag?

If not, do you have experience with a different NFC reader that you used successfully with RedBear Duo? I just cannot get it work :frowning:

My setup:
The NFC sensor is I2C based and is connected it to I2C_2 on the RBLink

I modified the example to:
flag = nfcTag.readByte(EEPROM_I2C_LENGTH-1) == 0xff?true:false;
Serial1.println(flag);

The unexpected result is that flag always returns 1. It does not matter if there is a card present or not.

If I output other values, I get these results:

nfcTag.getICNumber() // OUTPUT: 255
nfcTag.getAFI() // OUTPUT: 255
nfcTag.GetRFU() // OUTPUT: 65535
nfcTag.getMemoryVolume () // OUTPUT: 16777215

I am using a MiFare Classic card but have also other NFC cards and all yield the same result.

Any hints as to what I am doing wrong is much appreciated! Thank you!

The full example code is:

#if defined(ARDUINO) 
SYSTEM_MODE(SEMI_AUTOMATIC); 
#endif

#include "NfcTag.h"
#include <Wire.h>

NfcTag nfcTag;
bool flag = false;
bool preFlag = false;

void setup() {
  // put your setup code here, to run once:
  Serial1.begin(115200);
  Serial1.println("starting sequence");
  nfcTag.init();
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial1.println("checking for nfc");
  //flag = nfcTag.readByte(EEPROM_I2C_LENGTH-1) == 0xff?true:false;
  //Serial1.println(flag);
  Serial1.println(nfcTag.getICNumber());
  Serial1.println(nfcTag.getAFI());
  Serial1.println(nfcTag.getRFU());
  Serial1.println(nfcTag.getMemoryVolume());
  Serial1.println("result:");
  Serial1.println(nfcTag.readByte(EEPROM_I2C_LENGTH-1));
  
  delay(2000);

}