User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

NFC Problem

Mon Jun 29, 2015 7:34 am

Hello everyone, I need some help. How can I use my nfc shield with raspberry pi ? my shield link below. I dont know which pins I must use, I must comunicate them with python. Please help, this is my homework :(

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: NFC Problem

Mon Jun 29, 2015 8:21 am

Hi and welcome to the forum.
Well for one thing you need to do your own homework, otherwise you will not learn anything ;)
Secondly you have not supplied the promised link to for the nfc shield................

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

Re: NFC Problem

Mon Jun 29, 2015 11:12 am

oh, I am sorry :) I forgot link, ok. I added. I am searching for a long time, but i didnt find anything about it, now I dont have a much time, i must comunicate raspberry pi and nfc shield, and I must make python script for take any nfc card's uid. shield link below

http://www.seeedstudio.com/wiki/NFC_Shield_V2.0

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NFC Problem

Mon Jun 29, 2015 11:44 am

It's an SPI device, so connect the MISO, MOSI (on the ICSP header) and pin#10 (CS) to the SPI pins on your RPi.

You should then be able to use the python-spidev library to communicate with it.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

Re: NFC Problem

Mon Jun 29, 2015 11:50 am

Thank you mr Lawson, but I tried everything, it is not working. I cannot find when I run cat /dev/spidev :(

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NFC Problem

Mon Jun 29, 2015 11:56 am

SPI needs to be enabled with a config.txt parameter

Code: Select all

dtparam=spi=on
Once you add that then /dev/spidev0.0 and /dev/spidev0.1 will appear.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

Re: NFC Problem

Mon Jun 29, 2015 11:58 am

Ok, I am trying now :)

User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

Re: NFC Problem

Mon Jun 29, 2015 2:07 pm

mr Lawson, I found raspberry spi pins and attached it to the nfc board, nfc pin(10 cs pin) attached raspberry pi pin gpio 8 [ce(0)] and my code below, nothing working, always response "0" do you any idea ?

Code: Select all

import spidev
import time
spi = spidev.SpiDev()
spi.open(0,0)
while True:
   resp = spi.xfer2([0x00])
   print resp[0]
   time.sleep(1)

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: NFC Problem

Mon Jun 29, 2015 2:30 pm

I'd start by reading it with an Arduino, since you've got ready made code for that.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
aleynasarcanli
Posts: 14
Joined: Mon Jun 29, 2015 7:29 am

Re: NFC Problem

Mon Jun 29, 2015 5:12 pm

Anyone for help ? :(

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: NFC Problem

Mon Jun 29, 2015 7:01 pm

Looking at the spec it's rated at 5v. The pi requires a 3v3 input so maybe it's not comparable.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

iyosch
Posts: 19
Joined: Tue Jun 09, 2015 6:40 am
Location: Jakarta, Indonesia

Re: NFC Problem

Mon Jul 06, 2015 5:17 am

hello.. have you tried this viewtopic.php?f=45&t=78966&p=560905&hilit=pn532#p560905
to setup the hardware and the libnfc setup for raspberry pi
and perhaps this https://learn.adafruit.com/adafruit-nfc ... ing-libnfc
and i guess someone already make your project http://www.instructables.com/id/Attenda ... -software/
Tell me if you made progress.. hope that helps..

Return to “General discussion”