Waveshare PN532 NFC HAT - SPI Issue

Good Morning all,

I’m wondering if someone can help me with my query.
I’ve followed the instructions via the WaveShare Wiki for the (SPI) setup on the Pi 4.

As per the illustration I’ve aligned the jumpers to the appropriate pins, I’ve also went into the
raspi-config via the Terminal and enabled the SPI Interface then rebooted.

Then upon using the supplied (example_get_uid.py) it doesn’t seem to read the (RFID Tag) at all.
URL: PN532 NFC HAT - Waveshare Wiki
Scripts: https://www.waveshare.com/w/upload/6/67/Pn532-nfc-hat-code.7z

However, I have had some luck setting it up via the UART interface, but sometimes get a “RuntimeWarning: This channel is already in use” etc.


1 Like

Hi Mitchell,

We don’t have any stock at the moment, so it’s a little tricky to test out but we’re looking into it. We’ll let you know as soon as we have more info.

try running an update

sudo apt update && apt full-upgrade

if you can pls go into the software manager and see if the source code update is on

are you running noobs…? or the latest Debian full desktop i see you neo case sitting there nice …

Good morning Mitchell,

Welcome to the forum! :partying_face:

Sorry to hear about the issues that you’ve had with that HAT, it’s still quite new here at Core Electronics, so I don’t have any experience running it with a Pi myself yet. Out of curiosity, have you tried running it with an I2C interface yet? (I’ve linked a GitHub repo for you below that should run you through that setup) I’m going to add a temporary note on the site now to let others know about this issue with using SPI, I’ll need to test the PN532 myself to see whether we can replicate it once they’re here, but after checking with some other forums it doesn’t look like there’s a clear agreed-upon solution to this yet, I’d take a dig through there if you’re determined to run this board with an SPI interface. Also, are you getting any other error messages? Or just the channel is already in use warning when running UART?

I2C setups:

Common issues being reported, I’d start by checking here to see whether any of their suggestions provide a fix:

https://www.raspberrypi.org/forums/viewtopic.php?t=175680

Good Evening all,

Thank you for your responses; unfortunately, I couldn’t get (I2C or SPI) working on the WaveShare PN532. However, upon some testing, I was able to get UART working.

I also noticed that the RPi.GPIO Module doesn’t support SPI, I2C, hardware PWM or serial functionality on the RPi yet; if this is true, the device shouldn’t specify that it supports this ability.

After some research and trial & error, I identified that the (RuntimeWarning) was due to the minor-alterations I made in the default-script leading to a few UART error issues as described which occurred now and again. Therefore, after spending a couple of hours redesigning the script, I can now continually-run the program and generate a single RFID read-out without encountering this issue.

2 Likes