-
Notifications
You must be signed in to change notification settings - Fork 46
Using serial with the FTDI cable causes the library to hang when a card is read #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You did not describe in detail what didn't work when you tried using the serial cable. To use serial on a Linux machine, there are a couple of things you might need to do. They are described here: Add your user to the The port might have a different name. If you can't find Remove |
Sorry if it wasn't clear. The guide for the PN532 only shows the FTDI cable being used with LibNFC, not circuit python. I will try the above steps to maybe get LibNFC working. My suggestion was to have an example in circuit python that uses the cable. As I am very new to both python and circuit python I dont know how to implement that (if its even possible). In the simpletest example there are 3 methods to communicate, it would be awesome if USB to serial adapters are added too as a fourth option |
After digging into python, I started to understand the picture better, and decided to try to use a PySerial instance instead of a busio UART instance. The module starts successfully and waits for a card. However, when a card is presented, the code hangs fully. No error message, just nothing. Here's my code:
and here's the output. No further output is received after the card is tapped:
Regarding your suggestions, I tried them but I still get the same output whether for this library or libnfc |
It stops returning even None. I changed the loop to
last lines of output:
|
possibly related to #44 |
Try changing this: ser = serial.Serial("/dev/ttyUSB0", baudrate=115200) to: ser = serial.Serial("/dev/ttyUSB0", baudrate=115200, timeout=0.1) pyserial's default timeout is The library may be trying to read more bytes than being returned. So need the serial timeout to prevent blocking forever. |
Resolved by #63 |
Hello! While im sure there must be a way to do this, I bought the PN532 breakout and an FTDI cable thinking setup would be a breeze. Two days of tinkering later, im pulling my hair (in part due to my inexperience).
The LibNFC part of the official guide is outdated, and I understand why it is. But it seems like this may be the only way to "easily" use the FTDI cable (looking at that project's issue log, im not the only one with issues, and LibNFC seems like it has been abandoned). I was not able to configure it on my raspberry pi to use ttyUSB0, and it no longer supports autoscan. The version used in the guide seems to no longer be compatible with newer OS versions.
To my untrained eye, I think it may not be all too difficult to adapt the simpletest example to talk over the FTDI serial port. My hope is that this would be relatively easy and thus added as an official example without burden, as well as in documentation so that people buying this reader would find it easier than I did.
The text was updated successfully, but these errors were encountered: