nfc-tools / libnfc

Platform independent Near Field Communication (NFC) library
http://nfc-tools.org
GNU Lesser General Public License v3.0
1.67k stars 439 forks source link

nfc-list produces "nfc_initiator_init: Timeout" #528

Closed mvanaltvorst closed 5 years ago

mvanaltvorst commented 5 years ago

I'm on the latest commit, version 1.7.1, Arch Linux. I configured my compilation with ./configure --with-drivers=pn532_uart --sysconfdir=/etc --prefix=/usr --enable-serial-autoprobe.

LIBNFC_LOG_LEVEL=3 nfc-list produces the following output:

nfc-list uses libnfc libnfc-1.7.1-211-g7ca85a0
debug   libnfc.config   key: [device.name], value: [myDevice]
debug   libnfc.config   key: [device.connstring], value: [pn532_uart:/dev/ttyUSB0]
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  1 device(s) defined by user
debug   libnfc.general    #0 name: "myDevice", connstring: "pn532_uart:/dev/ttyUSB0"
debug   libnfc.driver.pn532_uart    Attempt to open: /dev/ttyUSB0 at 115200 baud.
debug   libnfc.bus.uart Serial port speed requested to be set to 115200 baud.
debug   libnfc.chip.pn53x   Diagnose
debug   libnfc.chip.pn53x   Timeout value: 500
debug   libnfc.bus.uart TX: 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
debug   libnfc.chip.pn53x   SAMConfiguration
debug   libnfc.chip.pn53x   Timeout value: 1000
debug   libnfc.bus.uart TX: 00 00 ff 03 fd d4 14 01 17 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 02 fe 
debug   libnfc.bus.uart RX: d5 15 
debug   libnfc.bus.uart RX: 16 00 
debug   libnfc.bus.uart TX: 00 00 ff 09 f7 d4 00 00 6c 69 62 6e 66 63 be 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 09 f7 
debug   libnfc.bus.uart RX: d5 01 
debug   libnfc.bus.uart RX: 00 6c 69 62 6e 66 63 
debug   libnfc.bus.uart RX: bc 00 
debug   libnfc.chip.pn53x   GetFirmwareVersion
debug   libnfc.bus.uart TX: 00 00 ff 02 fe d4 02 2a 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 06 fa 
debug   libnfc.bus.uart RX: d5 03 
debug   libnfc.bus.uart RX: 32 01 06 07 
debug   libnfc.bus.uart RX: e8 00 
debug   libnfc.chip.pn53x   SetParameters
debug   libnfc.bus.uart TX: 00 00 ff 03 fd d4 12 14 06 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 02 fe 
debug   libnfc.bus.uart RX: d5 13 
debug   libnfc.bus.uart RX: 18 00 
debug   libnfc.general  "myDevice" (pn532_uart:/dev/ttyUSB0) has been claimed.
debug   libnfc.chip.pn53x   ReadRegister
debug   libnfc.bus.uart TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 07 f9 
debug   libnfc.bus.uart RX: d5 07 
debug   libnfc.bus.uart RX: 00 00 00 00 00 
debug   libnfc.bus.uart RX: 24 00 
debug   libnfc.chip.pn53x   PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
debug   libnfc.chip.pn53x   PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
debug   libnfc.chip.pn53x   WriteRegister
debug   libnfc.bus.uart TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 02 fe 
debug   libnfc.bus.uart RX: d5 09 
debug   libnfc.bus.uart RX: 22 00 
debug   libnfc.chip.pn53x   RFConfiguration
debug   libnfc.bus.uart TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart RX: 00 00 ff 02 fe 
debug   libnfc.bus.uart RX: d5 33 
debug   libnfc.bus.uart RX: f8 00 
debug   libnfc.chip.pn53x   RFConfiguration
debug   libnfc.bus.uart TX: 00 00 ff 04 fc d4 32 01 01 f8 00 
debug   libnfc.bus.uart RX: 00 00 ff 00 ff 00 
debug   libnfc.chip.pn53x   PN53x ACKed
debug   libnfc.bus.uart Timeout!
nfc_initiator_init: Timeout

As you can see libnfc communicates with the PN532 at first, but then it times out. I've checked my connections and I'm pretty sure they're fine. What am I doing wrong?

mvanaltvorst commented 5 years ago

Fixed by supplying 5V to VCC instead of 3.3V.