esphome / issues

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

Restart switch becomes unavailable + esphome needs a few retries to connect to ESP32 #824

Closed dgtal1 closed 4 years ago

dgtal1 commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Esphome in docker. Home Assistant 101.1 ESP (ESP32/ESP8266, Board/Sonoff):

ESP32, DEVKIT V1 Affected component:

switch

Description of problem: Since I upgraded to 1.14 on Saturday I'm getting my restart switch shown in HA as unavailable. upgrade to 1.14.2 yesterday didn't fix this. On 1.14.0 the switch randomly changed its status from off to unavailable. Since 1.14.2 it become not available after a couple of hours after upgrade and stayed as unavailable. See attached image: image

All other entities related to my ESP32 - mostly sensors - are shown as normal with a valid status and values. I'm sure this only started with 1.14 as I observe these entities every day.

I think this has something to do with general stability of the new software. After checking the logs I noticed that esphome could not connect to my ESP32 node initially and required 4 retries to connect to it. I'm sure this didn't happen before and esphome was always capable of connecting at the first time. Could be related to mDNS?

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE

esphome:
  name: sensors_tracker
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
  ssid: 'REMOVED'
  password: 'removed'

ota:
  password: 'removed'

# Enable logging
logger:

esp32_ble_tracker:

sensor:
  - platform: xiaomi_hhccjcy01  #xiaomi_miflora
    mac_address: C4:7C:8D:65:FC:33
    temperature:
      name: "MiFlora Trawa Temperature"
    moisture:
      name: "MiFlora Trawa Moisture"
    illuminance:
      name: "MiFlora Trawa Illuminance"
    conductivity:
      name: "MiFlora Trawa Soil Conductivity"
    battery_level:
      name: "MiFlora Trawa Battery Level"

  - platform: xiaomi_hhccjcy01  #xiaomi_miflora
    mac_address: C4:7C:8D:65:FB:D5
    temperature:
      name: "MiFlora Tuje Temperature"
    moisture:
      name: "MiFlora Tuje Moisture"
    illuminance:
      name: "MiFlora Tuje Illuminance"
    conductivity:
      name: "MiFlora Tuje Soil Conductivity"

  - platform: xiaomi_lywsdcgq #xiaomi_mijia
    mac_address: 4C:65:A8:DB:DB:A6
    temperature:
      name: "Garaz Temperature"
      filters:
      - sliding_window_moving_average:
          window_size: 3
          send_every: 3
    humidity:
      name: "Garaz Humidity"
    battery_level:
      name: "Garaz Battery Level"

  - platform: xiaomi_lywsd02
    mac_address: E7:2E:01:21:1C:33
    temperature:
      name: "Xiaomi LYWSD02 Temperature"
    humidity:
      name: "Xiaomi LYWSD02 Humidity"

  - platform: adc
    pin: GPIO34
    name: "esp32_swiatlo"
    update_interval: 60s
    attenuation: 11db

  - platform: adc
    pin: GPIO35
    name: "esp32_gleba"
    filters:
      - sliding_window_moving_average:
          window_size: 12
          send_every: 12
      - lambda: return abs(3.90 - x);
    update_interval: 5s
    attenuation: 11db

  - platform: adc
    pin: GPIO32
    name: "esp32_deszcz"
    update_interval: 60s
    attenuation: 11db

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO23
      mode: INPUT_PULLDOWN
      inverted: True
    name: "Brama garazowa"
    device_class: garage_door
    filters:
      - delayed_on: 50ms
      - delayed_off: 50ms

api:  

time:
  - platform: homeassistant
    on_time:
      - seconds: 0
        minutes: 0
        hours: 12
        days_of_week: MON-SUN
        then:
          - switch.toggle: restart_sw

switch:
  - platform: restart
    name: "ESP32 garaz restart"
    id: restart_sw

Logs (if applicable):

PASTE DEBUG LOG HERE
INFO Reading configuration /config/ESP32.yaml...
/usr/local/lib/python3.6/dist-packages/tzlocal/unix.py:158: UserWarning: Can not find any timezone configuration, defaulting to UTC.
  warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
INFO Detected timezone 'UTC' with UTC offset 0
INFO Starting log output from sensors_tracker.local using esphome API
WARNING Error resolving IP address of sensors_tracker.local. Is it connected to WiFi?
WARNING (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -2] Name or service not known). Re-Trying in 1 seconds
WARNING Error resolving IP address of sensors_tracker.local. Is it connected to WiFi?
WARNING (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -2] Name or service not known). Re-Trying in 1 seconds
WARNING Error resolving IP address of sensors_tracker.local. Is it connected to WiFi?
WARNING (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -2] Name or service not known). Re-Trying in 2 seconds
INFO Connecting to sensors_tracker.local:6053 (192.168.0.25)
INFO Successfully connected to sensors_tracker.local
[07:22:21][I][app:100]: ESPHome version 1.14.2 compiled on Nov  5 2019, 19:03:09
[07:22:21][C][wifi:409]: WiFi:
[07:22:21][C][wifi:277]:   SSID: [redacted]
[07:22:21][C][wifi:278]:   IP Address: 192.168.0.25
[07:22:21][C][wifi:280]:   BSSID: [redacted]
[07:22:21][C][wifi:281]:   Hostname: 'sensors_tracker'
[07:22:21][C][wifi:285]:   Signal strength: -55 dB ▂▄▆█
[07:22:21][C][wifi:289]:   Channel: 11
[07:22:21][C][wifi:290]:   Subnet: 255.255.255.0
[07:22:21][C][wifi:291]:   Gateway: 192.168.0.1
[07:22:21][C][wifi:292]:   DNS1: 192.168.0.13
[07:22:21][C][wifi:293]:   DNS2: 8.8.4.4
[07:22:21][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Brama garazowa'
[07:22:21][C][gpio.binary_sensor:015]:   Device Class: 'garage_door'
[07:22:21][C][gpio.binary_sensor:016]:   Pin: GPIO23 (Mode: INPUT_PULLDOWN, INVERTED)
[07:22:21][C][logger:175]: Logger:
[07:22:21][C][logger:176]:   Level: DEBUG
[07:22:21][C][logger:177]:   Log Baud Rate: 115200
[07:22:21][C][logger:178]:   Hardware UART: UART0
[07:22:21][C][esp32_ble_tracker:442]: BLE Tracker:
[07:22:21][C][esp32_ble_tracker:443]:   Scan Duration: 300 s
[07:22:21][C][esp32_ble_tracker:444]:   Scan Interval: 512 ms
[07:22:21][C][esp32_ble_tracker:445]:   Scan Window: 320 ms
[07:22:21][C][esp32_ble_tracker:446]:   Scan Type: ACTIVE
[07:22:21][C][xiaomi_hhccjcy01:012]: Xiaomi HHCCJCY01
[07:22:21][C][xiaomi_hhccjcy01:013]:   Temperature 'MiFlora Trawa Temperature'
[07:22:21][C][xiaomi_hhccjcy01:013]:     Unit of Measurement: '°C'
[07:22:21][C][xiaomi_hhccjcy01:013]:     Accuracy Decimals: 1
[07:22:21][C][xiaomi_hhccjcy01:013]:     Icon: 'mdi:thermometer'
[07:22:21][C][xiaomi_hhccjcy01:014]:   Moisture 'MiFlora Trawa Moisture'
[07:22:21][C][xiaomi_hhccjcy01:014]:     Unit of Measurement: '%'
[07:22:21][C][xiaomi_hhccjcy01:014]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:014]:     Icon: 'mdi:water-percent'
[07:22:21][C][xiaomi_hhccjcy01:015]:   Conductivity 'MiFlora Trawa Soil Conductivity'
[07:22:21][C][xiaomi_hhccjcy01:015]:     Unit of Measurement: 'µS/cm'
[07:22:21][C][xiaomi_hhccjcy01:015]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:015]:     Icon: 'mdi:flower'
[07:22:21][C][xiaomi_hhccjcy01:016]:   Illuminance 'MiFlora Trawa Illuminance'
[07:22:21][C][xiaomi_hhccjcy01:016]:     Unit of Measurement: 'lx'
[07:22:21][C][xiaomi_hhccjcy01:016]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:016]:     Icon: 'mdi:brightness-5'
[07:22:21][C][xiaomi_hhccjcy01:017]:   Battery Level 'MiFlora Trawa Battery Level'
[07:22:21][C][xiaomi_hhccjcy01:017]:     Unit of Measurement: '%'
[07:22:21][C][xiaomi_hhccjcy01:017]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:017]:     Icon: 'mdi:battery'
[07:22:21][C][xiaomi_hhccjcy01:012]: Xiaomi HHCCJCY01
[07:22:21][C][xiaomi_hhccjcy01:013]:   Temperature 'MiFlora Tuje Temperature'
[07:22:21][C][xiaomi_hhccjcy01:013]:     Unit of Measurement: '°C'
[07:22:21][C][xiaomi_hhccjcy01:013]:     Accuracy Decimals: 1
[07:22:21][C][xiaomi_hhccjcy01:013]:     Icon: 'mdi:thermometer'
[07:22:21][C][xiaomi_hhccjcy01:014]:   Moisture 'MiFlora Tuje Moisture'
[07:22:21][C][xiaomi_hhccjcy01:014]:     Unit of Measurement: '%'
[07:22:21][C][xiaomi_hhccjcy01:014]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:014]:     Icon: 'mdi:water-percent'
[07:22:21][C][xiaomi_hhccjcy01:015]:   Conductivity 'MiFlora Tuje Soil Conductivity'
[07:22:21][C][xiaomi_hhccjcy01:015]:     Unit of Measurement: 'µS/cm'
[07:22:21][C][xiaomi_hhccjcy01:015]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:015]:     Icon: 'mdi:flower'
[07:22:21][C][xiaomi_hhccjcy01:016]:   Illuminance 'MiFlora Tuje Illuminance'
[07:22:21][C][xiaomi_hhccjcy01:016]:     Unit of Measurement: 'lx'
[07:22:21][C][xiaomi_hhccjcy01:016]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_hhccjcy01:016]:     Icon: 'mdi:brightness-5'
[07:22:21][C][xiaomi_lywsdcgq:012]: Xiaomi LYWSDCGQ
[07:22:21][C][xiaomi_lywsdcgq:013]:   Temperature 'Garaz Temperature'
[07:22:21][C][xiaomi_lywsdcgq:013]:     Unit of Measurement: '°C'
[07:22:21][C][xiaomi_lywsdcgq:013]:     Accuracy Decimals: 1
[07:22:21][C][xiaomi_lywsdcgq:013]:     Icon: 'mdi:thermometer'
[07:22:21][C][xiaomi_lywsdcgq:014]:   Humidity 'Garaz Humidity'
[07:22:21][C][xiaomi_lywsdcgq:014]:     Unit of Measurement: '%'
[07:22:21][C][xiaomi_lywsdcgq:014]:     Accuracy Decimals: 1
[07:22:21][C][xiaomi_lywsdcgq:014]:     Icon: 'mdi:water-percent'
[07:22:21][C][xiaomi_lywsdcgq:015]:   Battery Level 'Garaz Battery Level'
[07:22:21][C][xiaomi_lywsdcgq:015]:     Unit of Measurement: '%'
[07:22:21][C][xiaomi_lywsdcgq:015]:     Accuracy Decimals: 0
[07:22:21][C][xiaomi_lywsdcgq:015]:     Icon: 'mdi:battery'
[07:22:21][C][xiaomi_lywsd02:012]: Xiaomi LYWSD02
[07:22:21][C][xiaomi_lywsd02:013]:   Temperature 'Xiaomi LYWSD02 Temperature'
[07:22:21][C][xiaomi_lywsd02:013]:     Unit of Measurement: '°C'
[07:22:21][C][xiaomi_lywsd02:013]:     Accuracy Decimals: 1
[07:22:21][C][xiaomi_lywsd02:013]:     Icon: 'mdi:thermometer'
[07:22:21][C][xiaomi_lywsd02:014]:   Humidity 'Xiaomi LYWSD02 Humidity'
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[07:22:21][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:21][D][xiaomi_ble:170]:   Conductivity: 173µS/cm
[07:22:21][D][sensor:092]: 'MiFlora Trawa Soil Conductivity': Sending state 173.00000 µS/cm with 0 decimals of accuracy
[07:22:21][D][xiaomi_ble:158]: Got Xiaomi LYWSDCGQ (4C:65:A8:DB:DB:A6):
[07:22:21][D][xiaomi_ble:161]:   Temperature: 16.2°C
[07:22:21][D][xiaomi_ble:164]:   Humidity: 50.5%
[07:22:21][D][sensor:092]: 'Garaz Temperature': Sending state 16.20001 °C with 1 decimals of accuracy
[07:22:21][D][sensor:092]: 'Garaz Humidity': Sending state 50.50000 % with 1 decimals of accuracy
[07:22:22][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:22][D][xiaomi_ble:161]:   Temperature: 8.5°C
[07:22:22][D][sensor:092]: 'MiFlora Tuje Temperature': Sending state 8.50000 °C with 1 decimals of accuracy
[07:22:22][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:22][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:22][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:23][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:23][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:23][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:23][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:24][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:24][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:24][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:25][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:26][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:26][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:29][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:30][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:30][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:30][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:31][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:31][D][xiaomi_ble:161]:   Temperature: 8.0°C
[07:22:31][D][sensor:092]: 'MiFlora Trawa Temperature': Sending state 8.00000 °C with 1 decimals of accuracy
[07:22:33][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:33][D][xiaomi_ble:173]:   Illuminance: 2415lx
[07:22:33][D][sensor:092]: 'MiFlora Trawa Illuminance': Sending state 2415.00000 lx with 0 decimals of accuracy
[07:22:33][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:36][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:37][D][xiaomi_ble:173]:   Illuminance: 288lx
[07:22:37][D][sensor:092]: 'MiFlora Tuje Illuminance': Sending state 288.00000 lx with 0 decimals of accuracy
[07:22:37][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:37][D][xiaomi_ble:176]:   Moisture: 23%
[07:22:37][D][sensor:092]: 'MiFlora Tuje Moisture': Sending state 23.00000 % with 0 decimals of accuracy
[07:22:38][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:39][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:39][D][xiaomi_ble:176]:   Moisture: 23%
[07:22:39][D][sensor:092]: 'MiFlora Tuje Moisture': Sending state 23.00000 % with 0 decimals of accuracy
[07:22:39][D][adc:056]: 'esp32_deszcz': Got voltage=0.02V
[07:22:39][D][sensor:092]: 'esp32_deszcz': Sending state 0.02476 V with 2 decimals of accuracy
[07:22:40][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:40][D][xiaomi_ble:176]:   Moisture: 23%
[07:22:40][D][sensor:092]: 'MiFlora Tuje Moisture': Sending state 23.00000 % with 0 decimals of accuracy
[07:22:40][D][xiaomi_ble:158]: Got Xiaomi LYWSD02 (E7:2E:01:21:1C:33):
[07:22:42][D][xiaomi_ble:161]:   Temperature: 22.0°C
[07:22:42][D][sensor:092]: 'Xiaomi LYWSD02 Temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[07:22:42][D][xiaomi_ble:158]: Got Xiaomi LYWSD02 (E7:2E:01:21:1C:33):
[07:22:42][D][xiaomi_ble:164]:   Humidity: 57.0%
[07:22:42][D][sensor:092]: 'Xiaomi LYWSD02 Humidity': Sending state 57.00000 % with 1 decimals of accuracy
[07:22:42][D][esp32_ble_tracker:456]: Found device 6F:C6:D2:5D:9F:96 RSSI=-67
[07:22:42][D][esp32_ble_tracker:477]:   Address Type: RANDOM
[07:22:42][D][xiaomi_ble:158]: Got Xiaomi LYWSDCGQ (4C:65:A8:DB:DB:A6):
[07:22:42][D][xiaomi_ble:161]:   Temperature: 16.2°C
[07:22:42][D][xiaomi_ble:164]:   Humidity: 50.5%
[07:22:42][D][sensor:092]: 'Garaz Humidity': Sending state 50.50000 % with 1 decimals of accuracy
[07:22:42][D][adc:056]: 'esp32_swiatlo': Got voltage=0.28V
[07:22:42][D][sensor:092]: 'esp32_swiatlo': Sending state 0.27619 V with 2 decimals of accuracy
[07:22:43][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:44][D][sensor:092]: 'esp32_gleba': Sending state 0.00000 V with 2 decimals of accuracy
[07:22:45][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:45][D][xiaomi_ble:176]:   Moisture: 23%
[07:22:45][D][sensor:092]: 'MiFlora Tuje Moisture': Sending state 23.00000 % with 0 decimals of accuracy
[07:22:45][D][xiaomi_ble:158]: Got Xiaomi LYWSDCGQ (4C:65:A8:DB:DB:A6):
[07:22:45][D][xiaomi_ble:161]:   Temperature: 16.2°C
[07:22:45][D][xiaomi_ble:164]:   Humidity: 50.5%
[07:22:45][D][sensor:092]: 'Garaz Humidity': Sending state 50.50000 % with 1 decimals of accuracy
[07:22:46][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:46][D][xiaomi_ble:176]:   Moisture: 23%
[07:22:46][D][sensor:092]: 'MiFlora Tuje Moisture': Sending state 23.00000 % with 0 decimals of accuracy
[07:22:46][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:46][D][xiaomi_ble:176]:   Moisture: 30%
[07:22:46][D][sensor:092]: 'MiFlora Trawa Moisture': Sending state 30.00000 % with 0 decimals of accuracy
[07:22:47][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
[07:22:47][D][xiaomi_ble:170]:   Conductivity: 161µS/cm
[07:22:47][D][sensor:092]: 'MiFlora Tuje Soil Conductivity': Sending state 161.00000 µS/cm with 0 decimals of accuracy
[07:22:47][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FC:33):
[07:22:47][D][xiaomi_ble:176]:   Moisture: 30%
[07:22:47][D][sensor:092]: 'MiFlora Trawa Moisture': Sending state 30.00000 % with 0 decimals of accuracy
[07:22:48][D][adc:056]: 'esp32_gleba': Got voltage=3.90V
[07:22:49][D][xiaomi_ble:158]: Got Xiaomi HHCCJCY01 (C4:7C:8D:65:FB:D5):
© 2019 Copyright ESPHome, Made with MaterializeESPHome 1.14.2 Documentation

Additional information and things you've tried:

OttoWinter commented 4 years ago

The issue is related to BLE (and does not match the symptoms fo #816).

Probably related to https://github.com/esphome/issues/issues/735. Please try different scan parameters for the BLE tracker and/or test if the same symptoms appear without BLE.

dgtal1 commented 4 years ago

The issue is related to BLE (and does not match the symptoms fo #816).

Probably related to #735. Please try different scan parameters for the BLE tracker and/or test if the same symptoms appear without BLE.

Just to confirm: you want me to play with "scan_parameters" parameters: interval, window, duration, active? In my config I did not set them and left the defaults. I read in #735 that the defaults changed. What were they in 1.13.6? I could try their previous values as they used to work just fine

OttoWinter commented 4 years ago

Correct.

The old defaults were:

interval: 512 ms
window: 48 ms
dgtal1 commented 4 years ago

I disabled BLE tracker completely in the current setup and will observe the switch during the day and then will enable it before I go to sleep with the old default values and will also see tomorrow how it behaved overnight. WiIl come back when I have some input.

Regarding the issue - if I understood 735 - there won't be any code fix, but the solution for such issues will be to change the values of the BLE tracker, right?

OttoWinter commented 4 years ago

Correct, there seems to be a balance of "stable WiFi connection" and "BLE getting many packets". I hoped with recent esp-idf versions it would tip towards the latter, but apparently not. Then the question will be which ones should be the default.

dgtal1 commented 4 years ago

One more remark from my side: why is that so that all esp sensors tracked by the tracker send their values constantly and only something that is not a sensor in fact is shown as unavailable for hours? Is it that some TCP 'ping' packet related to this entity is lost? If so - it must have been lost all the time (every time it's sent by ESP32) as the unavailable status lasts for long hours.

mikkaat commented 4 years ago

@grzeg8102 - can i please ask what you mean by 'the solution for such issues will be to change the values of the BLE tracker, right?'.. also, did this work for you?

thanks

OttoWinter commented 4 years ago

@mikkaat Set scan parameters in ble tracker to the defaults of v1.13.6:

esp32_ble_tracker:
  scan_parameters:
    interval: 320ms
    window: 30ms
dgtal1 commented 4 years ago

I can say that changing the parameters to:

interval: 512ms
window: 48ms

did solve the problem for me. I mean it sometimes changes to unavailable for a few seconds, but as noted above - this happens to me even without the BLE tracker enabled. I perceive the software with the above settings as stable as 13.6. So it's good enough for me.

@OttoWinter which numbers provided by you in this thread were defaults in 1.13.6? 512/48 you gave me or 320/30 you gave to @mikkaat ?

OttoWinter commented 4 years ago

@grzeg8102 I rechecked and it's 320/30. But it's mostly the ratio between the two that counts, which is the same for both.

Spirituss commented 4 years ago

I experience the similar symptoms. My config has ble scanner. It’s important, that esphome config has home assistant sensors, which work well and update correctly. At the same time neither esphome sensors nor esp32 in general are visible in HA. So it looks like one direction working integration instead of bi-directions as should be.

mikkaat commented 4 years ago

@mikkaat Set scan parameters in ble tracker to the defaults of v1.13.6:

esp32_ble_tracker:
  scan_parameters:
    interval: 320ms
    window: 30ms

Hi All,

I have been running 1.14.2 with the following settings for the last 3 hours and have not seen any drops..

esp32_ble_tracker:
  scan_parameters:
    interval: 512ms
    window: 48ms

Thanks @OttoWinter thanks @grzeg8102

stripeyhorse commented 4 years ago

Thanks @OttoWinter this fixed my issue.. Now working perfectly and i have flashed all my Esp32s

ktibor commented 4 years ago

I did, also the changes interval: 320ms window: 30ms

After that, there are not drops, but the OTA update is still not working with esp32_ble_tracker.

19:16:21][C][web_server:121]: Address: 192.168.2.33:80 [19:16:21][C][ota:029]: Over-The-Air Updates: [19:16:21][C][ota:030]: Address: 192.168.2.33:3232 [19:16:21][C][api:095]: API Server: [19:16:21][C][api:096]: Address: 192.168.2.33:6053 [19:16:57][D][ota:072]: Starting OTA Update from 192.168.2.5... [19:16:57][D][ota:243]: OTA in progress: 0.1% [19:16:58][D][ota:243]: OTA in progress: 4.5% [19:16:59][D][ota:243]: OTA in progress: 5.5% [19:17:00][D][ota:243]: OTA in progress: 9.9% [19:17:09][W][ota:309]: Error client disconnected while receiving data! [19:17:09][W][ota:276]: Update end failed! Error: No Error [19:17:09] [19:17:09][W][wifi_esp32:329]: Event: Disconnected ssid='XXXXXX' bssid=XX:XX:XX:XX:XX:XX reason=Beacon Timeout[W][wifi:094]: WiFi Connection lost... Reconnecting... [19:17:09] [19:17:09][W][wifi:482]: Restarting WiFi adapter... [19:17:09][D][xiaomi_ble:158]: Got Xiaomi LYWSDCGQ (XX:XX:XX:XX:XX:XX): [19:17:09][D][xiaomi_ble:161]: Temperature: 20.3°C [19:17:09][D][xiaomi_ble:164]: Humidity: 54.9% [19:17:09][D][sensor:092]: 'swicth02_192_168_2_33_temperature': Sending state 20.30000 °C with 1 decimals of accuracy [19:17:09][D][sensor:092]: 'swicth02_192_168_2_33_humidity': Sending state 54.90000 % with 1 decimals of accuracy [19:17:14][D][wifi:298]: Starting scan... [19:17:14][D][esp-idf:000]: E (57944) wifi: esp_wifi_scan_start 1245 wifi not start