Hello, my goal is to use two RC522 RFID readers on orange pi. In order to do that I will need help. Let me first explained how I made one work (googled it read, test and it work)
GUIDE HOW TO USE SINGLE RC522 on Orange PI PC
hardware connection:
MOSI ——————————> pin 19
MISO ——————————-> pin 21
SCLK ——————————-> pin 23
SDA ——————————–> pin 24
RST ———————————> pin 22
IRQ ———————————-> NONE
that is all about hardware connection, let look at software part, on Armbian some stuff are out of the box, so we need to install few things only:
Install python dev
apt-get install python-dev
Install orangepi_PC_gpio_pyH3 Library
git clone https://github.com/d...C_gpio_pyH3.git
cd orangepi_PC_gpio_pyH3
python setup.py install
Install SPI-Py Library
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
python setup.py install
Install MFRC522-python
git clone https://github.com/r...C522-python.git
tricky part is that MFRC522-python was made to work with Raspberry. In order to work on OPI we need to edit MFRC522.py a little:
replace : (it is at beggining at the file)
import RPi.GPIO as GPIO
with
import pyA20.gpio as GPIO
comment some lines around (110-115) as shown below:
def __init__(self,spd=1000000):
spi.openSPI(speed=spd)
# GPIO.setcfg(GPIO.BOARD, 1)
# GPIO.setup(22, GPIO.OUT)
# GPIO.output(self.NRSTPD, 1)
self.MFRC522_Init()^M
also (around line 355)
def MFRC522_Init(self):
# GPIO.output(self.NRSTPD, 1)
self.MFRC522_Reset();
you are good to go: (try to read a card)
python read.py
root@orangepione:~/MFRC522-python# python read.py
Card read UID: 193,11,21,149,74
Here is the place where single RC522 guided ends and I can ask for a help.
I was reading and googling about how to make 2 of those works, there are some solutions maded for Raspberry. I got no skills/knowledge to make them work on orange PI. (example: https://github.com/e...os/TwoRC522RPi)
connecting 2 RC522 use common (shared pins) only difference is SDA signal of second rc522 must go to pin 26.
MFRC522.py need to be modified, to use SDA to select from which reader it reading data. Reading further, points that same line that we comment in order to run it on OPI are responsible for that. I try to uncomment them but scripts fails, looks like in pyA20.gpio are not present those (or are different) functions that are responsible to control that signal.
I got not much python knowledge and cannot solve that. Can someone please help?
|