esphome / issues

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

Again. Intense Light flash on H801 on connecting power #3001

Closed volkerjaenisch closed 2 years ago

volkerjaenisch commented 2 years ago

The problem

There is a intense appx. 50ms long flash wenn connecting the H801 to power.

As discussed (and solved!) here in #1783 as well as at Tasmota: Tasmota 649 Tasmota 7165

The Problem is that the GPIOs driving the MOSFETs are in an undefined state while starting the firmware. This was the cause bei tasmota and it is not far fetched that this is the problem with esphome also.

Which version of ESPHome has the issue?

esphome 2022.1.2

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

2021.12.7

What platform are you using?

ESP8266

Board

H801

Component causing the issue

H801

Example YAML snippet

esphome:
  name: h801

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: DEBUG
  hardware_uart: uart1

# Enable Home Assistant API
api:
  password: "xxxx"
ota:
  password: "xxxx"

wifi:
  ssid: "xxxx"
  password: "xxxx"

sensor:
  - platform: wifi_signal
    name: "WiFi Signal h801light"
    update_interval: 60s

output:
  - platform: esp8266_pwm
    pin: 12
    frequency: 1000 Hz
    id: pwm_b
  - platform: esp8266_pwm
    pin: 13
    frequency: 1000 Hz
    id: pwm_g
  - platform: esp8266_pwm
    pin: 15
    frequency: 1000 Hz
    id: pwm_r
  - platform: esp8266_pwm
    pin: 14
    frequency: 1000 Hz
    id: pwm_w
light:
  - platform: rgbw
    name: "H801 Light"
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    white: pwm_w

Anything in the logs that might be useful for us?

Nothing, sorry.

Additional information

Beside this intensive flash everything works as expected.

This problem was solved in an older version see #1783 but has resurfaced. So I am quite sure that it can be solved quite easily, by tracking the code changes concerning the mentioned fix.

I flashed the H801 utilizing esphome on the newest raspberryPiOS Buster on a raspberryPI4.

probot-esphome[bot] commented 2 years ago

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

volkerjaenisch commented 2 years ago

@OttoWinter Thanks for the fast action! Sorry, but the Fix does not change the behavior. Is there anything that has to be configured to activate the fix? Cheers, Volker

OttoWinter commented 2 years ago

The fix is currently only in the dev branch and will be included only in the next release, i.e. 2022.3.0 - do you have the dev version installed?

volkerjaenisch commented 2 years ago

@OttoWinter Surely, I used the dev-branch of this repository. I also made sure the the former version was erased utilizing esptool.py erase_flash. I ordered a second H801 to check if this is a hardware related or a software-related Problem. Without the original firmware this is difficult to decide. Cheers, Volker

volkerjaenisch commented 2 years ago

@OttoWinter The new H801 just arrived. When I power the original device with unaltered firmware then it shows the same behavior as the esp-home patched H801 with the stable or dev-firmware. Original H801 firmware : A 100% lightflash for appx a second H801 esphome-dev firmware : A 100% lightflash for appx 1/10 of a second So congratulations @OttoWinter, your approach is ten times faster than the original firmware! Really impressive!

So this is probably a hardware problem of the H801 device. Can any other H801 user please confirm if this correct?

If this is the case then the H801 device is rather useless. In my case I liked to control high power LEDs (30W/m) of my work-room with 20 Meters of LED-stripe. With H801 on power up it feels like a nuclear bomb flash.

Leaving the H801 steady on power and the PWM switched off is no option. First I like to control it via simple light switches. And second the standby power loss of the power source is to high for my liking.

volkerjaenisch commented 2 years ago

@OttoWinter OK found the final proof. It is a hardware problem. hardware problem. The last image shows a workaround circuit, that I will test at the next weekend.

OttoWinter commented 2 years ago

A slight amount of time probably is inevitable, depending on how the hardware is implemented.

The ESP will just take some time for loading the bootloader etc, during which time we don't have any control over it. That could probably be overcome by having an external polldown resistor on the GPIO pin, but depends on the exact schematics.

I don't think much faster than is now in the dev branch can be achieved easily, as the patch already executes it as early as we can without modifying the bootloader.

You probably can fix it by soldering on external pulldown resistors, but depends on hardware

glmnet commented 2 years ago

another work around I did not try though is to use the W2 for blue, its GPIO4