@atika13.
No need for a tuto it is straightforward. (Also there is a lot of doc , a little bit out of date, on the net).
- enable SPI sudo raspi-config , 5 Interfacing option, P4 SPI, Yes, finish
You could test if the SPI is enabled using this command ls -l /dev/spi* if /dev/spidev0.0 and /dev/spidev0.1 are displayed then you are in business.
-
clone the github git clone https://github.com/danjperron/MFRC522-python
-
power off the PI to make wrie connection
-
connect the RC-522 card like the readme description. Don't connect the reset pin.
-
power up the PI
-
run the command
cd MFRC522-python python3 Read.py
Now put the RFID card near the reader and it should output the serial Id.
-
Update Oct 2018
Replace spi by spidev
Remove Hardware reset
Remove GPIO from MFRC522
Add DoorSystem example using a relay with mariadb sql
Check DoorSystem_HowTo.txt -
Update Sept 2018 Modification of the Read function to be able to get RFID Identification of 7 Bytes and 10 bytes
A small class to interface with the NFC reader Module MFRC522 on the Raspberry Pi. This is a Python port of the example code for the NFC module MF522-AN.
This repository includes a couple of examples showing how to read, write, and dump data from a chip. They are thoroughly commented, and should be easy to understand.
You can use this image for reference.
| Name | Pin # | Pin name |
|---|---|---|
| SDA | 24 | GPIO8 |
| SCK | 23 | GPIO11 |
| MOSI | 19 | GPIO10 |
| MISO | 21 | GPIO9 |
| IRQ | None | None |
| GND | Any | Any Ground |
| RST | None | None |
| 3.3V | 1 | 3V3 |
Import the class by importing MFRC522 in the top of your script. For more info see the examples.
This code and examples are licensed under the GNU Lesser General Public License 3.0.