localbytes-plug-pm icon indicating copy to clipboard operation
localbytes-plug-pm copied to clipboard

output cycling when rebuilding firmware

Open opb opened this issue 2 years ago • 4 comments

Hi

I find that when rebuilding and uploading the firmware in ESPHome, it will turn off the output. Is this a software or hardware issue? ie, is it physically impossible given the hardware to not power cycle when reloading firmware?

Thanks

opb avatar Jan 25 '24 12:01 opb

Hmm. I'm not sure. You could try changing default_state: "RESTORE_DEFAULT_OFF" to default_state: "RESTORE_DEFAULT_ON" and see if it makes a difference. If the relay itself is Normally Open, it might be impossible to maintain power to it during a power cycle, depending on how esphome initialises.

JamesSwift avatar Feb 28 '24 16:02 JamesSwift

I set default_state: "ALWAYS_ON" on my devices that I don't want power cycling after an update and I haven't had an issue

kgleeson avatar Mar 27 '24 11:03 kgleeson

Thanks for the responses. I did set default_state: ALWAYS_ON in the substitutions but it still very briefly flicks the power on and off when rebooting or during the reboot part of an upgrade - you can hear the audible click of the relay and attached lamp (for testing) flicks off then back on. It’s quick, but will drop the load of a power supply.

should I be configuring ALWAYS_ON elsewhere, or am I going to have to accept that this won’t do what I want?

cheers!

opb avatar Mar 30 '24 17:03 opb

Ah, I'm not really sure what else to suggest. I wonder if the tasmota firmware does it too? I suspect it will depend on how it's wired to the output pin of the esp8266. When the chip reboots, the pin might default to high or low before the firmware takes over and sets it.

JamesSwift avatar Apr 09 '24 18:04 JamesSwift

https://github.com/LocalBytes/esphome-localbytes-plug/pull/6 has the fix for this.

nijel avatar Oct 02 '24 08:10 nijel

THanks @nijel - I can confirm this has worked for me.

opb avatar Oct 03 '24 09:10 opb

Thanks! I didn't know about that feature of esphome. I've updated the main branch.

JamesSwift avatar Oct 05 '24 19:10 JamesSwift