Reading RFID tags - Adam Laurie's RFIDIOt and the CardMan 5321 USB reader
As I noted in my last post, Improvised RFID Blocking Wallets: Preventing PayPass Skimming, I have recently been working with an OmniKey Cardman 5321 USB RFID reader in Windows. The reader is compatible with a broad range of RFID cards (From Omnikey's website):
- Philips/NXP: MIFARE®, DESFire®, MIFARE ProX®, and i.code
- HID: iCLASS®
- Texas Instruments: TagIT®
- ST Micro: x-ident, SR 176, SR 1X 4K
- Infineon: My-d (in secure mode UID only)
- Atmel: AT088RF020
- KSW MicroTech: KSW TempSens
- JavaCard: JCOP / SMART-MX in RSA mode with 2048 bit keys
To make RFIDIOt work, I installed Python 2.5.2, as some of the packages it relies on work with 2.5, but not with 2.6. You'll need the following software packages to make it all work:
- pySerial (2.4 Win32)
- pyscard (1.6.7 Win32-py2.5)
- pycrypto (pycrypto-2.0.1.win32-py.25)
- the Python Imaging Library (PIL-1.1.6.win32.py2.5)
- pywin32-212 (pywin32-212.win32-py2.5)
You will also need to modify RFIDIOtconfig.py to use the USB device. Simply modify the section that reads:
# serial port (can be overridden with -l for Windows)
line= "SERIAL”
# serial port (can be overridden with -l for Windows)A simple re-compile of RFIDIOtconfig.py results in an updated RFIDIOtconfig.pyc, and you're ready to go.
line= "USB”
Once you have done this, you should be able to test your reader by executing multiselect.pyc, which is a simple looping tag ID reader. If you see the tag IDs when the green LED on your CardMan turns red, you've succeeded.
RFIDIOt presumes that you will have a directory in your system root called /tmp - if you want to capture any data for testing, you'll need to manually create the directory on Windows systems.
5 comments:
Hi,
Thx for the great article. it helps me a lot.
I have a question regarding the multiselect.py , in the section:
try:
card= RFIDIOtconfig.card
except:
os._exit(True)
why i always get the exception? what the line card= RFIDIOtconfig.card trying to do?
any help would be great. Thx.
Max, it looks like you have a problem with the code - try switching it to read:
try:
card= RFIDIOtconfig.card
except:
os._exit(False)
That should work.
thx for the reply david,
I got the code from RFIDiot website and didnt make any changes with the code.
I tried to comment the os._exit(True) and the compiler show error like this:
File "C:\Program Files\Python25\multiselect.py", line 41, in module
card.info('multiselect v0.1m')
NameError: name 'card' is not defined
i'm guessing i made mistake in installing RFIDiot.
My multiselect.py reads:
try:
card= RFIDIOtconfig.card
except:
os._exit(False)
args= RFIDIOtconfig.args
card.info('multiselect v0.1l').
This points you to your rfidiot configuration file, RFIDIOTconfig.py where you will find:
card= RFIDIOt.rfidiot(readernum,readertype,line,speed,timeout,debug
My config has the following settings:
# serial port (can be overridden with -l
line= "USB"
# reader type (can be overridden with -R
readertype= RFIDIOt.rfidiot.READER_PCS
# PCSC reader number (can be overridden with -r)
readernum= 1
# serial port speed (can be overridden with -s)
speed= 57600
If you don't have your card setup properly, you may get that error. You might also contact Adam Laurie, as he's the real expert on his software.
hi David,
the multiselect.pyc, is it just read one tag or all tags in its range?
cheerz
Post a Comment