NFC Shield for Arduino - PN532 & LibNFC

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

ok thank you,

Any ideas of my problem ? What kind of command can I do to test the cable or my wire or the shield ?!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

I consulted our PN532 expert, and he seems to think that this is a driver problem with your USB/Serial adapter. That's why you're seeing this error:
nfc-list: ERROR: Unable to open NFC device: pn532_uart:/dev/ttyUSB0

Does this command show the device?

Code: Select all

ls /dev/ttyUSB*

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

No problem with the driver (see the dmesg output).

So I think it's about my connections between the wires and the shield.
But what can I do better to make it work ?

(sorry for the delay of the answer)

lsusb output :

Code: Select all

Bus 002 Device 104: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6001 FT232 USB-Serial (UART) IC
  bcdDevice            6.00
  iManufacturer           1 FTDI
  iProduct                2 USB <-> Serial Cable
  iSerial                 3 AFU7ZWK8
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    BANNED              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              2 USB <-> Serial Cable
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)
dmesg output :

Code: Select all

 # dmesg
[35815.125199] usb 2-1.2: new full-speed USB device number 104 using ehci-pci
[35815.224696] usb 2-1.2: New USB device found, idVendor=0403, idProduct=6001
[35815.224700] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[35815.224703] usb 2-1.2: Product: USB <-> Serial Cable
[35815.224705] usb 2-1.2: Manufacturer: FTDI
[35815.224707] usb 2-1.2: SerialNumber: AFU7ZWK8
[35815.261058] usbcore: registered new interface driver usbserial
[35815.261090] usbcore: registered new interface driver usbserial_generic
[35815.261138] usbserial: USB Serial support registered for generic
[35815.262516] usbcore: registered new interface driver ftdi_sio
[35815.262536] usbserial: USB Serial support registered for FTDI USB Serial Device
[35815.262688] ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
[35815.262731] usb 2-1.2: Detected FT232RL
[35815.262734] usb 2-1.2: Number of endpoints 2
[35815.262737] usb 2-1.2: Endpoint 1 MaxPacketSize 64
[35815.262739] usb 2-1.2: Endpoint 2 MaxPacketSize 64
[35815.262741] usb 2-1.2: Setting MaxPacketSize 64
[35815.263171] usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
[35816.540852] SGI XFS with ACLs, security attributes, realtime, large block/inode numbers, no debug enabled
[35816.544241] JFS: nTxBlock = 8192, nTxLock = 65536
[35816.553383] NTFS driver 2.1.30 [Flags: R/W MODULE].
[35816.561906] QNX4 filesystem 0.2.3 registered.
[35816.565840] xor: automatically using best checksumming function:
[35816.604916]    avx       : 22802.000 MB/sec
[35816.672913] raid6: sse2x1    6423 MB/s
[35816.740903] raid6: sse2x2    7916 MB/s
[35816.808889] raid6: sse2x4    9000 MB/s
[35816.808891] raid6: using algorithm sse2x4 (9000 MB/s)
[35816.808893] raid6: using ssse3x2 recovery algorithm
[35816.814643] bio: create slab <bio-1> at 1
[35816.814795] Btrfs loaded
[35817.010506] device-mapper: uevent: version 1.0.3
[35817.010587] device-mapper: ioctl: 4.24.0-ioctl (2013-01-15) initialised: [email protected]

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

I add that I'm using a 5V FTDI friends, but I power it through the arduino. And connect the ground wire to the black cable of the FTDI friend.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

I can't open your pictures anymore - they want me to log in to something. Can you post them here? Use the "Upload Attachment" tab.

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

Ok, sorry about that.

> Just to let you know, I tried TX / RX on the yellow cable and orange (vice verca too), and on the brown and red.
Attachments
IMG_20131008_231524_resize.jpg
IMG_20131008_231524_resize.jpg (101.81 KiB) Viewed 1961 times
IMG_20131008_231635_resize.jpg
IMG_20131008_231635_resize.jpg (126.06 KiB) Viewed 1961 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

I think the problem is your FTDI cable. You should be able to run

Code: Select all

cat /dev/ttyUSB0
and see serial data show up in your terminal window. I just tried that with the same cable you are using, and got nothing.

I then tried the same thing with this 4-pin cable: http://www.adafruit.com/products/954 , and got the expected results.

The only difference is that the six-pin cable has two handshaking lines, RTS and CTS. I tried grounding those, powering those, and shorting them together, but I still got nothing. I have no explanation - it should work, but it doesn't. I must be missing something, but I don't know what.

You can try it. I just wrote a little sketch to print out "Hello" in the loop. I attached the cable to arduino TX. I even tried powering the arduino from the cable's 5V and GND.

Code: Select all

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  Serial.println("Hello!");
  delay(500);
}
As I said, it works with the 4-pin cable, but not with the 6-pin.

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

Ok :)

Great thanks to you !

I'm gonna get another FTDI cable.

Thank you.

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

Same problem with my new cable.

I verify my solders, with a multimeter, and I close the SEL0 and open the SEL1.

The pins are Ok, but still have the Timeout :(

I tried to search the datasheet http://www.adafruit.com/datasheets/PN53 ... c_v1.0.pdf

But there is only the one of the breakout board and not the shield.

Is it the SEL0 close and SEL1 open ?
Is it the SS for RX (uart) and MOSI for TX ?

I see in the datasheet it should be the pin24 (P30/UART_RX), and the pin 28!?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

SEL0 closed, SEL1 open
Connect MOSI/SDA to RX pin of cable
Connect NSS/SCL to TX pin of cable

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

I begin to lose hope of making it work.
I attached two pics. I really don't get what I'm doing wrong.
I double checked my solders with a multimeters.

Can it be about the libnfc ? I downloaded the source libnfc-1.7.0-rc7.tar.gz and compile it for the pn532_uart.
Attachments
back_board.jpg
back_board.jpg (105.51 KiB) Viewed 1804 times
Front_board.jpg
Front_board.jpg (122.92 KiB) Viewed 1804 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

I seem to recall some incompatibility with libnfc-1.7. You may want to downgrade to an earlier version.

What operating system are you using? We have some specific instructions for linux and MacOSX here:
http://learn.adafruit.com/adafruit-pn53 ... nfc/libnfc

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

I'm under Debian Jessie (linux).

I'm gonna try this evening with an earlier version then.

Thank you for your answer.

rkadeFR
 
Posts: 15
Joined: Thu May 16, 2013 5:33 pm

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by rkadeFR »

nothing changed :(

If you have any other hint ? ideas ?

Version 1.7.0

Code: Select all

 # ./nfc-poll 
/root/Projects/libnfc-1.7.0/examples/.libs/lt-nfc-poll uses libnfc 1.7.0
pn53x_check_communication: Timeout
lt-nfc-poll: ERROR: Unable to open NFC device.
Version 1.6.0.1

Code: Select all

# ./nfc-
nfc-anticol             nfc-dep-target          nfc-emulate-tag         nfc-poll
nfc-dep-initiator       nfc-emulate-forum-tag2  nfc-emulate-uid         nfc-relay
# ./nfc-poll 
/root/Projects/libnfc-1.6.0-rc1/examples/.libs/lt-nfc-poll uses libnfc 1.6.0-rc1 (r1326)
lt-nfc-poll: ERROR: Unable to open NFC device.
Version 1.5.1

Code: Select all

 # ./nfc-poll 
/root/Projects/libnfc-1.5.1/examples/.libs/lt-nfc-poll uses libnfc 1.5.1 (r1175)
pn53x_check_communication: Operation timed-out
No NFC device found.
Version 1.4.0

Code: Select all

 # ./nfc-list 
/root/Projects/libnfc-1.4.0/examples/.libs/lt-nfc-list use libnfc 1.4.0 (r833)
lt-nfc-list: ERROR: Unable to wakeup the PN532.
lt-nfc-list: ERROR: Unable to receive data. (RX)
No NFC device found.
Version 1.3.2

Code: Select all

 # ./nfc-list 
/root/Projects/libnfc-1.3.2/src/examples/.libs/lt-nfc-list use libnfc 1.3.2 (r294)
ERROR: Unable to receive data. (RX)
ERROR: Unable to connect to NFC device.
and it's not the cable. Neither the solder...

Code: Select all

[149145.516467] usb 2-1.1.1.4: new full-speed USB device number 53 using ehci-pci
[149145.609789] usb 2-1.1.1.4: New USB device found, idVendor=067b, idProduct=2303
[149145.609802] usb 2-1.1.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[149145.609808] usb 2-1.1.1.4: Product: USB-Serial Controller
[149145.609814] usb 2-1.1.1.4: Manufacturer: Prolific Technology Inc.
[149145.610182] pl2303 2-1.1.1.4:1.0: pl2303 converter detected
[149145.611835] usb 2-1.1.1.4: pl2303 converter now attached to ttyUSB0

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield for Arduino - PN532 & LibNFC

Post by adafruit_support_rick »

I don't think you posted any pictures of the soldering on RX and TX. The solders on some of your other pins look a little solder-starved. Post a picture of RX and TX.

Also, you should have a ground connection from the FTDI to the shield.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”