Jump to content

Dual RC522 on Orange PI PC


nedoskiv

Recommended Posts

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:

 

 

post-3853-0-65225300-1481973551_thumb.jpeg

 

 

     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
 
      cd orangepi_PC_gpio_pyH3
      python setup.py install
 Install SPI-Py Library
    cd SPI-Py
     python setup.py install
 
 Install MFRC522-python
 
 
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/erivandoramos/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?
Link to comment
Share on other sites

Time to pay attention to this topic again, what I do to make RC522 work described above seems not works anymore,  got no idea why, I just moved to newer  armbian release on same board where RC522 is connected, no errors, but also no readings

Link to comment
Share on other sites

after spending few hours of comparing, change something, test, fail, test, fail  found where is the problem

first I though it is script.bin, there are some GPIO_PARA differences, but it is not. So in short here was the problem and solution.

by unknown reason to me two I2C drivers/modules are loaded:

 

pcf8591

bmp085

 

unloading them do not fix the problem, they need to be disabled and system rebooted, to do that add the following:

 

blacklist pcf8591
blacklist bmp085

 

to /etc/modprobe.d/fbdev-blacklist.conf

 

and reboot. it should work fine.

 

P.S. soon I will make fresh armbian install and check if that 2 modules are still loaded.

 

Link to comment
Share on other sites

4 minutes ago, nedoskiv said:

by unknown reason to me two I2C drivers/modules are loaded:

 

pcf8591

bmp085

These modules were changed/added as a part of FriendlyArm patches to support their Matrix kits. No idea how useful are they in Armbian images, but autoloading of these modules is definitely not a good implementation of pluggable hardware support.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines