esphome / issues

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

SonOff Basic Rev1 not working any more with 2021.12.0 #2826

Open BenPru opened 2 years ago

BenPru commented 2 years ago

The problem

After compiling 2021.12.0 and uploading the firmware the device is offline and the fallback wlan is not available.

Which version of ESPHome has the issue?

2021.12.0

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

2021.11.5

What platform are you using?

ESP8266

Board

sonoff basic rev1

Component causing the issue

No response

Example YAML snippet

substitutions:
  device_name: "terrassenbeleuchtung"
  upper_device_name: "TerrassenBeleuchtung"
  # Green LED (inverted)
  status_led: GPIO13
  # Button (inverted)
  button_state: GPIO0
  # Relay and Red LED
  button_switch: GPIO12

esphome:
  name: $device_name
  platform: ESP8266
  board: esp8285

captive_portal:

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  password: !secret esphome_api_password

# Enable over the air updates
ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pass
  fast_connect: on
  use_address: 10.0.17.101

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name}"
    password: !secret fallback_password

# see: https://esphome.io/components/time.html
time:
  - platform: homeassistant
    id: homeassistant_time

# Enable Web server
web_server:
  port: 80
  auth:
    username: !secret esphome_web_username
    password: !secret esphome_web_password

text_sensor:
  - platform: version
    # entity_id: "${device_name}_version"
    name: "${device_name} - Version"
    icon: mdi:cube-outline

binary_sensor:
  - platform: status
    name: "${device_name} - Status"
    device_class: connectivity

  # toggle relay on/off
  - platform: gpio
    pin:
      number: ${button_state}
      mode: INPUT_PULLUP
      inverted: True
    id: "${device_name}_button_state"
    on_press:
      - switch.toggle: button_switch

sensor:
  - platform: wifi_signal
    name: "${device_name} - WLAN Signal"
    update_interval: 60s
    icon: mdi:wifi

  - platform: uptime
    name: "${device_name} - Uptime"
    update_interval: 60s
    icon: mdi:clock-outline

status_led:
  pin:
    number: ${status_led}
    inverted: True
  id: led_green

switch:
  - platform: gpio
    pin: ${button_switch}
    id: relay
  - platform: template
    name: "${upper_device_name}"
    icon: mdi:power
    optimistic: true
    id: button_switch
    turn_on_action:
      - switch.turn_on: relay
      # - output.turn_on: led_green
    turn_off_action:
      - switch.turn_off: relay
      # - output.turn_off: led_green

Anything in the logs that might be useful for us?

No response

Additional information

No response

ajfriesen commented 2 years ago

Having the same issue with some of my sonoff basics as well. I have 2 broken sonoffs basics now.

One sonoff basic was able to upgrade though.

Here is my config:

---
# Device: sonoff basic
# Light for globus lamp
#

substitutions:
  devicename: sonoff-basic-03
  upper_devicename: Globus

esphome:
  name: ${devicename}
  platform: ESP8266
  board: esp01_1m

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  reboot_timeout: 15min

# Enable logging
logger:

# Enable Home Assistant API
api:
  reboot_timeout: 15min

ota:

sensor:
  - platform: wifi_signal
    name: ${devicename}_wifi_signal
    update_interval: 10s
  - platform: uptime
    name: ${devicename}_uptime

text_sensor:
  - platform: version
    name: ${devicename}_esphome_version

# GPIO13 Green LED
status_led:
  pin:
    number: GPIO13
    inverted: yes

# GPIO0 Button inverted
binary_sensor:
  - platform: gpio
    id: button
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: ${devicename}_button
    on_press:
      - light.toggle: lamp

# GPIO12 Relay
output:
  - platform: gpio
    id: relay
    pin: GPIO12  

light:
  - platform: binary
    id: lamp
    name: ${upper_devicename}
    output: relay

I have taken apart the sonoff basic and flashed it again via serial USB. Flashing does work, but the device does not come back online.

randybb commented 2 years ago

Please provide logs..

ajfriesen commented 2 years ago

@randybb I do not think this has anything to do with the problem.

I have another sonoff basic with exactly the same config except the name and it is just working fine, even after the update.

smoke007 commented 2 years ago

@BenPru, See my post here https://github.com/esphome/issues/issues/2964#issuecomment-1019006987 I think this might help you.