rfidiot qr code
 Documentation

Getting Started

Windows Installation

All test programs etc. are Windows compatible, but you may need to make some adjustments to get python working smoothly under Windows if it's not already installed. In particular, you need to be able to run commands from the command line, so make sure you've followed the instruction to set up  your PATH here. Python for Windows can be downloaded here (RFIDIOt now requires Python 3 - the old Python 2 code is preserved on the 'python2.7' branch).

Device Types

There are two basic type of device supported by RFIDIOt: serial and PCSC. Note that both types may have a USB physical interface, but the low level communications protocol  will be handled differently for each.

Serial devices

PCSC devices

Device Drivers

Serial Drivers

Serial devices with an RS232 interface require no device drivers, so you can skip to the Dependencies section.

Serial devices with a USB interface use an FTDI serial converter, which requires an external driver (ftdi_sio). This should be autoloaded by your O/S, but if not you can get it from here:
Under Linux and OS/X, the device will normally appear as /dev/ttyUSBn, where 'n' is the device number, starting at 0. e.g. /dev/ttyUSB0. If you can't find it, run 'dmesg' and you should see the device loading:

	[ 3799.146735] usb 2-2: new full speed USB device using uhci_hcd and address 4
[ 3797.292486] usb 2-2: configuration #1 chosen from 1 choice
[ 3797.294329] ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected
[ 3797.294373] /build/buildd/linux-2.6.24/drivers/usb/serial/ftdi_sio.c: Detected FT232RL
[ 3797.294532] usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0

Common problems

Windows driver installed, but tools cannot open COM port
Under Windows, the device will be installed as a virtual COM port. It is important that this is lower than COM10, as external libraries used by RFIDIOt may have trouble addressing COM10 and above. If it appears above COM9, use the control panel hardware manager to renumber it.
Linux driver loads but no /dev/ttyUSBn created
Try:
	mknod /dev/ttyUSB0 c 188 0

PCSC Drivers

PCSC devices are supported by the pcscd daemon, which is part of the pcscs-lite project, in conjunction with specific device driver 'bundles', which are either part of pcscs-lite, or distributed separately by the manufacturer:
If you are running OS-X Jaguar (10.2) or later, pcsc-lite is already installed, but you may still need additional drivers.

Otherwise, first install pcscs-lite and ccid drivers, then additional drivers if required. You can test that your reader is working by running 'pcsc_scan' or 'pcsctest', which should show your device registering cards being placed on and removed from the reader coil. Once this is working, you can move on to the Dependencies section.

Common problems

OmniKey CardMan 5321 only registers contact cards, not contactless
    You need to disable support from the native pcscs-lite drivers and use the omniKey manufacturer driver instead. You do this by editing the pcsc bundle or removing it altogether if you don't need to support any other devices. To remove it, simply move the following sub-directory to a backup location and restart pcscd:
	/usr/local/pcsc/drivers/ifd-ccid.bundle

    To leave the driver in place, but remove CardMan 5321 device support, edit the following file:
        /usr/local/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
    note that on some distributions, this may also be found here:
	/etc/libccid_Info.plist
    Look for the Vendor array:
  <key>ifdVendorID</key>
<array>

    and within that, the OmniKey vendor ID, which you can find by running 'lsusb':
	$ lsusb
	Bus 005 Device 002: ID 413c:a005 Dell Computer Corp. 
Bus 005 Device 001: ID 0000:0000 
Bus 004 Device 001: ID 0000:0000 
Bus 003 Device 002: ID 076b:5321 OmniKey AG
Bus 003 Device 001: ID 0000:0000 
Bus 002 Device 004: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 003: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader
Bus 002 Device 002: ID 0b97:7761 O2 Micro, Inc.
Bus 002 Device 001: ID 0000:0000 
Bus 001 Device 001: ID 0000:0000 
    so in this case, our device is vendor number '076B', which you should be able to find within the array:
	<string>0x04E6</string>
<string>0x04E6</string>
<string>0x076B</string>
<string>0x076B</string>
<string>0x076B</string>
    Note that there may be more than one entry for this vendor, as this array is linked to another which contains individual product reference numbers. It is vital, therefore, that you only remove one entry, or you will skew the arrays which will cause unpredictable results.

    Now find the product in the Product array (in this case '5321'):
        <key>ifdProductID</key>
        <array>

<string>0x5121</string>
<string>0x5125</string>
<string>0x5321>/string>

<string>0x6622</string>
<string>0xA022</string>
    and remove that line too.

    Finally, in the Friendly Name array, remove the human readable description:

	<key>ifdFriendlyName</key>
<array>

<string>OmniKey CardMan 5121</string>
<string>OmniKey CardMan 5125</string>
<string>OmniKey CardMan 5321</string>
<string>OmniKey CardMan 6121</string>
<string>Teo by Xiring</string>
    Now restart pcscd in the foreground, and check that it uses the manufacturer's driver:
        $ sudo pcscd -f
00000000 pcscdaemon.c:280:main() pcscd set to foreground with debug send to stderr
00000570 pcscdaemon.c:518:main() pcsc-lite 1.5.0 daemon ready.
00309648 hotplug_libusb.c:477:HPAddHotPluggable() Adding USB device: 003:002
00000075 readerfactory.c:1082:RFInitializeReader() Attempting startup of OMNIKEY CardMan 5x21 00 00 using /usr/local/pcsc/drivers/ifdokrfid_lnx-2.6.0.bundle/Contents/Linux/ifdokrfid.so
00000434 readerfactory.c:949:RFBindFunctions() Loading IFD Handler 3.0
OK OMNIKEY CardMan RFID  IA32 v2.6.0 support@omnikey.com
Omnikey CardMan 5321 fails to load with Manufacturer's driver
    Run pcscd in the foreground so you can watch the error log, and if you get something like this:
	13431722 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x076B, PID: 0x5321
00000058 hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_76b_5321_noserial_if0
01001266 readerfactory.c:1135:RFInitializeReader() Attempting startup of OMNIKEY CardMan 5x21 00 00 using /usr/lib/pcsc/drivers/ifdokrfid_lnx-2.6.0.bundle/Contents/Linux/ifdokrfid.so
00074319 readerfactory.c:1002:RFBindFunctions() Loading IFD Handler 3.0
OK OMNIKEY CardMan RFID IA32 v2.6.0 support@omnikey.com
00000913 readerfactory.c:1174:RFInitializeReader() Open Port 200000 Failed (usb:076b/5321:libhal:/org/freedesktop/Hal/devices/usb_device_76b_5321_noserial_if0)
00000377 readerfactory.c:1047:RFUnloadReader() Unloading reader driver.
00000353 readerfactory.c:254:RFAddReader() OMNIKEY CardMan 5x21 init failed.
00000301 hotplug_libhal.c:395:HPAddDevice() Failed adding USB device: usb_device_76b_5321_noserial_if0
    You need to rebuild pcsc-lite without HAL support.
Error message 'Did you set DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED in ifdDriverOptions in libccid_Info.plist?'
    Tikitag/Touchatag readers need the CCID_EXCHANGE_AUTHORIZED option set for pcscd. Edit the file:
	/usr/local/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
    note that on some distributions, this may also be found here:
	/etc/libccid_Info.plist
    find the section:
        <key>ifdDriverOptions</key>
        <string>0x0000</string>
    and change the value to 0x0001:
        <key>ifdDriverOptions</key>
        <string>0x0001</string>
    Now restart pcscd.
Error message 'AttributeError: rfidiot instance has no attribute 'readername''
    Check that the reader number is correctly set in RFIDIOtconfig.py - you can find out your reader number by running any command with the '-L' flag. e.g.
    ./cardselect.py -L

Dependencies

RFIDIOt uses a number of external libraries which will also need to be installed: