1

I connected a RFID-RC522 to my RPi 4. It was working perfectly to read data until now. I don't know why but I cannot read anymore data now. Nothing changed in the hardware, neither the software. Maybe a configuration of the Pi changed, but I'm not sure.

I connected the pins like that:

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

Here is my code (I also tried with pirc522 library):

import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()
print("Wait RFID tag...")
try:
    id, text = reader.read()
    print(id)
    print(text)
finally:
    GPIO.cleanup()

Nothing happens now, the code is waiting even if I put a tag front of the reader. I don't know what I can check to see if everything is well configured. I already went to raspi-config to enable SPI. I don't understand why it suddenly stopped to work.

Thanks in advance for your help.

13
  • 1
    Not much we can do to help. You need to add debug/trace statements to find the failure point. abyz.me.uk/rpi/pigpio/piscope.html and/or abyz.me.uk/rpi/pigpio/examples.html#Python_monitor_py will help you check the SPI comms.
    – joan
    Nov 19, 2020 at 11:57
  • 1
    Thanks @joan for your softwares. I could check the signals, and it looks like I sending data. I just have nothing (with the both solution, I cannot see anything) on the RST pin. I don't know if it's the problem. Also the clock doesn't look regular. Nov 20, 2020 at 9:05
  • 1
    Thanks a lot @tlfong01 ! I'll following your guidelines and checking everything. I hope it's not that deep problem, because I already made deep configuration on my Pi for other softwares. I also saw you put a pull-up resistor on the RST, is it mandatory? Mine is just connected to the RPi GPIO 25. Checking all the config files looks troublesome ^^' Nov 20, 2020 at 9:08
  • 1
    Is there a way to reinstall the SPI module properly, if it's the problem? I tried to add a pull-up resistor (but after checking my RST is already HIGH). I tried to reinstall the mfrc522 library, hopping it reset the parameters. I'll try to start a new setting from 0, and installing step by step the needed programs. Nov 24, 2020 at 9:49
  • 1
    I tried with a freshly installed RPi, and I got the same problem :( I don't know why it stopped to work :/ Nov 28, 2020 at 8:45

0

Browse other questions tagged or ask your own question.