ESP restart : Connection error occurred: Connection requires encryption

Hello,

my esp restarte automaticly and i loose some Values

Logger: aioesphomeapi.connection
Source: runner.py:179
First occurred: 13. Juni 2023 um 19:13:53 (34 occurrences)
Last logged: 04:03:54

  • 192.168.2.102: Connection error occurred: Connection requires encryption
  • bigbox-lightcontroller @ 192.168.2.102: Connection error occurred: [Errno 104] Connection reset by peer
  • watercontrol-esp32-s2-saola-1 @ 192.168.2.106: Connection error occurred: Ping response not received after 90.0 seconds
  • watercontrol-esp32-s2-saola-1 @ 192.168.2.106: Connection error occurred: [Errno 104] Connection reset by peer

any ideas

greetings
Achim

Without your code from this ESP node, it’s like a guessing game. :slight_smile: Please post the code from that node, and please use a code format (see here), it is otherwise not possible to check for errors. :slight_smile:

But, I have a very strong feeling, that you aren’t using the mandatory encryption:

ok thank you for the tip
there is the code

ubstitutions: 
  devicename: bigbox-lightcontroller
  board: esp32-s2-saola-1
  upper_devicename: ESP32_S2_BigBox_LightController
  device_location: Kueche
  device_description:  BigBox Lichtsteuerung platform using ESPhome firmware
  ipaddress: 192.168.2.102
  last_update: "2023-06-04 22:54:12"

esphome:
  name: bigbox-lightcontroller
  comment: lightcontroller
  includes: []
  libraries: []
  build_path: bigbox-lightcontroller
  platformio_options: {} 

esp32:
  board: esp32-s2-saola-1
  framework:
    type: arduino

logger:
  #level: VERY_VERBOSE
  #tx_buffer_size: 1024

api:
  encryption:
    key: !secret ESPHOME_API_KEY

ota:
  safe_mode: true
  password: !secret HA_OTA_PASSWORD

# none... wurde auf light.... geändert 04.06.2023
wifi:
  power_save_mode: light # none (default for esp8266), light (default for esp32), high
  ssid: !secret WLAN_ASUS_SSID
  password: !secret WLAN_ASUS_PASSWORD
  manual_ip:
    static_ip: !secret ESP32_S2_BIGBOX_LIGHT_IP
    gateway: !secret WLAN_ASUS_GATEWAY_IP
    subnet: !secret WLAN_ASUS_SUBNET
    dns1: !secret WLAN_ASUS_DNS1

  ap:
    ssid: "Bigbox-Lightcontrol"
    password: !secret WIFI_AP_PASSWORD
 
web_server:
  port: 80
  auth:
    username: admin
    password: admin



# Sensoren am I2C Bus
i2c:
  sda: GPIO8
  scl: GPIO9
  scan: true
  id: bus_a


# Analog cd74hc4067 16 Channel Mux
cd74hc4067:
  - id: cd74hc4067_1
    pin_s0: GPIO12
    pin_s1: GPIO13
    pin_s2: GPIO14
    pin_s3: GPIO15

dallas:
  - pin: GPIO16
    id: hub_1
    update_interval: 120s
  - pin: GPIO17
    id: hub_2
    update_interval: 120s

# pin-out
# 
# GPIO1 PWM1 led_panel1_GPIO1 3000K
# GPIO2 PWM2 led_panel2_GPIO2 3000K
# GPIO3 PWM3 LED_4000K1_GPIO3
# GPIO4 PWM4 LED_4000K2_GPIO4
# GPIO5 PWM5 LED_660nm_1_GPIO5
# GPIO6 PWM6 LED_660nm_2_GPIO6
# GPIO7 PWM7 LED_730nm_GPIO7

# GPIO8 SDA I2C
# GPIO9 SCL I2C
# GPIO10 adc Aanalog_mux-sig-pin
# GPIO11 PWM8 PANEL_12V_FAN_GPIO11
# GPIO12 Aanalog Mux Address S0
# GPIO13 Analog Mux Address S1
# GPIO14 Aanalog Mux Address S2
# GPIO15 Aanalog Mux Address S3
# GPIO16 1-wire hub_1
# GPIO17 1-wire hub_2

# GPIO33 LED-Panel_1 3000K Switch N-Fet 
# GPIO34 LED-Panel_2 3000K Switch N-Fet 
# GPIO35 Fan LedPanel Switch N-Fet
# GPIO36 Fan Controller Box Switch N-Fet

output:
  - platform: ledc
    pin: GPIO1
    channel: 0 # ist ok
    inverted: True # 0 = volllast 255= aus
    frequency: 1000 Hz # default 490Hz
    id: led_panel1_GPIO1
  - platform: ledc
    pin: GPIO2
    channel: 1 # ist ok
    inverted: True  # 0 = volllast 255= aus
    frequency: 1000 Hz
    id: led_panel2_GPIO2
  - platform: ledc
    pin: GPIO3
    channel: 2 # ist ok
    frequency: 1000 Hz
    id:  led_4000k_p1_gpio3
  - platform: ledc
    pin: GPIO4
    channel: 3 # ist nicht ok. flackert wenn auf Channel 1 oder 2 
    frequency: 1000 Hz
    id: led_4000k_p2_gpio4
  - platform: ledc
    pin: GPIO5
    channel: 4 # ist nicht ok, flackert wenn on und lässt sogar noch die LED's an led_4000k_p1_gpio3 leicht mit flackern
    frequency: 1000 Hz 
    id:  led_660nm_p1_gpio5
  - platform: ledc
    pin: GPIO6
    channel: 4 # ist ok 
    frequency: 1000 Hz
    id: farred_730nm_gpio6
  - platform: ledc
    pin: GPIO7
    channel: 6
    frequency: 1000 Hz
    id: led_660nm_p2_gpio7 # ist ok flackert nicht und stört keine anderen Kanäle
  #- platform: ledc
  #  pin: GPIO11
  #  channel: 7
  #  frequency: "4096Hz"
  #  id: PANEL_12V_FAN_GPIO11



# hub_2                                     0x1b00000df723ec28
#[21:46:43][D][dallas.sensor:084]:  hub_1   0x3f00000df6546028
#[21:46:43][D][dallas.sensor:084]:  hub_1   0x3100000df746fa28
sensor:
  - platform: internal_temperature
    name: "ESP32-S2-Saola_1R Temperatur"
  - platform: dallas
    address: 0x3100000df746fa28
    dallas_id: hub_1
    name: "Uc Box StepDown"
    id: uc_box_stepdown_ds18b20_temp
  - platform: dallas
    address: 0x3f00000df6546028
    dallas_id: hub_1
    id: uc_box_ds18b20_temp
    name: "Uc Box"
  - platform: dallas
    address: 0x1b00000df723ec28
    dallas_id: hub_2
    name: "LED-Panel Temperatur"
    id: led_panel_temp
  - platform: sht4x
    temperature:
      name: "Temperatur am Kronendach"
    humidity:
      name: "Luftfeuchtigkeit"
    address: 0x44
    update_interval: 30s
  # Pimoroni BME60 Sensor
  #- platform: bme680
  #  temperature:
  #    name: "Temperatur an Kronendach"
  #    oversampling: 16x
  #    filters:
  #      offset: -0.65
  #  update_interval: 12s
  #  pressure:
  #    name: " Luftdruck"
  #  humidity:
  #    name: " Luftfeuchtigkeit"
  #    filters:
  #      offset: -0.65
  #  gas_resistance:
  #    name: "Gas Luft-Gemische"
  #  i2c_id: bus_a
  #  ##iir_filter: 7x
  #  address: 0x77  #address: 0x77  #address: 0x76 # BME688 Piomoroni/BME680/Adafruit/BME680 Piomoroni
  # BH1750 Lux/Lumen sensor
  - platform: bh1750
    name: "LED Lichtstärkein Lux Mitte der Pflanze:"
    i2c_id: bus_a
    address: 0x5C
    update_interval: 30s
  - platform: bh1750
    name: "LED Lichtstärke in LuX am Kronendach:"
    i2c_id: bus_a
    address: 0x23
    update_interval: 30s
  - platform: adc
    id: adc_sensor
    pin: GPIO10
  - platform: cd74hc4067
    id: panel_1_3000k
    name: "BigBox Panel-1 3000K Power"
    number: 5
    sensor: adc_sensor
    update_interval: 300s
    unit_of_measurement: "W"
    accuracy_decimals: 2
    device_class: "power"
    filters:
      - lambda: return (x * 10);
  - platform: cd74hc4067
    id: panel_2_3000k
    name: "BigBox Panel-2 3000K Power"
    number: 4
    sensor: adc_sensor
    update_interval: 60s
    unit_of_measurement: "W"
    device_class: "power"
    filters:
      - lambda: return (x * 10);
  - platform: cd74hc4067
    id: panel_1_4000k
    name: "BigBox Panel-1 4000K Power"
    number: 3
    sensor: adc_sensor
    update_interval: 60s
    unit_of_measurement: "W"
    device_class: "power"
    filters:
      - lambda: return (x * 10);
  - platform: cd74hc4067
    id: panel_2_4000k
    name: "BigBox Panel-2 4000K Power"
    number: 2
    sensor: adc_sensor
    update_interval: 60s
    unit_of_measurement: "W"
    device_class: "power"
    filters:
#      - lambda: "return x > 0.001 ? x * 56221 : 0;"
      - lambda: return (x * 10);
  - platform: cd74hc4067
    id: Panel_1_660nm
    name: "BigBox Panel-1 660nm Power"
    number: 1
    sensor: adc_sensor
    update_interval: 60s
    unit_of_measurement: "W"
    device_class: "power"
    filters:
      #- lambda: "return x > 0.001 ? x * 56221 : 0;"
      - lambda: return (x * 10);
  - platform: cd74hc4067
    id: Panel_2_660nm
    name: "BigBox Panel-2 660nm Power"
    number: 0
    sensor: adc_sensor
    update_interval: 60s
    unit_of_measurement: "W"
    device_class: "power"
    filters:
      #- lambda: "return x > 0.001 ? x * 56221 : 0;"
      - lambda: return (x * 10);
 # - platform: cd74hc4067
 #   id: Panel_1und2_730nm
 #   name: "BigBox Panel-1und2 730 Power"
 #   number: 6
 #   sensor: adc_sensor
 #   update_interval: 60s
 #   unit_of_measurement: "W"
 #   device_class: "power"
 #   filters:
 #     #- lambda: "return x > 0.001 ? x * 56221 : 0;"
 #     - lambda: return (x * 10);
 # - platform: cd74hc4067
 #   id: Panel_1und2_840nm
 #   name: "BigBox Panel-1und2840 Power"
 #   number: 6
 #   sensor: adc_sensor
 #   update_interval: 60s
 #   unit_of_measurement: "W"
 #   device_class: "power"
 #   filters:
 #     #- lambda: "return x > 0.001 ? x * 56221 : 0;"
 #     - lambda: return (x * 10);

light:
  - platform: monochromatic
    name: "LED Panel 1 3000K 1000Hz"
    output: led_panel1_GPIO1
    gamma_correct: 1.0
  - platform: monochromatic
    name: "LED Panel 2 3000K 1000Hz"
    output: led_panel2_GPIO2
    gamma_correct: 1.0
  - platform: monochromatic
    name: "LED 4000K P1"
    output: led_4000k_p1_gpio3
    #gamma_correct: 1.0
  - platform: monochromatic
    name: "LED 4000K P2"
    output: led_4000k_p2_gpio4
    #gamma_correct: 1.0
  - platform: monochromatic
    name: "LED 660nm P1"
    output: led_660nm_p1_gpio5
    #gamma_correct: 1.0
  - platform: monochromatic
    name: "LED FarRed 730nm"
    output: farred_730nm_gpio6
    #gamma_correct: 1.0
  - platform: monochromatic
    name: "LED 660nm P2"
    output: led_660nm_p2_gpio7
    #gamma_correct: 1.0
  #- platform: monochromatic
  #  name: "Panel 12V Fan 33600Hz"
  #  output: PANEL_12V_FAN_GPIO11

switch:
  - platform: gpio
    pin: GPIO33
    inverted: true
    name: "Led Panel 1 3000K GPIO33"
  - platform: gpio
    pin: GPIO34
    inverted: true
    name: "Led Panel 2 3000K GPIO34"
  - platform: gpio
    pin: GPIO35
    name: "Fan LedPanel GPIO35"
  - platform: gpio
    pin: GPIO37 # 36 only 1.34V
    name: "Fan Controller Box GPIO37"

edit:
what i see now.
i change only the power_safe_mode
power_save_mode: light
i’m not sure if is that a problem