esphome / issues

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

ESPHome module non responsive (offline) after 2021.10.2 update #2613

Closed mariuszchrobak closed 2 years ago

mariuszchrobak commented 2 years ago

The problem

I have 2 modules based on ESP01s with ESPHome Midea (AC) SW on it. It worked perfectly for last few months. As of today, after updating to from 2021.9 to 2021.10 I got them bricked - GUI shows OFFLINE, I cannot get IP resolved to see any logs. The module comes back to life if I put it into programmer, when it is powered outside of the original board. There was no change to the original board, and the board was made specifically to avoid boot problems. It happened after a SW change so I would ruled out HW issue. All other ESPHome units, without Midea component are updated and working fine. Issue isolated to the Midea implementation.

Which version of ESPHome has the issue?

2021.10.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP8266

Board

ESP01s with UART board + IR on GPIO2: image

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Device does not boot in the destination board. Below logs after booting it up, powered by programmer, outside of its board:

INFO Successfully connected to bedroom1_ac.local
[13:47:57][I][app:099]: ESPHome version 2021.10.2 compiled on Oct 23 2021, 10:57:26
[13:47:57][C][wifi:490]: WiFi:
[13:47:57][C][wifi:352]:   Local MAC: 48:3F:DA:92:96:7D
[13:47:57][C][wifi:353]:   SSID: [redacted]
[13:47:57][C][wifi:354]:   IP Address: 192.168.1.133
[13:47:57][C][wifi:356]:   BSSID: [redacted]
[13:47:57][C][wifi:357]:   Hostname: 'bedroom1_ac'
[13:47:57][C][wifi:359]:   Signal strength: -70 dB ▂▄▆█
[13:47:57][C][wifi:363]:   Channel: 11
[13:47:57][C][wifi:364]:   Subnet: 255.255.255.0
[13:47:57][C][wifi:365]:   Gateway: 192.168.1.1
[13:47:57][C][wifi:366]:   DNS1: 208.67.222.222
[13:47:57][C][wifi:367]:   DNS2: 208.67.220.220
[13:47:57][C][uart.arduino_esp8266:095]: UART Bus:
[13:47:57][C][uart.arduino_esp8266:096]:   TX Pin: GPIO1
[13:47:57][C][uart.arduino_esp8266:097]:   RX Pin: GPIO3
[13:47:57][C][uart.arduino_esp8266:099]:   RX Buffer Size: 256
[13:47:57][C][uart.arduino_esp8266:101]:   Baud Rate: 9600 baud
[13:47:57][C][uart.arduino_esp8266:102]:   Data Bits: 8
[13:47:57][C][uart.arduino_esp8266:103]:   Parity: NONE
[13:47:57][C][uart.arduino_esp8266:104]:   Stop bits: 1
[13:47:57][C][uart.arduino_esp8266:106]:   Using hardware serial interface.
[13:47:57][C][template.switch:058]: Template Switch 'Bed1 AC Display Toggle'
[13:47:57][C][template.switch:058]:   Icon: 'mdi:theme-light-dark'
[13:47:57][C][template.switch:059]:   Restore State: NO
[13:47:57][C][template.switch:060]:   Optimistic: NO
[13:47:57][C][template.switch:058]: Template Switch 'Bed1 AC Swing Step'
[13:47:57][C][template.switch:058]:   Icon: 'mdi:tailwind'
[13:47:57][C][template.switch:059]:   Restore State: NO
[13:47:57][C][template.switch:060]:   Optimistic: NO
[13:47:57][C][logger:233]: Logger:
[13:47:57][C][logger:234]:   Level: DEBUG
[13:47:57][C][logger:235]:   Log Baud Rate: 0
[13:47:57][C][logger:236]:   Hardware UART: UART0
[13:47:57][C][remote_transmitter:018]: Remote Transmitter...
[13:47:57][C][remote_transmitter:019]:   Carrier Duty: 50%
[13:47:57][C][remote_transmitter:020]:   Pin: GPIO2
[13:47:57][C][captive_portal:150]: Captive Portal:
[13:47:57][C][midea:103]: MideaDongle:
[13:47:57][C][midea:104]:   [x] Period: 1000ms
[13:47:57][C][midea:105]:   [x] Response timeout: 2000ms
[13:47:57][C][midea:106]:   [x] Request attempts: 3
[13:47:57][W][midea:115]: Failed to get 0xB5 capabilities report. Suggest to disable it in config and manually set your appliance options.
[13:47:57][C][midea:535]: ClimateTraits:
[13:47:57][C][midea:536]:   [x] Visual settings:
[13:47:57][C][midea:537]:       - Min: 17.0
[13:47:57][C][midea:538]:       - Max: 30.0
[13:47:57][C][midea:539]:       - Step: 0.5
[13:47:57][C][midea:541]:   [x] Supports current temperature
[13:47:57][C][midea:547]:   [x] Supported modes:
[13:47:57][C][midea:549]:       - OFF
[13:47:57][C][midea:549]:       - FAN_ONLY
[13:47:57][C][midea:552]:   [x] Supported fan modes:
[13:47:57][C][midea:554]:       - AUTO
[13:47:57][C][midea:554]:       - LOW
[13:47:57][C][midea:554]:       - MEDIUM
[13:47:57][C][midea:554]:       - HIGH
[13:47:57][C][midea:562]:   [x] Supported presets:
[13:47:57][C][midea:564]:       - NONE
[13:47:57][C][midea:564]:       - SLEEP
[13:47:57][C][midea:572]:   [x] Supported swing modes:
[13:47:57][C][midea:574]:       - OFF
[13:47:57][C][midea:574]:       - VERTICAL
[13:47:57][C][ota:082]: Over-The-Air Updates:
[13:47:57][C][ota:083]:   Address: bedroom1_ac.local:8266
[13:47:57][C][api:134]: API Server:
[13:47:57][C][api:135]:   Address: bedroom1_ac.local:6053
[13:47:57][C][api:139]:   Using noise encryption: NO
[13:47:57][C][homeassistant.sensor:030]: Homeassistant Sensor 'follow_me_sensor_stuff'
[13:47:57][C][homeassistant.sensor:030]:   State Class: ''
[13:47:57][C][homeassistant.sensor:030]:   Unit of Measurement: ''
[13:47:57][C][homeassistant.sensor:030]:   Accuracy Decimals: 1
[13:47:57][C][homeassistant.sensor:031]:   Entity ID: 'sensor.bedroomtemphum_temperature'
[13:47:58][D][ApplianceBase:139]: Response timeout...
[13:47:58][D][ApplianceBase:154]: Destroying the request...
[13:47:58][D][AirConditioner:178]: Enqueuing a GET_STATUS(0x41) request...
[13:47:58][D][ApplianceBase:173]: Enqueuing the request...
[13:47:58][D][ApplianceBase:075]: Getting and sending a request from the queue...
[13:47:58][D][ApplianceBase:162]: TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 01 69 71 
[13:48:00][D][ApplianceBase:139]: Response timeout...
[13:48:00][D][ApplianceBase:146]: Sending request again. Attempts left: 2...

Additional information

No response

probot-esphome[bot] commented 2 years ago

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

oxan commented 2 years ago

I think it'll be useful to see the logs (over serial) when it boots up.

mariuszchrobak commented 2 years ago

I think it'll be useful to see the logs (over serial) when it boots up.

Added. Obviously, logs outside from the uart adapter board used as a target solution. Timeouts and capabilities fail is due to not being connected to the Midea unit - no uart communication supplied.

mariuszchrobak commented 2 years ago

2021.10.3 update did not fixed the issue.

gio-dot commented 2 years ago

2021.10.3 update did not fixed the issue.

Same situation for me.

mariuszchrobak commented 2 years ago

Updated with GPIO2 pin usage. I changed R1 from 330 Ohms into 10k Ohms and now board starts sometimes and randomly shuts its back off line. I was able to get Logs being on the target board (only at the bench, it does not work connected to the AC at all), but the only difference between logs I notice was this: [11:58:51][D][sensor:113]: 'follow_me_sensor_stuff': Sending state 71.29000 with 1 decimals of accuracy [11:58:51][W][midea:127]: Action needs remote_transmitter component

Spirituss commented 2 years ago

Same for me. Some of my esp can't back into Wi-Fi after OTA update to 2021.10.

dudanov commented 2 years ago

I partially figured out the problem. Version 2021.10 has undergone some significant changes. And when adding an IR transmitter to the configuration of the midea component using the option transmitter_id, endless reboots of the ESP8266 module begin to occur. At the same time, version 2021.9.3 and earlier works great.

mmakaay commented 2 years ago

Maybe the firmware .bin file grows too large, causing the reboots? That's one thing that we've seen and that might be a suspect here.

mariuszchrobak commented 2 years ago

Maybe the firmware .bin file grows too large, causing the reboots? That's one thing that we've seen and that might be a suspect here.

I doubt it. Mine is 445KB which should be under half of the ESP-01s I am using. Unless I have half meg version and not know it. I will try with no IR later though. 2021.9..3 worked great, I know it, because that was the last version I used :D but have no means (or skills) to revert to 2021.9.3

mariuszchrobak commented 2 years ago

The problem is related to the transmitter IR for some reason. I deleted followme option (uses HA sensor and "talks" over IR) thinking that this might have some compatibility issues - nope, still no boot. I deleted rest of the related stuff to the IR in the midea section, but left IR still in the yaml. I don't know if it got "optimized" and deleted, or what but now THIS WORKS:

esphome:
  name: bedroom1_ac
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "redacted"
  password: "redacted"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bedroom1 Ac Fallback Hotspot"
    password: "redacted"

captive_portal:

# Disable logging over UART (required)
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:

# UART settings for Midea dongle (required)
uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600

# Main settings
climate:
  - platform: midea
    name: "Bedroom 1 AC"
    #transmitter_id:
    visual:
      min_temperature: 17 °C
      max_temperature: 30 °C
      temperature_step: 0.5 °C
    beeper: false
    outdoor_temperature:
      name: "Temp"
    power_usage:
      name: "Power"
    humidity_setpoint:
      name: "Hum"

remote_transmitter:
  pin: GPIO2
  carrier_duty_percent: 50%

#sensor:
#  - platform: homeassistant
#    name: follow_me_sensor_stuff
#    entity_id: sensor.bedroomtemphum_temperature   # Sensor from HASS
#    internal: true
##    filters:
#      - throttle: 10s
#      - heartbeat: 2min             # Maximum interval between updates.
##      - debounce: 1s
#    on_value:
#      midea_ac.follow_me:
#        temperature: !lambda "return (x-32)*5/9;"
#        beeper: false               # Optional. Beep on update.

# template momentary switches for sending display control command and swing step actions
#switch:
#  - platform: template
#    name: Bed1 AC Display Toggle
#    icon: mdi:theme-light-dark
#    turn_on_action:
#      midea_ac.display_toggle:
#  - platform: template
#    name: Bed1 AC Swing Step
#    icon: mdi:tailwind
#    turn_on_action:
#      midea_ac.swing_step:
mariuszchrobak commented 2 years ago

Also, I added IR remote codes to disable display from the "old days", to have the function, and to see if it makes bin be too big, or it is hardware problem. Nope. Works fine. I added this to the yaml above:

switch:
  - platform: template
    name: "Bedroom 1 AC Display toggle"
    turn_on_action:
       - remote_transmitter.transmit_raw:
            carrier_frequency: 38kHz
            code: [  4390, -4371, 572, -1573, 548, -525, 570, -1575, 547, -1598, 547, -525, 573, -1570, 574, -500, 547, -1598, 551, -520, 549, -1597, 572, -498, 549, -524, 547, -1597, 572, -500, 550, -1596, 571, -500, 574, -1571, 572, -1574, 548, -1597, 546, 
                     -1598, 548, -523, 549, -1596, 572, -499, 573, -1571, 573, -500, 570, -501, 548, -524, 573, -500, 572, -1572, 548, -524, 549, -1597, 547, -523, 572, -1573, 572, -499, 548, -1596, 550, -522, 578, -495, 548, -1596, 571, -499, 549, -1598, 548, -523, 549, 
                     -1595, 571, -500, 549, -1596, 548, -1597, 548, -523, 574, -1571, 549, -523, 572, -5157, 4390, -4368, 548, -1596, 550, -521, 574, -1571, 572, -1573, 547, -525, 548, -1595, 549, -523, 550, -1594, 549, -524, 549, -1595, 548, -523, 550, -523, 548, -1596, 
                     548, -523, 550, -1595, 547, -524, 549, -1595, 549, -1595, 550, -1595, 549, -1598, 546, -524, 548, -1595, 549, -523, 548, -1598, 547, -522, 550, -523, 551, -520, 550, -522, 550, -1595, 549, -522, 551, -1596, 572, -499, 547, -1596, 548, -524, 549, -1596, 
                     548, -523, 550, -523, 571, -1574, 547, -523, 549, -1596, 548, -523, 549, -1597, 547, -523, 550, -1594, 574, -1572, 549, -522, 549, -1596, 549, -522, 550]
mariuszchrobak commented 2 years ago

So it is clearly something with the IR integration in the midea component (or rather some dependencies from newest ESPHome build). Hope that helps @dudanov (well, at least confirms your find)

Also remember - it worked with the original yaml configuration (midea using transmitter ir) when I had it in my programmer, which basically means that GPIO0/2 had different things connected to it... Weird.

dudanov commented 2 years ago

Try this fix. https://github.com/dudanov/esphome/tree/midea-rmt-fix

mariuszchrobak commented 2 years ago

Try this fix. https://github.com/dudanov/esphome/tree/midea-rmt-fix

I checked 2021.12.0-dev and I am happy to announce that it works! Module reports back to HA, I can control my AC and IR stuff works too - I used "Follow me" and its using my sensor for the AC. Thanks Sergey!