Using two RFID readers with one raspberry pi

Technical Discussion on the PhidgetRFID
Post Reply
dn_lolz
Fresh meat
Posts: 3
Joined: Wed Jul 12, 2017 6:28 am
Contact:

Using two RFID readers with one raspberry pi

Post by dn_lolz »

Hi forum, is there a way to use two Phidgets RFID readers with one raspberry pi ? When I'm connecting both RFID readers to raspberry only shows one as attached, when I'm disconnecting the registered reader, the second on gets attached. The code I'm using: https://gist.github.com/nmsdvid/4840dd5 ... e9386bdc79
User avatar
Patrick
Lead Developer
Posts: 3403
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Using two RFID readers with one raspberry pi

Post by Patrick »

If you want to use both at once, you'll need to create 2 CPhidgetRFIDHandles and then open them both, specifying the serial numbers.
dn_lolz
Fresh meat
Posts: 3
Joined: Wed Jul 12, 2017 6:28 am
Contact:

Re: Using two RFID readers with one raspberry pi

Post by dn_lolz »

Thank you, its working.
dn_lolz
Fresh meat
Posts: 3
Joined: Wed Jul 12, 2017 6:28 am
Contact:

Re: Using two RFID readers with one raspberry pi

Post by dn_lolz »

Hello Patrick, Do you think there is a way to use both readers at once but not having to specify the serial numbers of the readers ?
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Using two RFID readers with one raspberry pi

Post by mparadis »

Setting the serial numbers is technically optional, since the open() call will open the first Phidget that matches the criteria you've provided. In this case, the only criteria is that it has to be an RFID channel, so the first time you call open it will attach one of the two readers. The second time you call open, if the first one hasn't been closed, your program will open the second one since a Phidget channel can only be opened by one source at a time (unless opened remotely).

We usually recommend setting the serial number because it ensures that you don't open channels that you weren't expecting to open. For example, if there was another RFID reader connected to another computer on your network and they had the Phidget Network Server enabled, this open call could open that RFID reader instead of one of the ones connected to the Raspberry Pi. If you know for sure that this situation won't occur, and you don't care which order the readers attach in, then it's fine to omit the serial number.

Side note: if you plan on using both RFID readers in close proximity to one another, you may have interference issues. Have a look at this article for a workaround.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests