RFID RC522 not working

August 30, 2024, 11:04

shadeslayah

Operating system: Raspberry Pi OS (64bit) Build number: raspberry pi 6.6.31+rpt-rpt-v8 Debian 1:6.6.31-1+rpt1 (2024 - 05-29) arch64 GNU/Linux Have you read #information?: Yes Board: Raspberry Pi 3B+ Hello, i'm doing a personal project but i cant really get to the end of it. The main objective is simply to make the RFID RC522 scanner work and let it scan cards and chips (i tried different ones including the one that comes with the scanner). It's about the RFID RC522 scanner that apperently doesn't work. I've changed scanners twice when the first and second one didn't work, but they don't work either, so i'm starting to think that the problem is my python coding (which i've mainly obtained thru chatGPT). I've connected all of the cables correctly multiple times, so that doesn't seem to be the problem either. I'll attach all of the lines of code i've written in order on the terminal in order so you can understand better. It would be great if someone could help me since i've been stuck for over a week on this project and really need to finish it.
sudo apt-get update
sudo apt-get upgrade
sudo raspi-config (SPI activation)
sudo reboot
sudo apt-get install python3-spidev python3-rpi.gpio
mkdir ~/rfid_project
cd ~/rfid_project
git clone http://github.com/pimylifeup/MFRC522-python.git
cd MFRC522-python
python3 setup.py install
cd ~/rfid_project
nano rfid_test.py
#the following lines of code are part of the py file to execute
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()

try:
    print("Avvicina la tua carta al lettore RFID...")
    id, text = reader.read()
    print(f"ID: {id}\nTesto: {text}")

finally:
    GPIO.cleanup()
#last command to execute the py file
python3 rfid_test.py

oops.se

There you can find out how to format the text, https://discord.com/channels/818384379197784084/1189386838788542464

shadeslayah

formatted and simplified, thanks!

oops.se

And there is NO reason to cross post!

oops.se

People see that there is a new topic!

oops.se

Follow this article https://pimylifeup.com/raspberry-pi-rfid-rc522/ and I wouldn't recommend ChatGTP for coding or else for that matter.