esphome / issues

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

4CH Pro R1 not working (bootloop) #27

Closed peterforeman closed 5 years ago

peterforeman commented 5 years ago

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

Docker

ESP (ESP32/ESP8266/Board/Sonoff):

Sonoff 4CH Pro R1

ESP Chip Id 10442015
Flash Chip Id 0x144051
Flash Size 1024kB

Affected component:

"Generic Sonoff"

Description of problem: Uploading compiled firmware on my Tasmota-flash Sonoff 4CH Pro R1 creates a bootloop. The device never connects to WiFi anymore. Tried flashing via OTA (first time), and several times via serial. I tried the ESP8285 board (which is in the 4CH Pro R1) as well as the esp8266 board config. Nothing worked. Flashed Tasmota binary again which worked instantly (even remembered the settings).

Problem-relevant YAML-configuration entries:

esphomeyaml:
  name: 4chpro
  platform: ESP8266
  board: esp8285
  board_flash_mode: dout

Traceback (if applicable):

Not available yet, will update asap with serial logging.

Additional information:

meijerwynand commented 5 years ago

Greetings,

I am not sure about the difference in the 4CH and 4CH Pro. I have the former and flashed it today without any issue.

Here is the config I use.

esphomeyaml:
  name: ghrotto
  platform: ESP8266
  board: esp01_1m
  board_flash_mode: dout
  esphomelib_version: 1.10.1

...

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ## use fast_connect to connect to hidden WiFi SSID
  fast_connect: true
OttoWinter commented 5 years ago

Yes, serial logs would be required for debugging this issue. Please also make sure you read the FAQ entry about Wifi.

snicker commented 5 years ago

just passing through doing some research for a project to see if the pro will work for me... is it possible this is the problem?

The "FW/IO0" button (Switch 1) is not directly connected to GPIO0 of the ESP module. A different method has to be used to program this board.

see here for more and possible solution:

https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-4CH-and-4CH-Pro

Really interested in using esphome for this project but I also want the isolated relays for mains and low voltage control for this project that only the Pro has.

OttoWinter commented 5 years ago

@snicker GPIO0 needs to be LOW to enter programming mode (see generic ESP8266 docs). You need to find some way to access that pin.

brandond commented 5 years ago

It sounds like some models you can just hold down the button to pull it low; on others you have to solder a connection. This appears to be pretty well documented by the tasmota folks though.

peterforeman commented 5 years ago

Did some further testing. It crashes on connecting to wifi, using a static IP. Switching to DHCP fixes the problem.

Static config:

wifi:
  ssid: 'xxx'
  password: '12345678901234567890123456789012'
  fast_connect: on
  manual_ip:
    static_ip: 10.0.100.89
    subnet: 255.255.255.0
    gateway: 10.0.100.1
    dns1: 10.0.100.1
    dns2: 10.0.100.1

Serial output:

csum 0x2d
vbb28d4a3
~ld
␛[0;32m[I][logger:071]: Log initialized␛[0m
␛[0;35m[C][ota:461]: There have been 2 suspected unsuccessful boot attempts.␛[0m
␛[0;32m[I][application:053]: Running through setup()...␛[0m
␛[0;36m[D][binary_sensor:027]: 'Sonoff 4CH Status': Sending state OFF␛[0m
␛[0;35m[C][binary_sensor.gpio:016]: Setting up GPIO binary sensor 'Sonoff 4CH Button 1'...␛[0m
␛[0;36m[D][binary_sensor:027]: 'Sonoff 4CH Button 1': Sending state OFF␛[0m
␛[0;35m[C][binary_sensor.gpio:016]: Setting up GPIO binary sensor 'Sonoff 4CH Button 2'...␛[0m
␛[0;36m[D][binary_sensor:027]: 'Sonoff 4CH Button 2': Sending state OFF␛[0m
␛[0;35m[C][binary_sensor.gpio:016]: Setting up GPIO binary sensor 'Sonoff 4CH Button 3'...␛[0m
␛[0;36m[D][binary_sensor:027]: 'Sonoff 4CH Button 3': Sending state OFF␛[0m
␛[0;35m[C][binary_sensor.gpio:016]: Setting up GPIO binary sensor 'Sonoff 4CH Button 4'...␛[0m
␛[0;36m[D][binary_sensor:027]: 'Sonoff 4CH Button 4': Sending state OFF␛[0m
␛[0;35m[C][switch.gpio:023]: Setting up GPIO Switch 'Sonoff 4CH Relay 1'...␛[0m
␛[0;36m[D][switch:055]: 'Sonoff 4CH Relay 1': Sending state OFF␛[0m
␛[0;35m[C][switch.gpio:023]: Setting up GPIO Switch 'Sonoff 4CH Relay 2'...␛[0m
␛[0;36m[D][switch:055]: 'Sonoff 4CH Relay 2': Sending state OFF␛[0m
␛[0;35m[C][switch.gpio:023]: Setting up GPIO Switch 'Sonoff 4CH Relay 3'...␛[0m
␛[0;36m[D][switch:055]: 'Sonoff 4CH Relay 3': Sending state OFF␛[0m
␛[0;35m[C][switch.gpio:023]: Setting up GPIO Switch 'Sonoff 4CH Relay 4'...␛[0m
␛[0;36m[D][switch:055]: 'Sonoff 4CH Relay 4': Sending state OFF␛[0m
␛[0;35m[C][wifi:029]: Setting up WiFi...␛[0m
␛[0;32m[I][wifi:179]: WiFi Connecting to 'xxx'...␛[0m

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3

And eventually into safe mode:

ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
␛[0;32m[I][logger:071]: Log initialized␛[0m
␛[0;35m[C][ota:461]: There have been 10 suspected unsuccessful boot attempts.␛[0m
␛[1;31m[E][ota:466]: Boot loop detected. Proceeding to safe mode.␛[0m
␛[0;35m[C][wifi:029]: Setting up WiFi...␛[0m
␛[0;32m[I][wifi:179]: WiFi Connecting to 'xxx'...␛[0m

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
␛[0;32m[I][logger:071]: Log initialized␛[0m
␛[0;35m[C][ota:461]: There have been 0 suspected unsuccessful boot attempts.␛[0m
␛[0;32m[I][application:053]: Running through setup()...␛[0m

(etc)

peterforeman commented 5 years ago

@OttoWinter For me this can be closed, since the DHCP workaround is ok for me. But I can imagine others have this problem as well.

OttoWinter commented 5 years ago

I'll close this then. The issue is definitely somewhere in the internals of the ESP SDK though, which we can't change because it's closed-source and not known to us.

deece commented 5 years ago

I see the same problem, with DHCP enabled (same reset cause)

I have a pair of 4ch Sonoffs, flashing the same binary, one works as expected, and one has a boot loop. The Wifi network they connect to are hidden.

esphome:
  name: sonoff4ch_attic
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "redacted"
  password: "redacted"
  fast_connect: true
  domain: .lan

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: status
    name: "Sonoff 4CH Status"

switch:
  - platform: gpio
    name: "Sonoff 4CH Relay 2"
    pin: GPIO5
    id: out2
  - platform: gpio
    name: "Sonoff 4CH Relay 3"
    pin: GPIO4
    id: out3
  - platform: gpio
    name: "Sonoff 4CH Relay 4"
    pin: GPIO15
    id: out4

status_led:
  pin:
    number:  GPIO13
    inverted: True

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

light:
  - platform: binary
    name: "Workshop Lights"
    output: out1
OttoWinter commented 5 years ago

Moving the discussion to #455