adonno / tagreader

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

Connection encryption error (with api encryption key) #228

Open skipper22hassio opened 1 year ago

skipper22hassio commented 1 year ago

After successful api connection and reading a NFC card the a connection encryption error occurs.

I did change the yaml to work with encryption key instead of the depreciated password: api: encryption: key: "<key>

I did set up the D1 mini through the web.esphome.com (had problems with the key) and adopted it in the ESP home addon. Running ESP Home 2023.2.4

Here the log output:

[14:46:13][D][pn532:295]: Waiting to read next tag
[14:46:13][D][tagreader:312]: No HA NDEF, using UID
[14:46:13][D][rtttl:038]: Playing song success
[14:46:14][D][rtttl:094]: Playback finished
[14:46:23][D][pn532:280]: Mifare classic
[14:46:23][D][light:035]: 'TagReader' LED Setting:
[14:46:23][D][light:046]:   State: ON
[14:46:23][D][light:050]:   Brightness: 100%
[14:46:23][D][light:057]:   Red: 0%, Green: 100%, Blue: 0%
[14:46:23][D][light:077]:   Flash length: 0.5s
[14:46:23][D][pn532:162]: Found new tag '6E-56-43-BF'
[14:46:23][D][pn532:166]:   NDEF formatted records:
[14:46:23][D][pn532:168]:     U - https://open.spotify.com/playlist/1U8q5m97Fy5VsIi4qWwXgi
[14:46:23][D][pn532:168]:     T - Singt ein Vogel
[14:46:23][D][pn532:295]: Waiting to read next tag
WARNING esphome-web-5ec96a.local: Connection error occurred: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
    await fut
  File "/usr/local/lib/python3.9/dist-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/dist-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 303, in _keep_alive_loop
    await self._ping()
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 628, in _ping
    await self.send_message_await_response(PingRequest(), PingResponse)
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 537, in send_message_await_response
    res = await self.send_message_await_response_complex(
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 522, in send_message_await_response_complex
    raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for response for <class 'api_pb2.PingRequest'> after 10.0s
INFO Disconnected from ESPHome API for esphome-web-5ec96a.local
WARNING Disconnected from API
INFO Successfully connected to esphome-web-5ec96a.local

Disabled the encryption, now I'm getting

[15:24:03][D][api:102]: Accepted 192.168.88.6
[15:24:03][W][api.connection:085]: 192.168.88.6: Reading failed: BAD_INDICATOR errno=11