esphome / issues

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

Wifi handshake failed on sonoff basic R2 with a defined binary_sensor #2303

Closed Neonox31 closed 2 years ago

Neonox31 commented 3 years ago

The problem

Hello,

First, many thanks for this awesome project ❤

I got some wifi handshake failures when a binary_sensor associated to GPIO0 is defined in my configuration for a sonoff basic R2. If I comment it out, failures gone and the device connects without issues.

I could see #432 and #455 but I could not find a fix or a valid workaround to the issue, I would like to keep the push button control on my device, do you think that is possible ?

Thanks a lot !

Which version of ESPHome has the issue?

v1.20.4

What type of installation are you using?

Docker

What platform are you using?

ESP8266

Board

esp8285

Component causing the issue

wifi

Example YAML snippet

substitutions:
  ROOM: bedroom
  ID: string_lights

esphome:
  name: sonoff-basic-2
  comment: "${ROOM}-${ID}"
  platform: ESP8266
  board: esp8285

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

logger:

api:

ota:

status_led:
  pin:
    number: GPIO13
    inverted: true

binary_sensor:
  - platform: gpio
    name: "${ROOM}_${ID}_button"
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: true
    on_press:
      - light.toggle: _light

output:
  - platform: gpio
    pin: GPIO12
    id: _relay

light:
  - platform: binary
    name: "${ROOM}_${ID}"
    id: _light
    output: _relay

Anything in the logs that might be useful for us?

Logs with `binary_sensor`:

INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[06:21:13][W][wifi_esp8266:454]: Event: Disconnected ssid='weberhome-iot' bssid=7A:D2:94:A8:27:02 reason='Handshake Failed'
[06:21:13][W][wifi:547]: Error while connecting to network.
[06:21:13][W][wifi:585]: Restarting WiFi adapter...
[06:21:14][I][wifi:250]: WiFi Connecting to 'weberhome-iot'...
[06:21:25][W][wifi_esp8266:454]: Event: Disconnected ssid='weberhome-iot' bssid=7A:D2:94:A8:27:02 reason='Handshake Failed'
[06:21:25][W][wifi:547]: Error while connecting to network.
[06:21:25][W][wifi:585]: Restarting WiFi adapter...
[06:21:30][D][wifi:380]: Starting scan...
[06:21:36][D][wifi:395]: Found networks:
[06:21:36][I][wifi:441]: - 'weberhome-iot' (7A:D2:94:A8:27:02) ▂▄▆█
[06:21:36][D][wifi:442]:     Channel: 6
[06:21:36][D][wifi:443]:     RSSI: -43 dB
[06:21:36][D][wifi:445]: - 'weberhome' (78:D2:94:A8:27:02) ▂▄▆█
[06:21:36][D][wifi:445]: - 'weberhome-guests' (7E:D2:94:A8:27:02) ▂▄▆█
[06:21:36][D][wifi:445]: - 'FreeWifi_secure' (E4:9E:12:BA:5D:32) ▂▄▆█
[06:21:36][D][wifi:445]: - 'Freebox-50DF6B' (E4:9E:12:BA:5D:30) ▂▄▆█
[06:21:36][D][wifi:445]: - 'SFR_8738' (30:7E:CB:6B:87:3C) ▂▄▆█
[06:21:36][D][wifi:445]: - 'SFR WiFi FON' (62:7E:CB:6B:87:3D) ▂▄▆█
[06:21:36][D][wifi:445]: - 'SFR WiFi Mobile' (62:7E:CB:6B:87:3F) ▂▄▆█
[06:21:36][I][wifi:250]: WiFi Connecting to 'weberhome-iot'...
[06:21:47][W][wifi_esp8266:454]: Event: Disconnected ssid='weberhome-iot' bssid=7A:D2:94:A8:27:02 reason='Handshake Failed'
[06:21:47][W][wifi:547]: Error while connecting to network.
[06:21:47][W][wifi:585]: Restarting WiFi adapter...
[06:21:47][I][wifi:250]: WiFi Connecting to 'weberhome-iot'...
[06:21:59][W][wifi_esp8266:454]: Event: Disconnected ssid='weberhome-iot' bssid=7A:D2:94:A8:27:02 reason='Handshake Failed'
[06:21:59][W][wifi:547]: Error while connecting to network.
[06:21:59][W][wifi:585]: Restarting WiFi adapter...
[06:22:04][D][wifi:380]: Starting scan...
[06:22:10][D][wifi:395]: Found networks:
[06:22:10][I][wifi:441]: - 'weberhome-iot' (7A:D2:94:A8:27:02) ▂▄▆█
[06:22:10][D][wifi:442]:     Channel: 6
[06:22:10][D][wifi:443]:     RSSI: -44 dB
[06:22:10][D][wifi:445]: - 'weberhome' (78:D2:94:A8:27:02) ▂▄▆█
[06:22:10][D][wifi:445]: - 'weberhome-guests' (7E:D2:94:A8:27:02) ▂▄▆█
[06:22:10][D][wifi:445]: - 'Freebox-50DF6B' (E4:9E:12:BA:5D:30) ▂▄▆█
[06:22:10][D][wifi:445]: - 'FreeWifi_secure' (E4:9E:12:BA:5D:32) ▂▄▆█
[06:22:10][D][wifi:445]: - 'SFR_8738' (30:7E:CB:6B:87:3C) ▂▄▆█
[06:22:10][D][wifi:445]: - 'SFR WiFi Mobile' (62:7E:CB:6B:87:3F) ▂▄▆█
[06:22:10][D][wifi:445]: - 'SFR WiFi FON' (62:7E:CB:6B:87:3D) ▂▄▆█
[06:22:10][I][wifi:250]: WiFi Connecting to 'weberhome-iot'...

Logs without binary_sensor:

INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[06:23:34][D][wifi:395]: Found networks:
[06:23:34][I][wifi:441]: - 'weberhome-iot' (7A:D2:94:A8:27:02) ▂▄▆█
[06:23:34][D][wifi:442]:     Channel: 6
[06:23:34][D][wifi:443]:     RSSI: -49 dB
[06:23:34][D][wifi:445]: - 'weberhome' (78:D2:94:A8:27:02) ▂▄▆█
[06:23:34][D][wifi:445]: - 'weberhome-guests' (7E:D2:94:A8:27:02) ▂▄▆█
[06:23:34][D][wifi:445]: - 'SFR WiFi FON' (62:7E:CB:6B:87:3D) ▂▄▆█
[06:23:34][D][wifi:445]: - 'FreeWifi_secure' (E4:9E:12:BA:5D:32) ▂▄▆█
[06:23:34][D][wifi:445]: - 'SFR WiFi Mobile' (62:7E:CB:6B:87:3F) ▂▄▆█
[06:23:34][D][wifi:445]: - 'Freebox-50DF6B' (E4:9E:12:BA:5D:30) ▂▄▆█
[06:23:34][I][wifi:250]: WiFi Connecting to 'weberhome-iot'...
[06:23:36][I][wifi:513]: WiFi Connected!
[06:23:36][C][wifi:359]:   SSID: 'weberhome-iot'
[06:23:36][C][wifi:360]:   IP Address: 192.168.10.67
[06:23:36][C][wifi:362]:   BSSID: 7A:D2:94:A8:27:02
[06:23:36][C][wifi:363]:   Hostname: 'sonoff-basic-2'
[06:23:36][C][wifi:367]:   Signal strength: -49 dB ▂▄▆█
[06:23:36][C][wifi:371]:   Channel: 6
[06:23:36][C][wifi:372]:   Subnet: 255.255.255.0
[06:23:36][C][wifi:373]:   Gateway: 192.168.10.248
[06:23:36][C][wifi:374]:   DNS1: 192.168.10.248
[06:23:36][C][wifi:375]:   DNS2: (IP unset)
[06:23:36][C][ota:029]: Over-The-Air Updates:
[06:23:36][C][ota:030]:   Address: 192.168.10.67:8266
[06:23:36][C][api:022]: Setting up Home Assistant API server...
[06:23:36][I][app:059]: setup() finished successfully!
[06:23:36][I][app:105]: ESPHome version 1.20.4 compiled on Aug  8 2021, 06:22:54
[06:23:36][C][status_led:019]: Status LED:
[06:23:36][C][status_led:020]:   Pin: GPIO13 (Mode: OUTPUT, INVERTED)
[06:23:36][C][wifi:499]: WiFi:
[06:23:36][C][wifi:359]:   SSID: 'weberhome-iot'
[06:23:36][C][wifi:360]:   IP Address: 192.168.10.67
[06:23:36][C][wifi:362]:   BSSID: 7A:D2:94:A8:27:02
[06:23:36][C][wifi:363]:   Hostname: 'sonoff-basic-2'
[06:23:36][C][wifi:367]:   Signal strength: -49 dB ▂▄▆█
[06:23:36][C][wifi:371]:   Channel: 6
[06:23:36][C][wifi:372]:   Subnet: 255.255.255.0
[06:23:36][C][wifi:373]:   Gateway: 192.168.10.248
[06:23:36][C][wifi:374]:   DNS1: 192.168.10.248
[06:23:36][C][wifi:375]:   DNS2: (IP unset)
[06:23:36][C][gpio.output:010]: GPIO Binary Output:
[06:23:36][C][gpio.output:011]:   Pin: GPIO12 (Mode: OUTPUT)
[06:23:36][C][logger:189]: Logger:
[06:23:36][C][logger:190]:   Level: DEBUG
[06:23:36][C][logger:191]:   Log Baud Rate: 115200
[06:23:36][C][logger:192]:   Hardware UART: UART0
[06:23:36][C][light:083]: Light 'bedroom_elyna_string_lights'
[06:23:36][C][ota:029]: Over-The-Air Updates:
[06:23:36][C][ota:030]:   Address: 192.168.10.67:8266
[06:23:36][C][api:095]: API Server:
[06:23:36][C][api:096]:   Address: 192.168.10.67:6053


### Additional information

_No response_
github-actions[bot] commented 2 years 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.