Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Sat Dec 08, 2018 6:58 pm

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

User avatar
neilgl
Posts: 743
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

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

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

Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Tue Dec 11, 2018 8:30 am

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

User avatar
neilgl
Posts: 743
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

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

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.

danjperron
Posts: 3390
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

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

Tue Dec 11, 2018 4:50 pm

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.

Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Sat Dec 15, 2018 2:39 pm

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.. :(

User avatar
neilgl
Posts: 743
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

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

Sun Dec 16, 2018 2:29 pm

OK what happens when, with the wiring as per tutorial, you run the example "Read.py" in the directory "MFRC522-python"

Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Thu Dec 20, 2018 12:28 pm

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?

User avatar
DougieLawson
Posts: 35784
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Thu Dec 20, 2018 5:16 pm

Does the reader run at 3.3V or 5V?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Fri Dec 21, 2018 9:38 am

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

User avatar
DougieLawson
Posts: 35784
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Fri Dec 21, 2018 9:42 am

My question was "What voltage is the RFID reader specified to run at?" not "what are you using for your Raspberry?"
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
neilgl
Posts: 743
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

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

Fri Dec 21, 2018 12:05 pm

Can you post a photo of the actual card reader and wiring to the pi
I can then compare it to mine.

Spalunkeldusch
Posts: 16
Joined: Sat Dec 08, 2018 6:52 pm

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

Wed Feb 06, 2019 6:51 pm

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,

Return to “Beginners”