nedoskiv Posted December 17, 2016 Posted December 17, 2016 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/duxingkei33/orangepi_PC_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/rasplay/MFRC522-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/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?
nedoskiv Posted April 4, 2017 Author Posted April 4, 2017 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
nedoskiv Posted April 4, 2017 Author Posted April 4, 2017 downgrade (reinstall) from: Armbian_5.25_Orangepipcplus_Debian_jessie_default_3.4.113 to Armbian_5.20_Orangepipcplus_Debian_jessie_3.4.112 and it works again. Got no idea why.
nedoskiv Posted April 4, 2017 Author Posted April 4, 2017 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.
zador.blood.stained Posted April 4, 2017 Posted April 4, 2017 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.
Recommended Posts