1

I have pn532 nfc module v3 connected to my Raspberry Pi 4 and I am having some troubles to set it up.
I would appreciate some help from a more expert fellow in the field, I think this is not such an unusual problem but I've been trying to figure it out how to solve it for two days and I didn't get anything.

I am using the next GPIOs in the Pi4:
NFC module pin -> Pi GPIO physical pin
GND -> 6
VCC -> 1
SDA -> 3
SCL -> 5

When running the i2cdetect -y 1 command I get the correct output:

     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: -- -- -- -- -- -- -- --    

But if I repeat the command I get:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                                
00:          -- -- -- -- -- -- -- -- -- -- -- -- --                                
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                                
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
70: -- -- -- -- -- -- -- --  

In addition, when running nfc-poll I get the next error:

error:  
nfc-poll uses libnfc 1.7.1  
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 expected).  
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)  
pn53x_check_communication: Input / Output Error  
error   libnfc.bus.i2c  Error: wrote only -1 bytes (10 
expected).    
error   libnfc.driver.pn532_i2c Unable to transmit data. (TX)  
nfc-poll: ERROR: Unable to open NFC device.  

Any ideas?

  • Hi @Gorbondga, Welcome and nice to meet you. Ah, let me see. (1) Your comment " ... appreciate some help from a more expert fellow in the field" might discourage the non experts in this "field" from daring to help. (2) Me no expert in NFC, but me ninja in I2C troubleshooting, with 200+ hours trying and erroring in I2C projects. (3) Now some troubleshooting advice: Your "Now I find it, now I don't find it" problem belongs to the general class of INTERMITTANT bugs which are difficult to remove. / to continue, ... – tlfong01 Dec 31 '19 at 1:02
  • My suggestion it to tidy up the wiring, or do rewiring with short (less then 15cm if possible), using nylon cable ties to relief strain the wiring, and try more times until you find a stable detection. If you are using bread board, you might move it to proto board, which is more reliable/repeatable, less impedance (I2C limiting impedance is 140pF ) You are asking two questions at the same time: (1) Intermittant no detect problem, (2) nfc poll. If you can get stable I2C detect, then your nfc poll nothing problem might disappear. Otherwise I will try to help in 2020. Happy New Year, Cheers. – tlfong01 Dec 31 '19 at 1:06
  • I found SunFounder's tutorial good. I installed libnfc 1.1.7 found "nfc-pool" on my PN532 V3 module command OK. You might like to read more details in my answer to the following question: "Problem with detecting badge with PN532 and Raspberry Pi": stackoverflow.com/questions/60819793/…. Cheers. – tlfong01 Mar 26 at 3:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.