Spalunkeldusch
Posts: 3
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: 250
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: 3
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: 250
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: 3096
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

[email protected]:~ $ 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: 3
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

[email protected]:~ $ 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.. :(

Return to “Beginners”