PN532 Unable to open NFC device

本秂侑毒 提交于 2021-01-29 05:09:50

问题


Hi I'm trying to setup a PN532 reader with libnfc on Ubuntu on my RPi3. I am getting the error:

ERROR:: Unable to open NFC device

preceded by

Invalid serial port: /dev/ttyACM0

I've tried using ttyS0 and ttyAMA0 since I saw those suggested to people who have had the same issue, but nweither of them work.

Any help is appreciated.


回答1:


I'm wrestling with a similar problem on RPi3 using Raspbian. Note that in version three, /dev/ttyACM0 has been redirected to a Bluetooth port, so you probably don't want to use that. I've been successful with wiring to the /dev/ttyS0 port (using TX/RX pins on the GPIO bus) wired to the UART pins on the Adafruit. Set both jumpers on the Adafruit to 0. Make sure to update the /etc/nfc configuration file to point to the /dev/ttyS0, and if libnfc compiles OK according to instructions, you should get a connect.

My problem is that I need to move off of the GPIO /dev/ttyS0 to make room for other hardware, so I bought a USB UART<=>TTL conversion cable from Adafuit so I could connect to the same board through the USB port. Discovered through dmsg that the Linux driver put the new port at /dev/ttyUSB0. Reconfigured libnfc, and re-ran...no connect. Tested the cable with a windows box connected back to /dev/ttyS0, and it worked. Did a loopback between new converter connected to /dev/ttyUSB0 and /dev/ttyS0 using minicom...and it worked (ONLY IF I DISABLED HARDWARE FLOW CONTROL on /dev/ttyUSB0 USING MINICOM). Then I tried nfc-list -v connected to the Adafruit using the /dev/ttyUSB0 ...nothing. Absolutely no connection. Still pulling my hair out.

My best guess is the Linux driver for the cable is hardnailing some UART stuff in the driver for the USB converter and libnfc can't find it or can't open it...but I'm totally guessing. I tried increasing the logging level to 3, libnfc is trying to open /dev/ttyUSB0...but no ACK from the board. No connection.

Hang in there, we'll figure out this beast somehow....



来源:https://stackoverflow.com/questions/43243127/pn532-unable-to-open-nfc-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!