Topic: Compiling libnfc - missing libpcsclite

After succesfully working with a tikitag on windows, I tried compiling it for linux for a bit more flexibility. After installing pcscd, libpcsclite-dev, libusb-dev and compiling libusb (since it wasn't in the repository I was using), I ran into a little problem.

During the configuring of libnfc I get the following error "checking for LIBPCSCLITE... configure: error: libpcsclite is mandatory."

Anyone got any idea how to resolve this?

Re: Compiling libnfc - missing libpcsclite

Hello,

Keasis wrote:

Anyone got any idea how to resolve this?

You must more information if you want some help smile

Which GNU/Linux distribution do you have ?
Which version of this distribution ?

And which version of libnfc do you try to install ?

Optionnaly, could you send me the output of following command line :
pkg-config libpcsclite --libs --cflags

Thanks.

Romuald Conty

Re: Compiling libnfc - missing libpcsclite

It's a custom version of ubuntu for devices on the ARM processors. It is named 'mojo' and is based on a 8.04 hardy. Or hasty, I'm not sure of that. This was made before the 'official' support by ubuntu for ARM procs.

I downloaded the latest source version of libnfc from this site.

I'll send the output in a bit when I get time to get behind my linux box.

Re: Compiling libnfc - missing libpcsclite

Keasis wrote:

It is named 'mojo' and is based on a 8.04 hardy. Or hasty, I'm not sure of that.

It seems to be "Hasty Hippogriff" which is based on  Ubuntu 8.04 'Hardy Heron'

Keasis wrote:

I downloaded the latest source version of libnfc from this site.

Ok, so assume that you download the lastest release 1.2.1

Keasis wrote:

After installing pcscd, libpcsclite-dev, libusb-dev and compiling libusb (since it wasn't in the repository I was using), I ran into a little problem.

If you have installed libusb-dev, this should depends on libusb-0.1-4 or libusb-0.1-udeb which are both in repository according to http://mojo.handhelds.org/files/buildst … plete.html
So your previously compiled libusb is not needed and should be removed to prevent from loading the "wrong" library.

You should also be sure that "pkg-config" is installed (this package is in your repo), after that, I'll need previously requested command line output

pkg-config libpcsclite --libs --cflags

and the complete output of

./configure
Romuald Conty

Re: Compiling libnfc - missing libpcsclite

rconty wrote:

It seems to be "Hasty Hippogriff" which is based on  Ubuntu 8.04 'Hardy Heron'

That is correct. smile

rconty wrote:

Ok, so assume that you download the lastest release 1.2.1

Correct again smile
libnfc 1.2.1
libusb 1.0.3

rconty wrote:

If you have installed libusb-dev, this should depends on libusb-0.1-4 or libusb-0.1-udeb which are both in repository according to http://mojo.handhelds.org/files/buildst … plete.html
So your previously compiled lib is not needed and should be removed to prevent from loading the "wrong" library.

Hmmm, when tried installing with 'libusb' it didn't work, but I didn't check dependancies. Compiling of libusb finished without problems though.


rconty wrote:

You should also be sure that "pkg-config" is installed (this package is in your repo), after that, I'll need previously requested command line output

pkg-config libpcsclite --libs --cflags
$ sudo pkg-config libpcsclite --libs --cflags
-I/usr/include/PCSC  -lpcsclite  

rconty wrote:

and the complete output of

./configure

I'll put that in a seperate post.

Re: Compiling libnfc - missing libpcsclite

ok, weirdest thing just happened. Instead of posting an old ./configure, I decided to run it anew, just incase anything changed.

This time however, it compiled correctly! Only thing that really differed, was the installation of pkg-config (and maybe a reboot or three, but I'm fairly reboot concious, so that shouldn't be the problem)

However, now I ran into another error while executing nfc-mftool.

nfc-mftool: error while loading shared libraries: libnfc.so.0: cannot open shared object file: No such file or directory

This was after a succesful compile and a reboot. I haven't connected any nfc device at the moment.

Any idea what might be causing this?

Next up: testing with a nfc device hooked up and/or reinstallation of packages

Re: Compiling libnfc - missing libpcsclite

And here a full install/configure log.

Installing packages

user@mojo:~$ sudo apt-get install pkg-config
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  pkg-config
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 51.1kB of archives.
After this operation, 152kB of additional disk space will be used.
Get:1 http://repository.handhelds.org hasty/main pkg-config 0.22-1 [51.1kB]
Fetched 51.1kB in 2s (21.5kB/s)    
Selecting previously deselected package pkg-config.
(Reading database ... 43365 files and directories currently installed.)
Unpacking pkg-config (from .../pkg-config_0.22-1_arm.deb) ...
Setting up pkg-config (0.22-1) ...
E: Directory '/var/log/apt/' missing
user@mojo:~$ sudo apt-get install libusb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Couldn't find package libusb
user@mojo:~$ sudo apt-get install libusb-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libusb-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.8kB of archives.
After this operation, 340kB of additional disk space will be used.
Get:1 http://repository.handhelds.org hasty/main libusb-dev 2:0.1.12-8 [37.8kB]
Fetched 37.8kB in 1s (22.1kB/s)    
Selecting previously deselected package libusb-dev.
(Reading database ... 43375 files and directories currently installed.)
Unpacking libusb-dev (from .../libusb-dev_2%3a0.1.12-8_arm.deb) ...
Setting up libusb-dev (2:0.1.12-8) ...

E: Directory '/var/log/apt/' missing
user@mojo:~$ sudo apt-get install pcscd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libccid
The following NEW packages will be installed:
  libccid pcscd
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 169kB of archives.
After this operation, 586kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://repository.handhelds.org hasty/universe libccid 1.3.1-1 [98.2kB]
Get:2 http://repository.handhelds.org hasty/universe pcscd 1.4.99-1ubuntu1 [71.2kB]
Fetched 169kB in 2s (62.2kB/s)
Selecting previously deselected package libccid.
(Reading database ... 43434 files and directories currently installed.)
Unpacking libccid (from .../libccid_1.3.1-1_arm.deb) ...
Selecting previously deselected package pcscd.
Unpacking pcscd (from .../pcscd_1.4.99-1ubuntu1_arm.deb) ...
Setting up libccid (1.3.1-1) ...
 * Restarting PCSC Lite resource manager pcscd                                           [ OK ] 
 * Reloading kernel event manager...                                                     [ OK ] 

Setting up pcscd (1.4.99-1ubuntu1) ...

E: Directory '/var/log/apt/' missing
user@mojo:~$ sudo apt-get install libpcsclite-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libpcsclite-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 54.5kB of archives.
After this operation, 180kB of additional disk space will be used.
Get:1 http://repository.handhelds.org hasty/universe libpcsclite-dev 1.4.99-1ubuntu1 [54.5kB]
Fetched 54.5kB in 1s (32.6kB/s)         
Selecting previously deselected package libpcsclite-dev.
(Reading database ... 43469 files and directories currently installed.)
Unpacking libpcsclite-dev (from .../libpcsclite-dev_1.4.99-1ubuntu1_arm.deb) ...
Setting up libpcsclite-dev (1.4.99-1ubuntu1) ...
E: Directory '/var/log/apt/' missing
user@mojo:~$ wget http://libnfc.googlecode.com/files/libnfc-1.2.1.tar.gz
--14:58:55--  http://libnfc.googlecode.com/files/libnfc-1.2.1.tar.gz
           => `libnfc-1.2.1.tar.gz'
Resolving libnfc.googlecode.com... 74.125.79.82
Connecting to libnfc.googlecode.com|74.125.79.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 306,121 (299K) [application/x-gzip]

100%[====================================================>] 306,121      359.25K/s             

14:58:56 (358.49 KB/s) - `libnfc-1.2.1.tar.gz' saved [306121/306121]

user@mojo:~$ tar -xvzf libnfc-1.2.1.tar.gz
libnfc-1.2.1/
libnfc-1.2.1/config.sub
libnfc-1.2.1/install-sh
libnfc-1.2.1/missing
libnfc-1.2.1/src/
libnfc-1.2.1/src/devices.h
libnfc-1.2.1/src/mftool.c
libnfc-1.2.1/src/nfc-mftool.1
libnfc-1.2.1/src/relay.c
libnfc-1.2.1/src/list.c
libnfc-1.2.1/src/libnfc.c
libnfc-1.2.1/src/bitutils.h
libnfc-1.2.1/src/nfc-emulate.1
libnfc-1.2.1/src/bitutils.c
libnfc-1.2.1/src/dev_pn531.c
libnfc-1.2.1/src/rs232.h
libnfc-1.2.1/src/dev_arygon.c
libnfc-1.2.1/src/dev_pn533.h
libnfc-1.2.1/src/Makefile.am
libnfc-1.2.1/src/nfc-anticol.1
libnfc-1.2.1/src/emulate.c
libnfc-1.2.1/src/nfc-list.1
libnfc-1.2.1/src/dev_pn533.c
libnfc-1.2.1/src/mifaretag.h
libnfc-1.2.1/src/defines.h
libnfc-1.2.1/src/dev_arygon.h
libnfc-1.2.1/src/dev_pn531.h
libnfc-1.2.1/src/Makefile.in
libnfc-1.2.1/src/nfc-relay.1
libnfc-1.2.1/src/dev_acr122.h
libnfc-1.2.1/src/rs232.c
libnfc-1.2.1/src/dev_acr122.c
libnfc-1.2.1/src/anticol.c
libnfc-1.2.1/src/types.h
libnfc-1.2.1/src/libnfc.h
libnfc-1.2.1/depcomp
libnfc-1.2.1/configure
libnfc-1.2.1/config.guess
libnfc-1.2.1/INSTALL
libnfc-1.2.1/NEWS
libnfc-1.2.1/configure.ac
libnfc-1.2.1/Makefile.am
libnfc-1.2.1/config.h.in
libnfc-1.2.1/ChangeLog
libnfc-1.2.1/ltmain.sh
libnfc-1.2.1/libnfc.pc.in
libnfc-1.2.1/AUTHORS
libnfc-1.2.1/aclocal.m4
libnfc-1.2.1/README
libnfc-1.2.1/COPYING
libnfc-1.2.1/Makefile.in
user@mojo:~$ cd libnfc*
user@mojo:~/libnfc-1.2.1$ dir
aclocal.m4  config.guess  configure    depcomp     libnfc.pc.in  Makefile.in  README
AUTHORS     config.h.in   configure.ac    INSTALL     ltmain.sh      missing      src
ChangeLog   config.sub      COPYING    install-sh  Makefile.am   NEWS

./configure of libnfc-1.2.1

user@mojo:~/libnfc-1.2.1$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... armv6l-unknown-linux-gnueabi
checking host system type... armv6l-unknown-linux-gnueabi
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ranlib... (cached) ranlib
checking for pkg-config... /usr/bin/pkg-config
checking for ANSI C header files... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdbool.h... (cached) yes
checking usb.h usability... yes
checking usb.h presence... yes
checking for usb.h... yes
checking for size_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for int32_t... yes
checking for pcsc-lite support... yes
checking for debug flag... no
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB... yes
checking for LIBPCSCLITE... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating libnfc.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Re: Compiling libnfc - missing libpcsclite

issue: missing libusb
fixed by dependancy libusb-dev

issue: missing LIBPCSCLITE
fixed by installing pkg-config?

current issue: linked library missing libnfc.so.*
probably fixed by correctly linking the /usr/local/lib

nfc-mftool: error while loading shared libraries: libnfc.so.0: cannot open shared object file: No such file or directory

This one I can actually guess. The path is just not known to the system, so nfc-mftool cannot call on the library. I'll link it up in a bit and retry.

So I think most problems weren't that big, just the lack of pkg-config and the weird distro I'm using at the moment. When I get it working I'll type out a guide for other users of mojo/hasty.

I have to take off for a bit, but I'll post wheter I'm succesful or not.

Gratz rconty for all your help so far.

Re: Compiling libnfc - missing libpcsclite

And just as I expected,

$sudo ldconfig

fixed library linking problem!

It seemed the libraries were there, just not linked to. After checking the folders and finding the actual files there, I suspected as much,

So now, what seems in order so far:
Compiled libnfc
sudo /etc/init.d/pcsc start
nfc-mftool runs without syntaxes and gives the normal output (manpage)

However now on the input of syntaxes, or when using nfc-anticol / nfc-list, the program/console doesn't output anything. It just 'hangs' waiting for something. I have to manually stop the process with ctrl+c.

I think this is the last hurdle, can't think of anything I missed.
Any suggestions would be great.

user@mojo:~$ sudo /etc/init.d/pcscd restart
 * Restarting PCSC Lite resource manager pcscd                                           [ OK ] 
user@mojo:~$ nfc-list
<hangs>
user@mojo:~$ nfc-anticol
<hangs>

Last edited by Keasis (2009-09-10 14:18:20)

Re: Compiling libnfc - missing libpcsclite

Hey Keasis,

Keasis wrote:

issue: missing libusb
fixed by dependancy libusb-dev

Right: libusb-dev would install libusb-0.1-4 on your distro, IMHO.

Keasis wrote:

issue: missing LIBPCSCLITE
fixed by installing pkg-config?

Exact: ./configure use pkg-config to check if PCSC-lite is installed.

Keasis wrote:

And just as I expected,

$sudo ldconfig

fixed library linking problem!

Good to ear smile

Keasis wrote:

the program/console doesn't output anything. It just 'hangs' waiting for something. I have to manually stop the process with ctrl+c.

Humm.. That's weird but there are ways to debug.
First, you could recompile libnfc with debug mode enabled. To do this, on top libnfc source directory:

make clean
./configure --enable-debug
make
sudo make install

Now, when you run nfc-list for example, you should have more debug information.

Second, you could run pcscd in debug mode too :

sudo /etc/init.d/pcscd stop
pcscd --foreground --debug

If theses outputs haven't enought sense for you, feel free to copy/paste here.

Hope it helps.

--
Romuald

Romuald Conty

Re: Compiling libnfc - missing libpcsclite

output of $sudo pcscd --foreground --debug

user@mojo:~$ sudo pcscd --foreground --debug
00000000 pcscdaemon.c:295:main() pcscd set to foreground with debug send to stde                                                                             rr
00001381 debuglog.c:236:DebugLogSetLevel() debug level=debug
00008824 pcscdaemon.c:513:main() pcsc-lite 1.4.99 daemon ready.
^[[A^[[A^[[A10448255 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload s                                                                             erial configuration
00003174 hotplug_libusb.c:478:HPAddHotPluggable() Adding USB device: 001:002
00000364 readerfactory.c:1116:RFInitializeReader() Attempting startup of ACS ACR                                                                              38U-CCID 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libcc                                                                             id.so.1.3.1
00011049 readerfactory.c:983:RFBindFunctions() Loading IFD Handler 3.0
00004575 ifdhandler.c:1239:init_driver() LogLevel: 0x0003
00003239 ifdhandler.c:1249:init_driver() DriverOptions: 0x0000
00000660 ifdhandler.c:77:IFDHCreateChannelByName() lun: 0, device: usb:072f/90cc                                                                             :libusb:001:002
00005665 ccid_usb.c:233:OpenUSBByName() Manufacturer: Ludovic Rousseau (ludovic.                                                                             rousseau@free.fr)
00013200 ccid_usb.c:243:OpenUSBByName() ProductString: Generic CCID driver v1.3.                                                                             1
00002959 ccid_usb.c:249:OpenUSBByName() Copyright: This driver is protected by t                                                                             erms of the GNU Lesser General Public License version 2.1, or (at your option) a                                                                             ny later version.
00591283 ccid_usb.c:397:OpenUSBByName() Found Vendor/Product: 072F/90CC (ACS ACR                                                                              38U-CCID)
00001261 ccid_usb.c:399:OpenUSBByName() Using USB bus/device: 001/002
00002377 ccid_usb.c:752:get_data_rates() IFD does not support GET_DATA_RATES req                                                                             uest: Success
00016192 ifdhandler.c:841:IFDHPowerICC() lun: 0, action: PowerUp
00050924 Card ATR: 3B BE 96 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00
00003880 ifdhandler.c:271:IFDHGetCapabilities() lun: 0, tag: 0xFAE
00001188 ifdhandler.c:313:IFDHGetCapabilities() Reader supports 1 slot(s)
00001757 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial co                                                                             nfiguration
00002404 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload serial config                                                                             uration
00004853 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial co                                                                             nfiguration
00001307 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload serial config                                                                             uration
00004393 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial co                                                                             nfiguration
00001282 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload serial config                                                                             uration
00004777 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial co                                                                             nfiguration

Re: Compiling libnfc - missing libpcsclite

Keasis wrote:

output of $sudo pcscd --foreground --debug

Ok, fine, it seems to work. Keep this running and launch nfc-list (for example) in another shell.

Could you paste both logs: pcscd's log will grow and the command output, please ?

Romuald Conty

Re: Compiling libnfc - missing libpcsclite

After calling nfc-list

13967079 winscard_msg_srv.c:217:SHMProcessEventsServer() Common channel packet arrival
00000411 winscard_msg_srv.c:226:SHMProcessEventsServer() SHMProcessCommonChannelRequest detects: 8
00000197 pcscdaemon.c:175:SVCServiceRunLoop() A new context thread creation is requested: 8
00002060 winscard_svc.c:131:ContextThread() Thread is started: 8
00003496 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 8
00000224 winscard_svc.c:179:ContextThread() Client is protocol version 3:0
00004950 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 8
00000676 winscard.c:242:SCardEstablishContext() Establishing Context: 17009677
00016520 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 8
00000298 winscard.c:298:SCardConnect() Attempting Connect to ACS ACR 38U-CCID 00 00 using protocol: 3
00001757 prothandler.c:130:PHSetProtocol() Attempting PTS to T=0
00000277 ifdhandler.c:418:IFDHSetProtocolParameters() lun: 0, protocol T=0
00017188 winscard.c:433:SCardConnect() Active Protocol: T=0
00000239 winscard.c:443:SCardConnect() hCard Identity: 12d06
00405015 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 8
00000235 winscard.c:1610:SCardTransmit() Send Protocol: T=0
00000179 ifdhandler.c:948:IFDHTransmitToICC() lun: 0

hangs for a while

50388523 ccid_usb.c:476:WriteUSB() usb_bulk_write(001/002): No such device
00000154 ifdwrapper.c:494:IFDStatusICC() Card not transacted: 617
00000505 pcscdaemon.c:83:SendHotplugSignal() Send hotplug signal to pcscd (pid=1775)
00000211 eventhandler.c:316:EHStatusHandlerThread() Error communicating to: ACS ACR 38U-CCID 00 00
00001155 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload serial configuration
00001450 hotplug_libusb.c:538:HPRemoveHotPluggable() Removing USB device[0]: 001:002
00000143 eventhandler.c:120:EHDestroyEventHandler() Stomping thread.
00401369 ccid_usb.c:476:WriteUSB() usb_bulk_write(001/002): No such device
00000152 ifdwrapper.c:494:IFDStatusICC() Card not transacted: 617
00000470 pcscdaemon.c:83:SendHotplugSignal() Send hotplug signal to pcscd (pid=1775)
00000168 eventhandler.c:316:EHStatusHandlerThread() Error communicating to: ACS ACR 38U-CCID 00 00
00033991 eventhandler.c:148:EHDestroyEventHandler() Thread stomped.
00000151 readerfactory.c:1167:RFUnInitializeReader() Attempting shutdown of ACS ACR 38U-CCID 00 00.
00000103 ifdhandler.c:222:IFDHCloseChannel() lun: 0
00000201 ccid_usb.c:476:WriteUSB() usb_bulk_write(001/002): No such device
00000346 readerfactory.c:1028:RFUnloadReader() Unloading reader driver.
00000940 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial configuration
00000159 hotplug_libusb.c:430:HPEstablishUSBNotifications() Reload serial configuration
00001907 hotplug_libusb.c:433:HPEstablishUSBNotifications() End reload serial configuration

At this point nfc-list still hangs in the other console.

Re: Compiling libnfc - missing libpcsclite

A small update. I still haven't been able to pinpoint the problem, I didn't have much time to experiment aswell. One thing I noticed is that on the reader, the light stays on (instead of alternating between on/off, as it does with the win binaries).

rconty (or roel perhaps?), you have any suggestions to try out? I'm going to try and compile most things from the latests versions soon, and it'll probably magically fix the issue; however, then we'll never find out what was wrong smile

(besides from me using a weird-ass device to do my linux bussiness on tongue)

Re: Compiling libnfc - missing libpcsclite

Hey, sorry

Keasis wrote:

rconty (or roel perhaps?), you have any suggestions to try out?

According to your pcsc debug trace, this package (or CCID package) is too old to support your reader.
So, you could fix it many ways :
* Upgrade your distribution version (if possible)
* Or found a new repository which provide updated package for your dist (if possible)
* Or rebuild a new package from debian (or ubuntu) packages updated sources. (suggested)
* Or compile and install "by hands" equivalent of packages : pcscd, libpcsclite and libccid (last chance wink )

Keasis wrote:

I'm going to try and compile most things from the latests versions soon, and it'll probably magically fix the issue; however, then we'll never find out what was wrong smile

You don't need (and it is not recommanded at this time) to fetch development version of libnfc.
I have tested libnfc 1.2.1 with libpcsclite/pcscd 1.5.5 and ccid 1.3.11: it compile and runs fine.

Hope it helps.

Romuald Conty

Re: Compiling libnfc - missing libpcsclite

rconty wrote:

Hey, sorry
According to your pcsc debug trace, this package (or CCID package) is too old to support your reader.
So, you could fix it many ways :
* Upgrade your distribution version (if possible)
* Or found a new repository which provide updated package for your dist (if possible)
* Or rebuild a new package from debian (or ubuntu) packages updated sources. (suggested)
* Or compile and install "by hands" equivalent of packages : pcscd, libpcsclite and libccid (last chance wink )

1) unfortunately, that depends on the manufacturer of the device. (smartdevices inc.) no source has been released as of yet. Or untill Mer finally reaches a usuable edition. (currently @ v0.15)
2) Specific repos are rare.
3+4) I suspected that libccid might be the problem, however the version in the repo is 1.3.1. Which should support the tikitag.

rconty wrote:

You don't need (and it is not recommanded at this time) to fetch development version of libnfc.
I have tested libnfc 1.2.1 with libpcsclite/pcscd 1.5.5 and ccid 1.3.11: it compile and runs fine.

I wasn't planning on getting the development versions, just the latest sources and compiling most parts on the system itself. I just did this for libccid, but it didn't work after all.

Anyway, what I did so far:

Compiled libccid (probably not needed since the v1.3 was in the repo)
Compiled libnfc with debug options.

output of nfc-list debug

user@mojo:~$ nfc-list
Found the following PCSC device(s)
- ACS ACR 38U-CCID 00 00
Tx: ff  00  00  00  04  d4  06  00  00  

output of pcscd debug

user@mojo:~$ sudo /etc/init.d/pcscd stop
user@mojo:~$ sudo pcscd --foreground --debug
00000000 pcscdaemon.c:295:main() pcscd set to foreground with debug send to stderr
00000597 debuglog.c:236:DebugLogSetLevel() debug level=debug
00006041 pcscdaemon.c:513:main() pcsc-lite 1.4.99 daemon ready.
02262038 hotplug_libusb.c:478:HPAddHotPluggable() Adding USB device: 001:003
00000398 readerfactory.c:1116:RFInitializeReader() Attempting startup of ACS ACR 38U-CCID 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00017339 readerfactory.c:983:RFBindFunctions() Loading IFD Handler 3.0
00001244 ifdhandler.c:1532:init_driver() Driver version: 1.3.11
00004307 ifdhandler.c:1545:init_driver() LogLevel: 0x0003
00033750 ifdhandler.c:1565:init_driver() DriverOptions: 0x0000
00000475 ifdhandler.c:82:IFDHCreateChannelByName() lun: 0, device: usb:072f/90cc:libusb:001:003
00011118 ccid_usb.c:285:OpenUSBByName() Manufacturer: Ludovic Rousseau (ludovic.rousseau@free.fr)
00003310 ccid_usb.c:295:OpenUSBByName() ProductString: Generic CCID driver
00016456 ccid_usb.c:301:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
00565099 ccid_usb.c:501:OpenUSBByName() Found Vendor/Product: 072F/90CC (ACS ACR 38U-CCID)
00000494 ccid_usb.c:503:OpenUSBByName() Using USB bus/device: 001/003
00001036 ccid_usb.c:893:get_data_rates() IFD does not support GET_DATA_RATES request: Success
00050734 ifdhandler.c:1043:IFDHPowerICC() action: PowerUp, usb:072f/90cc:libusb:001:003 (lun: 0)
00055122 Card ATR: 3B BE 96 00 00 41 03 00 00 00 00 00 00 00 00 00 02 90 00 
00010163 ifdhandler.c:364:IFDHGetCapabilities() tag: 0xFAE, usb:072f/90cc:libusb:001:003 (lun: 0)
00000129 ifdhandler.c:418:IFDHGetCapabilities() Reader supports 1 slot(s)
00000145 hotplug_libusb.c:402:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead.
00000099 hotplug_libusb.c:411:HPEstablishUSBNotifications() Polling forced every 1 second(s)
10302725 winscard_msg_srv.c:217:SHMProcessEventsServer() Common channel packet arrival
00000428 winscard_msg_srv.c:226:SHMProcessEventsServer() SHMProcessCommonChannelRequest detects: 6
00000199 pcscdaemon.c:175:SVCServiceRunLoop() A new context thread creation is requested: 6
00000933 winscard_svc.c:131:ContextThread() Thread is started: 6
00001956 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 6
00000230 winscard_svc.c:179:ContextThread() Client is protocol version 3:0
00003370 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 6
00000582 winscard.c:242:SCardEstablishContext() Establishing Context: 17038016
00029989 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 6
00000178 winscard.c:298:SCardConnect() Attempting Connect to ACS ACR 38U-CCID 00 00 using protocol: 3
00000123 prothandler.c:130:PHSetProtocol() Attempting PTS to T=0
00000160 ifdhandler.c:581:IFDHSetProtocolParameters() protocol T=0, usb:072f/90cc:libusb:001:003 (lun: 0)
00015516 winscard.c:433:SCardConnect() Active Protocol: T=0
00000140 winscard.c:443:SCardConnect() hCard Identity: 1c6af
00403380 winscard_msg_srv.c:288:SHMProcessEventsContext() correctly processed client: 6
00000152 winscard.c:1610:SCardTransmit() Send Protocol: T=0
00000113 ifdhandler.c:1170:IFDHTransmitToICC() usb:072f/90cc:libusb:001:003 (lun: 0)

Last edited by Keasis (2009-09-20 18:16:34)

Re: Compiling libnfc - missing libpcsclite

Keasis wrote:

1) unfortunately, that depends on the manufacturer of the device. (smartdevices inc.) no source has been released as of yet. Or untill Mer finally reaches a usuable edition. (currently @ v0.15)

And then something I never expected. Just as I posted this, another version of the OS was realized just now. Based on Karmic Koala and armel architecture (instead of arm). This changes a LOT.

I'll be running some tests coming week. Don't bother with the above issues, these are moot now.

Re: Compiling libnfc - missing libpcsclite

Hello,

Keasis wrote:

And then something I never expected. Just as I posted this, another version of the OS was realized just now. Based on Karmic Koala and armel architecture (instead of arm). This changes a LOT.

Great. Let us know how this new release work with libnfc.
Thanks.

Romuald Conty

Re: Compiling libnfc - missing libpcsclite

It worked perfectly. All the packages installed without problems and were up-to-date. If I had known the new OS was around the corner, I wouldn't have wasted so much time on it (or yours for that matter).

Connected to NFC reader: ACR122U102 - PN532 v1.4 (0x07)

The following (NFC) ISO14443A tag was found:

    ATQA (SENS_RES): 00  44  
       UID (NFCID1): 04  7d  35  b9  23  25  80  
      SAK (SEL_RES): 00 

Succes! Thanks for all the help, regardless. I have learned a lot from it.

Re: Compiling libnfc - missing libpcsclite

Hi Keasis,

Keasis wrote:

It worked perfectly. [...]

Great : That's a very good news. If you made some projects based on libnfc, feel free to post in "External Projects that use libnfc" section.


Keasis wrote:

Succes! Thanks for all the help, regardless. I have learned a lot from it.

My pleasure.. Thanks for having take time to try and test purposed solutions and clearly report them.

Unfortunately, we haven't really found the problem... Probably too old CCID version and/or PCSC-lite version.

Romuald Conty