RFID

From Tmplab
Revision as of 22:21, 10 March 2015 by Samneurohack (talk | contribs)

Copying tags

  • Tutorial with tips for libnfc install here

SCL 3711

  • 13.5 MHz, Based on PN533
  • Works with libnfc, lsnfc, mfoc, m
  • UID emulation work only if start with 0x08.

Mac Setup

No support for the RFID part yet, the smart card (with contact) works ok.

EEE Setup

  • EEE pc 401 with either Xandros or Debian EEE
  • Debian pcscd package
  • Debian pcsc-tools package
  • Added new source for APT:
eeepc:/home/user/> more /etc/apt/sources.list
deb http://update.eeepc.asus.com/p701 p701 main
deb http://update.eeepc.asus.com/p701/en p701 main
deb http://ftp.de.debian.org/debian lenny main
eeepc:/home/user/> 
  • Installed driver from Omnikey reader
ifdokrfid_lnx-2.6.0.tar.gz
  • Installed swig for pyscard install
apt-get install swig
  • Installed python-dev for pyscard install
apt-get install python-dev
  • Linked PCSC includes in main location
ln -s /usr/local/include/PCSC /usr/include/

driver location problem

ln -s /usr/local/pcsc/drivers/ifdokrfid_lnx-2.6.0.bundle /usr/lib/pcsc/drivers

Debian EEE Setup

Install problem

There's a big problem with the install is that you SHOULD NOT install the libhal support which is compiled by default in the debian packages.

When you have libhal support, here is what you get:

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

In order to get rid of that problem, you must recompile pcsc-lite without the support for LIBHAL. Other problem then arise with for example the fact that the pcsc-lite then doesn't create the /usr/local/pcsc/drivers or /usr/lib/pcsc/drivers directories.

The solution I found was to install the debian packages pcscd and pcsc-omnikey and then to delete the /usr/sbin/pcscd and overwrite it with a compiled version without the libhal support. There are quite some options to give to the ./configure for this, here they are:

./configure --disable-libhal --enable-libusb --enable-usbdropdir=/usr/lib/pcsc/drivers/ --enable-ipcdir=/var/run/pcscd/ --prefix=/usr/ --enable-runpid=/var/run/pcscd/pcscd.pid

Then you just run pcscd:

# /usr/sbin/pcscd -f -d -a

And you'll get a better result ;-)


00000000 pcscdaemon.c:275:main() pcscd set to foreground with debug send to stderr
00000743 debuglog.c:239:DebugLogSetLevel() debug level=debug
00000354 debuglog.c:268:DebugLogSetCategory() Debug options: APDU
00001335 pcscdaemon.c:493:main() pcsc-lite 1.4.101 daemon ready.
00106863 hotplug_libusb.c:476:HPAddHotPluggable() Adding USB device: 001:005
00000499 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
00001266 readerfactory.c:1002:RFBindFunctions() Loading IFD Handler 3.0
OK OMNIKEY CardMan RFID  IA32 v2.6.0 support@omnikey.com
00297640 readerfactory.c:305:RFAddReader() Using the pcscd polling thread
00004511 readerfactory.c:1135:RFInitializeReader() Attempting startup of OMNIKEY CardMan 5x21 00 01 using /usr/lib/pcsc/drivers//ifdokrfid_lnx-2.6.0.bundle/Contents/Linux/ifdokrfid.so
00000523 readerfactory.c:847:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers//ifdokrfid_lnx-2.6.0.bundle/Contents/Linux/ifdokrfid.so
00000448 readerfactory.c:1002:RFBindFunctions() Loading IFD Handler 3.0
OK OMNIKEY CardMan RFID  IA32 v2.6.0 support@omnikey.com

First readings

I approach a Mifare card close to the reader and here is our result:

99999999 eventhandler.c:432:EHStatusHandlerThread() Card inserted into OMNIKEY CardMan 5x21 00 01
00000549 Card ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 0B 00 00 00 00 00 00 63
00922388 eventhandler.c:364:EHStatusHandlerThread() Card Removed From OMNIKEY CardMan 5x21 00 01

phone 800 phone number lookup

rreverse phone lookup consumer reports