1 (edited by Vge0rge 2015-02-16 19:04:58)

Topic: Nfc-eventd - ERROR: NFC device Configuration

Hello all!

I am trying to make nfc-eventd work but without success. First of all, I am using a linux embedded board with an NXP PN532 NFC module. I have successfully installed the libnfc library and the command "nfc-list" seems to work ok ( I can get tag info from the module).
I am now trying to use the nfc-eventd deamon in order to be able to catch tag insert/remove events.
Here is my nfc module entry in /etc/nfc/libnfc.conf file :

device.connstring = "pn532_uart:/dev/ttyS1"

Here is my nfc module entry in /usr/local/etc/nfc-eventd.conf file:

device my_pn532_uart {
                driver = "PN532_UART";
                port = "/dev/ttyS1";
                name = "PN532 NFC module";
                speed = 115200;

In this file I have manually selected this device using the command:

nfc_device = "my_pn532_uart"; 

Every time I am trying to run the nfc-eventd I am getting the following error:

 nfc-eventd 0.1.7
Specified device my_pn532_uart have been found.
nfc-eventd: ERROR: NFC device have been specified in configuration file but there is no device description. Unable to select specified device: my_pn532_uart.
Connected to NFC device: pn532_uart:/dev/ttyS1

I have seen the source code here but I can't figure out why nfc_device_desc is NULL:

  while ( my_device != NULL ) {
            if ( strcmp(my_device->name->data, nfc_device_str) == 0 ) {
                INFO("Specified device %s have been found.", nfc_device_str);
                nfc_device_desc = malloc(sizeof(nfc_device_desc_t));
                nfc_device_desc->pcDriver = (char*)nfcconf_get_str( my_device, "driver", "" );
                char* device_name = (char*)nfcconf_get_str( my_device, "name", "" );
                strncpy(nfc_device_desc->acDevice, device_name, sizeof(nfc_device_desc->acDevice));
                char* device_port   = (char*)nfcconf_get_str( my_device, "port", "" );
                strncpy(nfc_device_desc->acPort, device_port, sizeof(nfc_device_desc->acPort));
                nfc_device_desc->uiSpeed  = nfcconf_get_int( my_device, "speed", 9600 );
                nfc_device_desc->uiBusIndex  = nfcconf_get_int( my_device, "index", 0 );
            my_device = device_list[i];
        DBG( "Found %d device configuration block(s).", i );
        if ( nfc_device_desc == NULL ) {
            ERR("NFC device have been specified

Although it is connected to the pn_532_uart device specified in the  /etc/nfc/libnfc.conf file the tag insert/remove events doesn't seem to be captured.

Thanks in advance for your help!

Re: Nfc-eventd - ERROR: NFC device Configuration


At first, you should be able to run nfc-list successfully. nfc-eventd comes next smile

Romuald Conty

Re: Nfc-eventd - ERROR: NFC device Configuration

Hello rconty!

As I have said, the nfc-list command works great! After some tests I have found that the nfc event works only with the configuration from lib nfc.  I cannot make it work with the nfc-eventd.conf file. Also when I am trying to run the nfc eventd from the command line and put a tag on the nfc antenna I am not taking any output, allthouth it reads the tag and trigger the event because everything I have put in the nem_execute works whenever a tag is inserted!

Any ideas would be really helpfull wink

Re: Nfc-eventd - ERROR: NFC device Configuration


I'm sorry : I read too fast...

nfc-eventd probably needs some update to work correctly with latest libnfc.

Romuald Conty