View: 10055|Reply: 7

Dual RC522 on Orange PI PC

[Copy link]

3

threads

6

posts

46

credits

Novice

Rank: 1

credits
46
Published in 2016-12-27 03:02:29 | Show all floors |Read mode
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?


This thread contains more resources

You need to Log in to download or view,No account?    Register

x

0

threads

32

posts

88

credits

Registered member

Rank: 2

credits
88
Published in 2023-5-9 11:35:12 | Show all floors
As for the software part, you will need to modify the code to handle two readers instead of one. This could involve creating two instances of the MFRC522 class and using different sets of pins for each instance. You may also need to modify the code to handle interrupts from both readers if you are using an IRQ pin. lol shot io

0

threads

25

posts

80

credits

Registered member

Rank: 2

credits
80
Published in 2023-9-20 15:18:36 | Show all floors
If you have any free time, I recently discovered an incredible game called LOLbeans io that you are welcome to join me in playing if you do.
Published in 2024-3-16 01:31:42 | Show all floors
Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a bit, but instead of that, this is magnificent blog. An excellent read. I will certainly be back.        topcer88 slot
Published in 2024-3-16 01:34:16 | Show all floors
Hello there, just became aware of your blog through Google, and found that it is truly informative. I’m going to watch out for brussels. I’ll appreciate if you continue this in future. A lot of people will be benefited from your writing. Cheers!        topcer88 slot
Published in 2024-3-21 16:45:54 | Show all floors
Spot on with this write-up, I truly suppose this website needs rather more consideration. I’ll in all probability be again to learn much more, thanks for that info.        https://betvisa.ac/

0

threads

25

posts

106

credits

Registered member

Rank: 2

credits
106
Published in 2024-3-21 17:52:17 | Show all floors
This pc system is too high quality moto x3m
Published in 2024-3-27 01:15:08 | Show all floors
Your posts continually include much of really up to date info.  Where do you come up with this?  Just declaring you are very resourceful.  Thanks again        topcer88
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list