I am following this tutorial to get my raspberry pi set up with an RFID module. Unfortunately, I cannot get it to work.
Specifications
- Raspberry pi 4 Model B
- Raspbian GNU/Linux 11 (bullseye)
- Mifare RC522 RF IC
- Using Thonny to run it
Set up
Current Issue/Code & Warnings
As I was going through the tutorial mentioned above, I got to the point where I would run my code and it would not allow me to interact with the hardware itself. For clarity, I seem to be stuck when using the SimpleMFRC522 instantiation for my read.py (as well as my write.py). When I go to tap the card onto the RFID scanner, nothing happens and I am unsure why.
Read.py
#!/usr/bin/env python
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
try:
print("Tap the card")
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
Read.py output
Python 3.9.2 (/user/bin/python3)
>>> %Run read.py
/usr/local/lib/python3.9/dist-packages/mfrc522/MFRC522.py:151: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
GPIO.setup(pin_rst, GPIO.OUT)
Tap the Card
Things I've Tried
- Reinstall Raspbian OS
- Swapped out the RFID Scanner with a new one
- Confirmed that the SPI is active in config.txt file (mentioned in the tutorial)
- Completed all sudo commands mentioned in the tutorial