Closed ebradbury closed 5 months ago
Yes that does seem to be an oversight in the original arduino library. I'll can push a patch to specify a bus speed. 100 KHz seems like a pretty significant speed reduction though. Have you tried anything between 1 and 5 MHz?
Haven't heard anything back so I am just going to lower the default speed to 4 MHz.
Thanks for adjusting this!
What happened?
Many people appear to be struggling to get the pn532 module to work over SPI (myself included). I'm using the elechous pn532 v3 with a rpi 5. I was only able to get it to work by decreasing the SPI bus speed in a rather hacky way.
The solution for me was adding
nfc._interface._spi.max_speed_hz = 100000
afternfc.begin()
. Otherwise the device would never connect.Hope that helps someone. Maybe we can make 100kz the default speed or provide an option to adjust the speed in the constructor?
Reproducibility
Always (100% of runs)
Steps to Reproduce
Code to reproduce
Host Controller
Raspberry Pi 5
Python Version
3.11.2
Interface Mode
SPI
Power Supply
Pi 3.3v or 5v
Additional Context
No response