I have been trying to get a 3a+ to detect a pn532 Hat. I have tested the UART, I2C and SPI, and could not detect any. I have gone through troubleshooting with a range of different code and even attempted a VE. Wondering if anyone has had this trouble / managed to get these to connect?
Some PN532 boards default to UART even if you think you’re using I²C/SPI. Always set the DIP/jumper explicitly.
If i2cdetect shows nothing, but wiring + config are right, your board might be stuck in HSU (UART) mode.
I am very sorry for the delay in my response. There has been a lot of sickness in the office this past week. However, I can say that ater experimenting some more with the Waveshare code, I was able to get UID’s of NFC cards read from PN532 connected to a Pi 3 A+ via UART, including from my phone’s own NFC chip.
Hi Jane, I tried the above and once I got to sudo chmod 777 -R Pn532-nfc-hat-code/ I got the following message “chmod: cannot access ‘Pn532-nfc-hat-code/’: Not a directory - did this come up for you at all?
7z x Pn532-nfc-hat-code.7z -r -o./Pn532-nfc-hat-code
With:
7z x Pn532-nfc-hat-code.7z
That should extract the .7z archive in the same directory that you’re currently in. Then proceed with the next steps.
As an aside, I was reading the 7z manual page to double check this and they actually advice not to use -r as, in the manual’s words, ‘It does not do what you think it does.’
Thanks Jane, I tried again with the above suggested and still got the chmod: cannot access msg. I think I might have to look into get some different kit for the project I am doing.
You won’t need to specify the folder and change permissions with that command (as Jane pointed out, you didn’t extract it to that folder by omitting that argument)
Just updating everyone on this one. I purchased a new NFC hat with Raspberry Pi 3b+ and got this working easy testing UIDs. I then tested the old NFC hat on the new Pi with the same UID’s and it still could not be detected, so this was probably a hardware issue. Thanks so much for all your support.