Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option for multiple RFID Readers #1012

Merged
merged 8 commits into from Jul 16, 2020

Conversation

ProchaskaMarkus
Copy link

@ProchaskaMarkus ProchaskaMarkus commented Jun 13, 2020

Issue #760
To use it, the two files Reader.py and RegisterDevice.py must be replaced with the *py..Multi files.

If you activate multiple RFID readers it´s e.g. possible to read Card and "Figure" RFID parallel.

To use it, the two files Reader.py and RegisterDevice.py must be replaced with the *py..Multi files.

If you activate multiple RFID readers it´s e.g. possible to read Card and "Figure" RFID parallel.
@MiczFlor
Copy link
Owner

Hi @ProchaskaMarkus
very interesting. You say "Card and 'Figure' RFID parallel". What RFID readers are you using?
I am wondering how this will affect the special Reader.py scripts. Is it easy to implement it accross board? Look at this script for example:
https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/develop/scripts/Reader.py.experimental
Here, the class Reader(object) is only one of many classes

@ProchaskaMarkus
Copy link
Author

Hi,
I use two USB readers at the same time, so I took the Reader.py as a basis. But of course I can also try to change the Reader.py.experimental accordingly.

@s-martin
Copy link
Collaborator

s-martin commented Jun 14, 2020

Hi Markus 🙋‍♂️

Cool enhancement, so I could upgrade my Phoniebox to figures without soldering 😀

Does this also work with single readers? Then we could think about to merge your improvements into the original files in the future.
Having it in the same files would improve maintainability.

@ProchaskaMarkus
Copy link
Author

Hey s-martin,
it also works with only one USB reader. I have now also implemented parallel reading for the Reader.py.experimental. Unfortunately I don't have a non-USB reader. I have seen that the readers are inserted manually in the function get_devices().

def get_devices():
    devices = [InputDevice(fn) for fn in list_devices()]
    devices.append(NonUsbDevice('MFRC522'))
    devices.append(NonUsbDevice('RDM6300'))
    devices.append(NonUsbDevice('PN532'))
    return devices

If this is necessary, are those not listed by list_devices()? How are they added with RegisterDevice() then? Or do I have to write it manually in the deviceName.txt file?

@ProchaskaMarkus ProchaskaMarkus changed the title Added option for multiple RFID Readers #760 Added option for multiple RFID Readers Jun 14, 2020
@s-martin
Copy link
Collaborator

If this is necessary, are those not listed by list_devices()? How are they added with RegisterDevice() then? Or do I have to write it manually in the deviceName.txt file?

Yes, list_devices only returns USB devices, but no devices connected via GPIO interface. That's the reason why those are added manually.

Markus Prochaska added 2 commits June 14, 2020 21:31
…e Reader.py.experimental.Multi)

Added Register NonUSB Devices with RegisterDevice (see RegisterDevice.py.Multi)
@ProchaskaMarkus
Copy link
Author

I have now created the script Reader.py.experimental.Multi based on the Reader.py.experimental. With this script you can read from several USB devices and non-USB readers. I have also changed the registerDevice.py.Multi so that non-USB devices can be added.

@ProchaskaMarkus
Copy link
Author

@MiczFlor

Hi @ProchaskaMarkus
very interesting. You say "Card and 'Figure' RFID parallel".

The following link describes the use case with two readers. One reader for the rfid figures and one for rfid cards.
#5 (comment)

@MiczFlor
Copy link
Owner

Hi @ProchaskaMarkus
I like the work you did. And I think this might well become the default use in Phoniebox - once it's been tested enough.
Could you write a wiki page (or a few lines here, I will make the wiki page then) on how to make use of your scripts? Because nobody would know this option exists.
The second step would be to add the option to the install script
Thirs step would be to drop the single reader options. Which would be needed soon, otherwise we have to maintain to separate scripts with the almost identical code.

@s-martin s-martin linked an issue Jun 26, 2020 that may be closed by this pull request
@ProchaskaMarkus
Copy link
Author

Hey, I will write the text for the Wiki the next days.
I added the Multi-Reader script to the buster-install-default.sh as an extra option.
Furthermore, I implemented the setup of the non-USB readers directly into the Python script. I am not sure if this is a good idea or not. What do you think?

 -Added Multi Reader registration to buster-install-default.sh as extra option
 -Changed the installscripts/buster-install-default.sh to use new RegisterDevice.py.Multi
 -Added requirement for PN532 and RC522 installation direct to RegisterDevice.py.Multi if the user chooses it.
@MiczFlor MiczFlor merged commit 5b64981 into MiczFlor:develop Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💡 Multiple RFID Readers
3 participants