1

I know this topic has been already discussed in many aspects here and other forums but I haven't found help for my problem (which I guess may be just slightly different than in older topics because literally nothing worked).

My problem is RFID module not working (not reading any data) with RPi 3. I have Raspberry Pi 3B (40-pins board) and RFID RC-522 module. I soldered the module's pins and connected them as follows with my RPi:

Name    Pin #   Pin name
SDA     24      GPIO8
SCK     23      GPIO11
MOSI    19      GPIO10
MISO    21      GPIO9
IRQ     None    None
GND     Any     Any Ground
RST     22      GPIO25
3.3V    1       3V3

I am sure my RFID module works fine, checked it with Arduino. On RPi this module reads no data from any RFID tag. Every examplary program I tried to read data just starts and waits for data to print which never occures.

On my RPi I have tried to use different versions of Raspbian OS, currently running latest Jessie. Wheezy was not booting up on my RPi 3.

I enabled SPI. In my /dev there are visible spi's:

$ ls /dev/spi*
/dev/spidev0.0  /dev/spidev0.1

My lsmod lists spi_bcm2835 module.

I have installed and tried to use few different libraries for the module, according to different instructions I found, libraries I tried were (sorry I cannot insert more than two links, they all are on github): lthiery/SPI-Py, mxgxw/MFRC522-python, rasplay/MFRC522-python, ondryaso/pi-rc522. I checked these libs on clean installs of different Raspbian's.

Finally, I guess I have tried every solution mentioned in this topic: https://github.com/raspberrypi/linux/issues/1547 and still couldn't make my RPi work with my module.

So if somebody solved this issue with latest versions of RPi and Raspbian please point me the direction how to solve this problem, how to get RC522 module working on RPi 3 and latest Raspbian Jessie (or other Linux OS)?

  • The stated connections look correct. Could you post a photo so that we can double check. I have a couple hooked up to a Pi2 and they work fine. – joan Feb 19 '17 at 20:24
  • @joan Thanks for comment! I posted my wires photos here: imgur.com/a/T8L9T – d324223 Feb 19 '17 at 21:14
1

I have just connected a MFRC522 module to a Pi3B and it works fine.

I used the following connections

RC522 SDA   SCK  MOSI  MISO   RQ    GND   RST   3V3
       |     |     |     |     |     |     |     |
Pi3B  CS    CLK  MOSI  MISO  N/C    GND   N/C   3V3
Pin   24    23    19    21          39           1
GPIO   8    11    10     9          GND         3V3

Test with a blank (default keys) card

Card request, ATQA=4
Card anticollision, UID=[105, 34, 214, 45]
Card select, SAK=8
authenticated sector trailer with key A
[0, 0, 0, 0, 0, 0, 255, 7, 128, 0, 255, 255, 255, 255, 255, 255]
authenticated data blocks with key B
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
exiting

The code (RC522.py) and a test script (test-RC522.py) may be found here.

  • What version of OS did you use? Did you get a clean new install of Jessie or you upgraded from older system? What else have you installed and on which library did you run it? – d324223 Feb 19 '17 at 21:18
  • @d324223 I am using an up to date Jessie, not a fresh install. I'm using (my) pigpio and my own RC522 Python class plus test script. – joan Feb 19 '17 at 21:51
  • Maybe you have a chance to test it on fresh install of Jessie? I read on some forums that people got it working on upgraded to the latest system, which was firstly installed as Wheezy on RPi 2. But I don't have older RPi so I can't boot Wheezy for upgrade – d324223 Feb 20 '17 at 7:41
  • And another thing may be that you have written some better libs than I have tested. Can I find them somewhere on public repo or you don't wish to share them? – d324223 Feb 20 '17 at 7:43
  • @d324223 You are welcome to the code. I will make it Public Domain when I am happy with it. I have added a link to it in my answer. – joan Feb 20 '17 at 9:13
0

I had a similar problem. For some reason the SPI interface would not work on an RPi3. On a hunch I formatted anothed SD card with plain vanilla Debian 8 for Raspberry distro. It worked fine with the SPI interface and my RFID. What caused the problem in the otherwise ok and working SD card I do not know. I guess it was some flaky driver (perhaps a GPIO display I had tried).

0

Make sure that the tags you purchase for your RFID RC522 operate on the 13.56MHz frequency otherwise it will fail to read them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.