esphome / issues

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

Wireless Logs doesnt work after upgrading python and ESPHOME, downgrading didn't help. #5386

Open rdaf2014 opened 9 months ago

rdaf2014 commented 9 months ago

The problem

After upgrading python to version 3.12 and ESPHOME to 2023.12.6 wireless lgs stopped working. after that i tried a bunch of combinations, going back to python 3.10.x, ESPHOME 2023.12.x. Nothin solved the issue.

Which version of ESPHome has the issue?

2023.12.6 Python=3.10.11

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

ESP32-CAM, ESP32-C3,

Component causing the issue

wireless logs

Example YAML snippet

esphome:
  name: esp32cam-1
  friendly_name: ESP32CAM-1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "***"

ota:
  password: "***"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32Cam-1 Fallback Hotspot"
    password: "8nyDlhsHfa1k"

captive_portal:

# Example configuration entry
esp32_camera:
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  # SVGA = 800*600
  # XGA = 1024*768
  # FHD = 1920*1080
  # SXGA = 1280*1024
  resolution: SXGA
  jpeg_quality: 10
  max_framerate: 5 fps
  idle_framerate: 0.05 fps
  vertical_flip: True
  horizontal_mirror: False
  special_effect: grayscale

  # Image settings
  name: MitCam
  # ...

globals:
  - id: my_global_int
    type: int
    restore_value: no
    initial_value: '0'

# DEBUG LED - Til at teste photo diode - forbind diode til pin 13
#output:
#  - platform: gpio
#    pin:
#      number: 13
#      mode: output
#      inverted: True
#    id: greenLED

#interval:
#  - interval: 1000ms
#    then:
#      - output.turn_on: greenLED
#      - delay: 10ms  #Blink length
#      - output.turn_off: greenLED
#      - lambda: |-
#          id(my_global_int) += 1;

Anything in the logs that might be useful for us?

[23:57:53][C][wifi:414]:   Hostname: 'esp32cam-1'
ERROR Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ed result=175>)
handle: <Handle _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ed result=175>)>
Traceback (most recent call last):
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 325, in _loop_reading
    self._data_received(data, length)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 274, in _data_received
    self._protocol.data_received(data)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 163, in data_received
    self._handle_frame(frame)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 326, in _handle_frame
    self._connection.process_packet((type_high << 8) | type_low, msg[4:])
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\connection.py", line 931, in process_packet
    handler(msg)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\esphome\components\api\client.py", line 46, in on_log
    print(f"[{time_.hour:02}:{time_.minute:02}:{time_.second:02}]{text}")
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 47, in write
    self.__convertor.write(text)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 177, in write
    self.write_and_convert(text)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text
    self.wrapped.write(text[start:end])
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 71-72: character maps to <undefined>
ERROR Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...hed result=76>)
handle: <Handle _ProactorReadPipeTransport._loop_reading(<_OverlappedF...hed result=76>)>
Traceback (most recent call last):
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 325, in _loop_reading
    self._data_received(data, length)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 274, in _data_received
    self._protocol.data_received(data)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 163, in data_received
    self._handle_frame(frame)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 319, in _handle_frame
    msg = self._decrypt(frame)
          ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\noise\state.py", line 74, in decrypt_with_ad
    plaintext = self.cipher.decrypt(self.k, self.n, ad, ciphertext)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\noise\backends\default\ciphers.py", line 13, in decrypt
    return self.cipher.decrypt(nonce=self.format_nonce(n), data=ciphertext, associated_data=ad)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src\\chacha20poly1305_reuseable\\__init__.py", line 136, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.decrypt
  File "src\\chacha20poly1305_reuseable\\__init__.py", line 156, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.decrypt
  File "src\\chacha20poly1305_reuseable\\__init__.py", line 272, in chacha20poly1305_reuseable._decrypt_with_fixed_nonce_len
  File "src\\chacha20poly1305_reuseable\\__init__.py", line 282, in chacha20poly1305_reuseable._decrypt_data
cryptography.exceptions.InvalidTag
ERROR Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ed result=223>)
handle: <Handle _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ed result=223>)>
Traceback (most recent call last):
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 325, in _loop_reading
    self._data_received(data, length)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 274, in _data_received
    self._protocol.data_received(data)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 163, in data_received
    self._handle_frame(frame)
  File "C:\Users\Anders\AppData\Local\Programs\Python\Python312\Lib\site-packages\aioesphomeapi\_frame_helper\noise.py", line 319, in _handle_frame
    msg = self._decrypt(frame)
          ^^^^^^^^^^^^^^^^^^^^

Additional information

No response

milkywade commented 9 months ago

hi @rdaf2014 you're not alone https://github.com/esphome/issues/issues/5384

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

milkywade commented 5 months ago

Auto-closing issues do not make them move away :-(

See https://github.com/esphome/issues/issues/5384 however for several work-arounds.