GrovePi+ NFC tag reader v1.1 odesn't read anything...

Applications/questions using Raspberry Pi with Seeed products, please post it here.

Moderators: violet, jessie, yexiaobo

Post Reply
thmaurel
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Mon Mar 21, 2016 10:01 pm

GrovePi+ NFC tag reader v1.1 odesn't read anything...

Post by thmaurel » Mon Mar 21, 2016 10:17 pm

Hello everybody,
I use the GrovePi+ with a Raspi 2, without problems for all the elements but the NFC tag reader..
I test it on the grovepi serial port without success.

The NFC element is revision 1.1, I found in the comments about it in the seedstudio site (http://www.seeedstudio.com/depot/Grove-NFC-p-1804.html ) that we need to cut 3 wires and set 3 others (basically p1-i2c, p2-scl p3-sca) to use the element with i2c port.
First, I try only set the p1-i2c wire, without success too.

Actually, the element have p1-i2c, p2-scl and p3-sca connect, and the 3 other ones are cut.
With i2cdetect, the element is at address 0x04, I use it instead of 0x53 from the github. If i use 0x53, there is an IO error...

My test code is :

Code: Select all

import time,sys
import RPi.GPIO as GPIO
import smbus

NFC_ADDR = 0x04

# use the bus that matches your raspi version
rev = GPIO.RPI_REVISION
if rev == 2 or rev == 3:
    bus = smbus.SMBus(1)
else:
    bus = smbus.SMBus(0)
    
# read data from the NFC tag EEPROM (length bytes)
def readNFCData(addr,length):
    bus.write_byte_data(NFC_ADDR,addr>>8,addr&0xff)
    result=[]
    for c in range(length):
        result.append(bus.read_byte(NFC_ADDR))
    return result

addr=0x00
while True:

    bus.write_byte_data(NFC_ADDR,addr>>8,addr&0xff)
    result=[]
    for c in range(16):
        result.append(bus.read_byte(NFC_ADDR))
    print str(addr) + ' : '
    print result
    addr += 0x10
    time.sleep (0.5)

If i change the addr with increments of 16, the result is always [0,0,0...0,0] and an error occurs at the end.
I tested that with two differents Mifare-One RFID Tag (3.56 MHz) and my french CB card which contains a NFC tag.

Is there an error in the test code ? Or is the element completely bugged ?
Thanks in advance for all informations..
Regards
Thierry

thmaurel
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Mon Mar 21, 2016 10:01 pm

Re: GrovePi+ NFC tag reader v1.1 odesn't read anything...

Post by thmaurel » Mon Mar 21, 2016 11:03 pm

After some other tests, it appears that the GrovePi NFC is not detected. If I unplug all elements and try 'sudo i2cdetect -y 1', the result contains always 0x04 and no other values.
Shutdown, adding the NFC element and restart doesn't change anything in the result of i2cdetect...
So the adress 0x53 should be valid, but my element is not recognized.

Any hint ?
Regards

kavi
Staff
Staff
Posts: 305
Joined: Tue Dec 09, 2014 12:06 pm

Re: GrovePi+ NFC tag reader v1.1 odesn't read anything...

Post by kavi » Tue Mar 22, 2016 1:36 pm

Hi,

Could you please try the demo code in the following link and let us know the results

https://github.com/DexterInd/GrovePi/bl ... nfc_tag.py

Thanks and Regards

thmaurel
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Mon Mar 21, 2016 10:01 pm

Re: GrovePi+ NFC tag reader v1.1 odesn't read anything...

Post by thmaurel » Tue Mar 22, 2016 11:23 pm

Hello Kavi,
As I said, the NFC element is not recognized at the address 0x53...
The sudo i2cdetect -y 1 is :

pi@raspberrypi ~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3e --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi ~ $


If I try the sample, the result is :

Traceback (most recent call last):
File "/home/pi/git/GrovePi/Projects/HacktivDays/test_nfc_forum.py", line 31, in <module>
print (readNFCData(0,16)) # read some data from address 0
File "/home/pi/git/GrovePi/Projects/HacktivDays/test_nfc_forum.py", line 16, in readNFCData
bus.write_byte_data(NFC_ADDR,addr>>8,addr&0xff)
IOError: [Errno 5] Input/output error
>>>

Regards
Thierry

thmaurel
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Mon Mar 21, 2016 10:01 pm

Re: GrovePi+ NFC tag reader v1.1 odesn't read anything...

Post by thmaurel » Tue Mar 22, 2016 11:28 pm

For information, my NFC element is at the I2C-1 port.
Thierry

Post Reply