Closed chrispe-lab closed 2 years ago
I changed to a D1 mini and it seems to work now. What I also did was to make sure I used the recommended GPIOs for the board, which I will strictly follow from here on out.
I know this issue was closed but @chrispernold I am having the exact same problem. Can you share your updated yaml maybe? I'm using a D1 mini connected via i2c and the scanner works for a few hours and then stops accepting scans.
I'm open to suggestions. Thanks!
I've found the PN532 stops working every other soft reboot. I'm using an ESP32-POE-ISO with the HiLetGo PN532 module. over I2C. It works when completely unpowered for a moment, and then powered on. However, safe reboots/restarts cause it to fail to read any tags every other reboot. Not sure if this is a software issue or a hardware issue.
In all events, the device enumerates as an I2C device (even when it fails to read/detect any tags). Once it is soft rebooted again, or has power completely disconnected/reconnected, it works.
Anyone else having similar issues or insight?
Watch the serial logs to see what the difference is between working and not working.
so the (relevant) logs for working are:
[C][pn532:018]: Setting up PN532...
[VV][i2c.arduino:140]: 0x24 TX 0000FF02FED4022A00
[V][pn532:246]: Reading ACK...
[VV][i2c.arduino:116]: 0x24 RX 01
[VV][i2c.arduino:116]: 0x24 RX 010000FF00FF00
[V][pn532:257]: ACK valid: YES
[V][pn532_i2c:043]: Reading response
[VV][i2c.arduino:116]: 0x24 RX 01
[VV][i2c.arduino:116]: 0x24 RX 010000FF06FAD5
[V][pn532:262]: Sending NACK for retransmit
[VV][i2c.arduino:140]: 0x24 TX 0000FFFF0000
[V][pn532_i2c:049]: Reading response of length 5
[VV][i2c.arduino:116]: 0x24 RX 01
[VV][i2c.arduino:116]: 0x24 RX 010000FF06FAD50332010607E800
[D][pn532:033]: Found chip PN532
[D][pn532:034]: Firmware ver. 1.6
[VV][i2c.arduino:140]: 0x24 TX 0000FF05FBD4140114010200
whereas, performing a soft-reset (restart the device via esphome's restart platform):
[C][pn532:018]: Setting up PN532...
[VV][i2c.arduino:140]: 0x24 TX 0000FF02FED4022A00
[V][pn532:246]: Reading ACK...
[VV][i2c.arduino:116]: 0x24 RX 01
[VV][i2c.arduino:116]: 0x24 RX 010000FF02FED5
[V][pn532:257]: ACK valid: NO
[E][pn532:022]: Error sending version command
[E][component:113]: Component pn532 was marked as failed.
performing a second soft-reset (same manner as the first) results in success, with logs the same as a power-on:
it appears that the unit itself is still responding to a previous configuration command from before the power-on. I've tested this on a board with nothing else but that PN532 hooked up. I'll keep looking into it, but anyone else have any ideas?
I have the same issues with the PN532 modules. I think based on everyone experiencing the same issue here that there is a problem with the module on a hardware/firmware level.
The problem
I had this RC522 module for a while in a jukebox for my kids to play different MP3s but was always leaning towards trying out the PN532 module as it seemed more integrated to the ESPHome landscape. Before moving over I used a version of the https://github.com/HausnerR/esphome-door-lock code to get it working similar to
on_tag
andon_tag_removed
.Fast forwarding a few years and I've replaced the RC522 with a PN532 module, hoping I could stick to the default PN532 code in ESPHome and remove the custom scripts. While it works immediately after a boot of the NodeMCUV2 (over I2C) it stops responding after a while, let's say a few hours. Only a hard reset (unplugging the power cable) will get it back to responding to RFID cards/tags.
The setup looks like the following:
ESP device with RFID PN532 module reads a RFID card/tag e.g. 12-34-56-78 and send this information to a Node Red (via HA) flow that triggers an MP3 to be played on one of my Sonos speakers.
If the RFID card/tag is removed it sends a 00-00-00-00 state that in turn pause the Sonos.
Which version of ESPHome has the issue?
v2022.4.0
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
2022.3.5
What platform are you using?
ESP8266
Board
NODEMCU V2
Component causing the issue
PN532 over I2C
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
Someone at the HA community suggested the D1 mini board instead of the NodeMCU. So I'm thinking this could be a HW error where the signal gets out of sync somehow and the board is unable to get it back to sync. What do you think?