I recently bought this NFC/RFID reader PN532 module V3
I want to use it with my raspberry pi 3. I have install and configured the library libnfc. The PN532 is connected with I2C. I have well enabled it on my RPi.
My problem is that I cannot scan anything. Indeed, when I run the function nfc-poll
in the console, I get this :
nfc-poll uses libnfc 1.7.1
NFC reader: pn532_i2c:/dev/i2c-1 opened
NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations)
nfc_initiator_poll_target: Success
During the poll, I passed near the PN532 a lot of different tags, even those that arrived with it. But there is never any detection. Nevertheless, the RPi seems to communicate correctly with the PN532, as is shown in the second line.
The command i2cdetect -y 1
is well returning :
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The PN532 is wired as follow :
- (PN532 --> RPi3)
- GND --> pin 6
- VCC --> pin 4
- SDA --> pin 3
- SCL --> pin 5
I have checked the wiring (i have well the yellow led ON, and if I remove the SDA or the SCL connection, I get an error message trying nfc-poll
which indicates that the connections are OK)
I have checked the position of the two switchs on the PN532 to enabled I2C communication.
My libnfc configuration file (/etc/nfc/libnfc.conf
) is the following :
# Allow device auto-detection (default: true)
# Note: if this auto-detection is disabled, user has to set manually a device
# configuration using file or environment variable
allow_autoscan = true
# Allow intrusive auto-detection (dehttp://www.jamesrobertson.eu/pages/2014/mar/30/rfid-module.htmlfault: false)
# Warning: intrusive auto-detection can seriously disturb other devices
# This option is not recommended, user should prefer to add manually his device.
allow_intrusive_scan = false
# Set log level (default: error)
# Valid log levels are (in order of verbosity): 0 (none), 1 (error), 2 (info), 3 (debug)
# Note: if you compiled with --enable-debug option, the default log level is "debug"
log_level = 1
# Manually set default device (no default)
# To set a default device, you must set both name and connstring for your device
# Note: if autoscan is enabled, default device will be the first device available in device list.
device.name = "Itead_PN532_I2C"
device.connstring = "pn532_i2c:/dev/i2c-1"
I have tried to set the parameter allow_intrusive_scan
to true
, but it do not change anything.
I have exactly the same problem when using the PN532 wired in SPI mode.
Do you have any idea ? Thank you very much in advance.
pins
2, 3, 4, 6 NOTGPIO
2, 3, 4, 6. They are very different things and the cause of much confusion and many mistakes on the Pi.