1 (edited by washmachine 2013-02-12 19:54:30)

Topic: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

Hello everybody, i juste subscribe to the community, but i often learned a lot reading your posts before. But now i have a problem and maybe you could help me.

I use a raspbian distrib (the last) and a PN532 device for using NFC protocol. I installed the last version of libnfc (libnfc-1.7.0-rc4) and i can't use nfc-list or any other command. I already use some tool  with an other version (libnfc-1.6.0-rc1) and all work perfectly. I used UART and i modified the /libnfc/buses/uart_posix.c to include "ttyAMA", but in the new version no need to do that, it is already include. Great!
So i did : ./configure --with-drivers=pn532_uart
then : make clean   and : make install all
I reboot the Rpi and when i would like to see a tag : nfc-list
it appears that no NFC device found
Do you have any idea to solve my problem?


Thank you

WashMachine

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

Hello,

With 1.7.0, your PN532 UART device needs some configuration in newly introduced configuration file (eg. /etc/nfc/libnfc.conf).

Please read NEWS file, then copy libnfc.conf.sample to the right place (please be sure to put the file in SYSCONFDIR/nfc/libnfc.conf).

To see some debug, you should use libnfc application this way:

<code>
LIBNFC_LOG_LEVEL=3 nfc-list
</code>

Romuald Conty

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

./configure --with-drivers=pn532_uart --enable-serial-autoprobe

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

No, --enable-serial-autoprobe is not relevant anymore. This can not be set at compile-time since 1.7.0-rc1, but can be set at runtime using already mention configuration file.

Romuald Conty

5 (edited by washmachine 2013-02-13 13:08:16)

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

Hello,

- indeed the option : --enable-serial-autoprobe is not usefull anymore.

- i saw this method using the configuration file, but i thought it was a mistake, because after : make install all,
i didn't have the directory /etc/nfc/

This morning i check again, and there is no directory /etc/nfc, no file libnfc.conf.sample, and no /etc/nfc/libnfc.conf

So maybe i do something wrong when i built libnfc1.7.0-rc4. Here what i did :

mkdir libnfc
cd libnfc
cp **/libnfc-1.7.0-rc4.tar.gz   **/libnfc/
tar -xvzf libnfc-1.7.0-rc4.tar.gz
cd libnfc-1.7.0-rc4
./configure --with-drivers=pn532_uart
make clean
make install all

After that, i look into /etc, and don't find nfc/libnfc.conf, and there is no file libnfc.conf.sample in **/libnfc/
Do i have to create this file myself? Or did i do somthing wrong?

Thanks

WashMachine

6 (edited by washmachine 2013-02-14 11:57:14)

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

I tried to debug : 

 
LIBNFC_LOG_LEVEL=3 nfc-list 

 

and i obtained : 

 
info    libnfc.config    Unable to open file : /usr/local/etc/nfc/libnfc.conf
debug   libnfc.config    Unable to open directory : /usr/local/etc/nfc/devices.d
debug   libnfc.general   log_level is set to 3 
debug   libnfc.general   allow_autoscan is set to true 
debug   libnfc.general   allow_intrusive_scan is set to false 
debug   libnfc.general   0 device(s) defined by user 
nfc-list uses libnfc libnfc-1.7.0-rc4 
No NFC device found 

that confirm that i need to edit libnfc.conf, but i don't know why i don't have it. ... 
WashMachine

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

So i tried to create the file libnfc.conf myself and i decomment in it : allow_autoscan=true

i debug again : LIBNFC_LOG_LEVEL=3 nfc-list

the error message seems different for the 2 first lines :

 
info   libnfc.config   Unable to open file : /usr/local/etc/nfc/libnfc.conf 
debug   libnfc.config   Unable to open directory : /usr/local/etc/nfc/devices.d  

Does anyone get an idea??

Thanks 

WashMachine

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

Hello,

You're right, there is no libnfc.conf.sample file in RC4, this file is missing...

That will be fixed in RC5, but right now you can enable your device this way:

tar -xvzf libnfc-1.7.0-rc4.tar.gz
cd libnfc-1.7.0-rc4
sudo cp contrib/libnfc/pn532_uart_on_rpi.conf.sample /usr/local/etc/nfc/devices.d/pn532_uart_on_rpi.conf

Please note that you are able to change /usr/local/etc path to /etc and /usr/local to /usr install prefix using:

./configure --sysconfdir=/etc --prefix=/usr
make clean all
sudo make install
Romuald Conty

9 (edited by washmachine 2013-02-14 13:02:11)

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

ok i check that now

thanks

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

OK thank you rconty !

Problem solved ! ! !

i just use :

./configure --with-drivers=pn532_uart 

And after reboot nfc-list work perfectly !

So topic solved

Re: No NFC device found with libnfc-1.7.0-rc4 on raspberry pi

Fine !

Plus, with this version PN532 usage should be far faster than previous versions.

Romuald Conty