Page 1 of 1

Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Sat Dec 08, 2018 6:58 pm
by Spalunkeldusch
Hello,

I am currently working on my university project on a topic "RFID school attendance system".
I have borrowed raspberry pi 2 model B from my colleague and installed fresh NOOBS/Raspbian OS into the SD card.
I have followed each possible tutorial on the internet regarding the wiring/reading/writing the raspberry with RC522 but I am still unable to read/write tags.

I have followed these specific guides lately:
1. https://www.raspberrypi-spy.co.uk/2018/ ... pberry-pi/
2. https://pimylifeup.com/raspberry-pi-rfid-rc522/

Everything works like a charm up until it asks me to attach the tag to the reader. When I attach it - nothing happens.
I have soldered the pins to RC522 without issues. I have literally tried everything possible. Firstly, I thought that the tag cards I have does not work at all, but I have tried reading them using an android with NFC and it was read without issues.

Wiring is done exactly the same as on the 2nd link above. I have also tried different wiring based on other tutorials but the output is still the same - unable to read/write tags.

Could you please give me any tips on this? I'm desperate on finishing this project as soon as possible.

Thanks in advance,
Regards,
Ignas

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Sun Dec 09, 2018 1:43 pm
by neilgl
Have you enabled the SPI Interface using sudo raspi-config
Also what happens if you run the SPI test as descibed by joan in this thread (with a wire connecting MOSI and MISO)
viewtopic.php?t=208332

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Tue Dec 11, 2018 8:30 am
by Spalunkeldusch
neilgl wrote:
Sun Dec 09, 2018 1:43 pm
Have you enabled the SPI Interface using sudo raspi-config
Also what happens if you run the SPI test as descibed by joan in this thread (with a wire connecting MOSI and MISO)
viewtopic.php?t=208332
Hello,

Thank you for you answer.
I have enabled SPI using the command: sudo raspi-config
As for the SPI test, I am unsure what exactly I should be doing (sorry since I am quite new to this kind of stuff).
Should I just keep the wiring the same as in the picture below? Or do I have to change anything before executing the commands from joan post?
Image

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Tue Dec 11, 2018 1:48 pm
by neilgl
For the test disconnect your green and orange wires at the pi header (MOSI and MISO) and connect a female-female wire onto those two pins. So, what we have is the output connected back to the input for testing SPI.
Then use joans commands.

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Tue Dec 11, 2018 4:50 pm
by danjperron
Maybe the first thing to do is to check if you have the spidev

Check if spidev is listed

Code: Select all

pi@pibplus:~ $ ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 déc  4 11:06 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 déc  4 11:06 /dev/spidev0.1
if it returns spidev0.0 in the listing you have the SPI device!

Sometimes the reset is the problem.

You could download my github version whichis based on the same code but with the reset pins and GPIO library removed.
P.S. You will need to remove the reset wire.

Code: Select all

cd
git clone https://github.com/danjperron/MFRC522-python danRC522
cd danRC522
python3 Read.py 
And try to put your rfid key next to the reader.

N.B. This version works with python3 and has been change to accept 10 bytes RFID keys.

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Sat Dec 15, 2018 2:39 pm
by Spalunkeldusch
neilgl wrote:
Tue Dec 11, 2018 1:48 pm
For the test disconnect your green and orange wires at the pi header (MOSI and MISO) and connect a female-female wire onto those two pins. So, what we have is the output connected back to the input for testing SPI.
Then use joans commands.
Hello again,

I have received the same answer to the commands as shown in that topic.
danjperron wrote: Maybe the first thing to do is to check if you have the spidev

Check if spidev is listed

Code: Select all

pi@pibplus:~ $ ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 déc  4 11:06 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 déc  4 11:06 /dev/spidev0.1
if it returns spidev0.0 in the listing you have the SPI device!

Sometimes the reset is the problem.

You could download my github version whichis based on the same code but with the reset pins and GPIO library removed.
P.S. You will need to remove the reset wire.

Code: Select all

cd
git clone https://github.com/danjperron/MFRC522-python danRC522
cd danRC522
python3 Read.py 
And try to put your rfid key next to the reader.

N.B. This version works with python3 and has been change to accept 10 bytes RFID keys.
It returns exactly the same as on your shown code when im checking if spidev is listed.
Also, I have tried removing RST wire connecting rc522 and raspberry, then cloning your code and running it - still, my rc522 does not give me any answer when I am putting my rfid cards/tags near the reader.

Maybe it has something to do with soldering the pins to the reader? I have soldered it myself, however, If it was an error when soldering, the red LED on rc522 wouldnt light up.

I am really out of ideas.. :(

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Sun Dec 16, 2018 2:29 pm
by neilgl
OK what happens when, with the wiring as per tutorial, you run the example "Read.py" in the directory "MFRC522-python"

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Thu Dec 20, 2018 12:28 pm
by Spalunkeldusch
neilgl wrote: OK what happens when, with the wiring as per tutorial, you run the example "Read.py" in the directory "MFRC522-python"
It runs a script as it should with the message "Press CTRL-C to stop".
Based on tutorial, at this point I should place the RFID card on the reader and the ID should appear, but it just does nothing.
I have tested the RFID card and key tag that I have with NFC reader on my phone and it showed positive results.
Maybe the reader is dead?

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Thu Dec 20, 2018 5:16 pm
by DougieLawson
Does the reader run at 3.3V or 5V?

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Fri Dec 21, 2018 9:38 am
by Spalunkeldusch
DougieLawson wrote:
Thu Dec 20, 2018 5:16 pm
Does the reader run at 3.3V or 5V?
Hello,

I have connected the reader with raspberry to pin1 (3.3V) and I am using 5V micro-usb power supply

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Fri Dec 21, 2018 9:42 am
by DougieLawson
My question was "What voltage is the RFID reader specified to run at?" not "what are you using for your Raspberry?"

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Fri Dec 21, 2018 12:05 pm
by neilgl
Can you post a photo of the actual card reader and wiring to the pi
I can then compare it to mine.

Re: Raspberry Pi 2 model B with RC522 - Does not read tags

Posted: Wed Feb 06, 2019 6:51 pm
by Spalunkeldusch
Hello.

Sorry for the long wait. I have bought a new rc522, soldered the pins, followed this tutorial: https://medium.com/coinmonks/for-beginn ... 5f67843a2d
And i was able to read the tags properly. So it was a faulty rc522 before.

What I would like to do now is:

I have a 0.96" OLED display that can be connected via i2c interface (gnd vcc scl sda pins on display).
Could any of you please write or guide me to a python script that would display the tag readings on my OLED display?

Regards,