adonno / tagreader

Simple to build/use NFC tag reader, specially created for Home Assistant
https://adonno.com
GNU General Public License v3.0
1.13k stars 176 forks source link

Suddenly unable to read cards #178

Closed RichardMawdsley closed 1 year ago

RichardMawdsley commented 1 year ago

Hi, I built my own scanner from your details a few months back and it's been working great!

However it's suddenly just stopped reading tags. Still connects fine in ESPHome/Home Assistant, all actions in the HA Device such as the LED/Restart function and from what I can tell the log (below) looks fine, but it just won't scan tags. I've checked there is voltage going to the NFC board and it seems fine.

I've hit the install button in ESPHome/HA on the device a few times to reinstall it - once it did start reading them again until the device was restarted and it's never done it since.

logs_tagreader-dad851_upload.txt

Any thoughts? Thanks.

RichardMawdsley commented 1 year ago

Update: I deleted the device from ESPHome and rediscovered/adopted it. Instantly it was able to read tags again. Restarting it via the Restart button on the device in Home Assistant multiple times and it successfully comes back up and I could read tags. However, I then killed the power to it, waited a few seconds and switched it back on, and whilst it came back up and connected I'm now unable to read tags regardless of what I do.

So, this gives me hope that it's not hardware related but something config wise with the soft / hard reboot. Has something changed? This is how i've been using it for months.

I caught all this in the logs which I've commented below:

logs_tagreader-dad851_upload (3).txt

RichardMawdsley commented 1 year ago

Further update.. Attempted to plug into computer to grab more detailed logs of the boot and have discovered an oddity that I assume is suggesting a failed boot.

Upon trying to connect, I get four separate possible outcomes following plugging it in:

1) No device found - Tags do not scan - The device itself makes the beep noise to suggest it's started and it shows as online in Home Assistant, but No device found to physically connect.

image

2) Device found, won't connect and hangs browser - Tags do not scan image

3) It works - only happened once - It booted fine, I could connect and cards scanned fine. Whilst my stupid arse didnt export the logs, I clearly saw the line with wording to effect of "Found hardware pn532".

4) pn532 error - If I'm very very quick after plugging it in, then before getting into state 2 above I can connect. I miss some of the verbose log because i'm not there from the start. It does not scan cards. However, If I then hit the 'Reset Device' button I get a very clear:

[C][pn532:018]: Setting up PN532... [E][pn532:022]: Error sending version command [E][component:112]: Component pn532 was marked as failed.

It restarts and predictably no card scans.

So, clearly the pn532 is failing to start. I've reattempted my previous comment of deleting and re-adopting but that seems to have given up too. Only notable change I can see in the log is: [11:08:54][C][i2c.arduino:047]: Recovery: failed, SCL is held low on the bus. Off to google that.

RichardMawdsley commented 1 year ago

Unable to resolve, I ended up buying a new PN532 and replacing it. Seems fine now. Very odd that it would just give up but in this case it seems to have been faulty hardware.