Python library to read and write RFID tags via the MFRC522 RFID module.
Open the raspberry pi configuration with: sudo raspi-config
.
In the menu that pops up select 5 Interfacing options
.
And finally enable SPI by selecting P4 SPI
.
For the changes to take effect, reboot the raspberry pi with? sudo reboot
.
Connect the RC522's Pins to the RaspberryPi's GPIO pins. No need to connect the IRQ pin.
RC522 | GPIO pin |
---|---|
SDA | 8 |
SCK | 11 |
MOSI | 10 |
MISO | 9 |
IRQ | - |
GND | GND |
RST | 25 |
3.3V | 3.3V |
Pin numbers in the table above are based on the GPIO numbering, not the pin numbering. You can check out the following image for more information about how to wire the reader.
image source: https://www.raspberrypi.com/
You can either simple clone this repository to where you want to use it and import the scripts into your code from there, or install this as a module.
First install the dependencies required to run this code, which are git, python-dev, and spidev. You can do this with the following bash commands.
sudo apt install git python-dev -y
python3 -m pip install spidev
Simply use the following bash commands to clone the repo. Once executed, you're in and ready to go.
cd ~
git clone https://github.com/fintzd/MFRC522-python.git
cd MFRC522-python/
First install the dependencies required to run this code, which are git & python-dev. You can do this with the following bash commands.
sudo apt install git python-dev -y
Then you can use the setup.py
file to set this script up. To do this, use the following commands in the top level directory (or wherever you want to use it). Mind you, that we are using python3 in this repository.
cd ~
git clone https://github.com/fintzd/MFRC522-python.git
cd MFRC522-python/
sudo python3 setup.py install
TODO
TODO