esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

PN532 does not read tags when logging is set to VERY_VERBOSE #2552

Closed nmaggioni closed 3 years ago

nmaggioni commented 3 years ago

The problem

NFC tags are completely ignored by the pn532 component when the logging level is set to VERY_VERBOSE. All levels above that work as expected.

Which version of ESPHome has the issue?

2021.9.3

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

N/A

What platform are you using?

ESP8266

Board

Wemos D1 Mini

Component causing the issue

pn532

Example YAML snippet

esphome:
  name: "<DEVICE_NAME>"
  platform: ESP8266
  board: d1_mini

logger:
  level: VERY_VERBOSE

spi:
  miso_pin: D8
  mosi_pin: D5
  clk_pin: D7

pn532_spi:
  cs_pin: D6
  update_interval: 500ms

binary_sensor:
  - platform: pn532
    uid: XX-XX-XX-XX-XX-XX-XX
    name: "<TAG_NAME>"

Anything in the logs that might be useful for us?

No messages from the `pn532` or `spi` components except the first initialization ones.

Additional information

No response

probot-esphome[bot] commented 3 years ago

Hey there @ottowinter, @jesserockz, mind taking a look at this issue as it has been labeled with an integration (pn532_spi) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

OttoWinter commented 3 years ago

Likely just a timing issue. The PN532 is quite strict about the timing of commands. Enabling very_verbose logs makes it spit out all communications over UART, but that also slows the data transfer down. If so, that wouldn't really be something we can fix.

nmaggioni commented 3 years ago

Makes perfect sense, I should've thought of that honestly. Thanks for the clarification!

I was debugging partial NDEF readings and some logging calls are unusable due to this issue, but temporarily changing them to a higher level is simple enough that finding a solution to make them work as they are isn't relevant.