mongoose-os-apps / shelly-homekit

Apple HomeKit firmware for Shelly's
Other
1.83k stars 130 forks source link

Shelly RGBW2 rebooting with all channels switched on in white mode #1161

Open mblackshaw opened 1 year ago

mblackshaw commented 1 year ago

I'm really loving this firmware on all my Shellies, but I wound up going down a rabbit hole today when a RGBW2 kept rebooting when I set all channels set to 100% in white mode.

At first I thought it was a wiring error of my own, but I tried disconnecting the device from all wires except power and it still kept rebooting itself. Then I flashed a brand new RGBW2, left it disconnected, set it to white mode and set all channels to 100% and it rebooted too.

Stock firmware runs happily with all channels set to 100%. I tried pulling a core dump from /debug/core to help debug, but it says "No core dump".

I think there is a bug here? Happy to help debug, if you tell me what to do!

timoschilling commented 1 year ago

Does that happens only on 100% or on others as well?

mblackshaw commented 1 year ago

The reboot seems to happens on lower %s as well, just not as fast. As more channels are set to 100% the reboot happens far sooner. Some datapoints:

It doesn't seem to be strictly related to all channels being on either, though it makes it worse:

The issue is less obvious because the default setting for channel "Initial state" is "Last", so when the reboot happens the lights flicker for a second, but ultimately remain on. It does create a really bad state though when you set all channels to 100%, because you end up in reboot loop that is tricky to recover from.

I also confirmed the behavior as happening in AP mode after factory reset – so it's unrelated to my wifi configuration.

timoschilling commented 1 year ago

Could you test with power saving mode disabled please?

mblackshaw commented 1 year ago

The above tests were done with power saving mode disabled (which was the default after reset).

Marfre888 commented 1 year ago

The reboot seems to happens on lower %s as well, just not as fast. As more channels are set to 100% the reboot happens far sooner. Some datapoints:

  • 50%, 50%, 50%, 50%: Reboot after ~7mins
  • 50%, 50%, 100%, 100%: Reboot after ~3mins
  • 50%, 100%, 100%, 100%: Reboot after ~30secs
  • 100%, 100%, 100%, 100%: Reboot within 5secs

It doesn't seem to be strictly related to all channels being on either, though it makes it worse:

  • Off, Off, 100%, 100%: No reboot after waiting 10mins
  • Off, 100%, 100%, 100%: Reboot after ~2mins

The issue is less obvious because the default setting for channel "Initial state" is "Last", so when the reboot happens the lights flicker for a second, but ultimately remain on. It does create a really bad state though when you set all channels to 100%, because you end up in reboot loop that is tricky to recover from.

I also confirmed the behavior as happening in AP mode after factory reset – so it's unrelated to my wifi configuration.

I've noticed mine rebooting every couple seconds, after flashing the firmware. To be honest, I was concerned that I was overloaded the power supply at max brightness, but then magically the problem went away, and I don't believe it reboots anymore.

Random thought, could it be because you haven't added it into homekit yet?

mblackshaw commented 1 year ago

Random thought, could it be because you haven't added it into homekit yet?

Unfortunately HomeKit pairing doesn't have any effect on this for me. For now, I've had to fall back to stock firmware (now going on 11 days continuous uptime).

timoschilling commented 1 year ago

Sounds like a bug in the underlying pwm mongoose lib for me. @rojer any ideas?

matthias-zivim commented 1 year ago

I can confirm the problem in CCT mode. When I set this to 100%, the restarts begin. As an example, I set the channel to max 95% the shelly RGBW2 is stable. Power saving mode off/1/2 does not matter. Thank you all for the great work!

Tony3b commented 1 year ago

Hello all, I have the same problems with my Shelly RGBW2. Mine also reboot when you set the brightness to 100%. It does not matter in which mode the Shelly's are operated. Is there currently already a solution to the problem?

Tony

Tony3b commented 1 year ago

@rojer, did you have some infos for us about that situation with the rgbw2?

dunker86 commented 1 year ago

I am also experiencing the exact same issue. With multiple channels at 100% the reboot happens almost instantly. Anything over 85% for any period of time is consistently unreliable for me. I’m hoping it turns out to be an easy fix (really appreciate the effort by all contributors)!

timoschilling commented 1 year ago

@rojer it must be something special to the shelly rgbw2, it's not reproducible on a esp8266 dev board.

Tony3b commented 1 year ago

Is there any news about the bug?

timoschilling commented 1 year ago

I can't reproduce the cases where some users say it happens with values lower then 100%. I have my Shelly running with 99% on 4 channels over hours without problem.

After hours (nights) of debugging I think I found a solution, which should make the Shelly stable at 100%. Hier is a test build: rgbw2-1161.zip

Now I need to grab some coffin, maybe you like to support me with some ☕ http://paypal.me/timoschilling

matthias-zivim commented 1 year ago

👍 Vielen Dank....sieht gut aus. Das Problem scheint weg. Noch besser ist der Dark Mode 😎 Die 20 Euro sind von mir. Danke PS: Kannst Du was zu rojer sagen? Wird er das Projekt weiter pflegen?

👍 Many thanks....looks good. The problem seems to be gone. Even better is the dark mode 😎 The 20 euros are from me. Thanks PS: Can you say something about rojer? Will he continue to maintain the project?

timoschilling commented 1 year ago

Thanks for the support! Rojer now works for Shelly, he announced that he will not invest many time in the future. I hope he will support us on heavy low level issues. I will take care about the general maintaining.

timoschilling commented 1 year ago

PS: On my route map is support for the Plus 2PM and all Pro models.

matthias-zivim commented 1 year ago

The Plus 2PM models! Three of them are lying here waiting to be used.

Shelly Plus Plug S ?

timoschilling commented 1 year ago

@matthias-zivim oh, yes plus plugs too, at the moment I didn't have any test devices.

Tony3b commented 1 year ago

@timoschilling Hello Timo. I installed your update (thank you). Unfortunately it didn't bring any improvement. Currently there is a reboot for almost every change. The RGBW2 is therefore no longer usable.

matthias-zivim commented 1 year ago

Hi, yes too bad, can confirm it! eg when simply turn off, it crashes

sargonphin commented 1 year ago

Hello, I would like to confirm that this problem still exists. Even worse, the dimmer might be affected as well, albeit far less frequently, but I cannot confirm this for sure. It could be the automated firmware updates that are triggered by iobroker that resets the device every now-and-then

We have 3 RGBW2 units where 2 of them in the hallway that has been running perfectly without problems for a while now and at high power too, and another one in the bedroom running at very low power but constantly turns off then resets to last state (worth noting that the delay between shutdowns is variable and has a very large span, could be hours or could be seconds). I have a feeling this is power-supply related, it could be the Shelly back-feeding some interference that resonates with the power supply and shutting it down or resetting it (I have seen that before on cheap supplies).

The supply of the working Shelly's in the hallway is a high-quality powerful Meanwell 24V supply where the "faulty" Shelly in the bedroom is using a no-name Chineesium small 12V supply. We are planning to replace this no-name supply for a better quality Meanwell and test the outcome.

Interestingly enough (and this is important), we seem to have 2 different flavors of Shelly's in the hallway because they both are running different branches of firmware: one is running 20230913-113259/v1.14.0-gcb84623 and the other is running20230913-131259/v1.14.0-gcb84623. The "faulty" Shelly in the bedroom is running the same firmware version 20230913-113259/v1.14.0-gcb84623 which proves this is not firmware related (hence why we thought about power supply)

I will let you know when we replace the supply if the problem still persists :)

mlloydphoto commented 10 months ago

Hi, I spent today swapping all my old aurora LED strip controllers over to Shelly ones now that CCT is supported - have been waiting years for a CCT controller compatible with homekit. Had loads of problems with 3/10 of them on connection issues and had to write them off, couldnt get them to make a stable connection they kept dropping off the wifi - and once a unit was flashed with mongoose and it dropped off the network it was impossible to get a connection stable enough to flash it back to stock firmware. I just updated the firmware on the last one, It was functioning fine for a couple of minutes, but after playing with the brightness controls a few times and moving it up to 100% and down it just stopped responding and then dropped off the network totally . any ideas on getting it back up and running and whether theres still issues on this?

mlloydphoto commented 10 months ago

Slightly more clear idea of the error

The RGBW2 crashed after fiddling with brightness levels (was working fine on stock for a bit before I upgraded to mongoose). After it crashes it disappears off the network, I have to factory reset the RGBW2 using the button. I then access the wifi network for the RGBW and try to reconnect it to my wifi but it wont connect, just keeps saying "Not connected (reverted), AP active", The light IS working correctly when Im connected to its network, I can turn it up or down. but when I put all the 4 white channels up to full it crashes again kicking me off the network [close] Connection died (code 1006)

Any ideas please, I cant flash it back to stock firmware when connected to its network and I cant get it back onto my wifi

josetavares83 commented 9 months ago

Hi Same problem here: when I turn on more then 1 channel (white mode) it reboots. Should I provide any further details to help fix this issue? Thks

campino60 commented 9 months ago

Hello everyone,

I'm brand new here and found my way here through the Shelly Homekit FW. Thanks for this project, it is very easy to install and works very well so far.

However, I have the same error as described here in this thread.

I have installed approx. 3 x 1.5m RGBW 24V Led Stripes with 3 x Shelly RGBW2 controllers. The power of the power supply (100W) and also the power of the Shelly is not overloaded.

I also have the problem that when I operate the LEDs in RGB mode above 95%, the controllers reboot at irregular intervals.

In pure white mode I have (not yet) also noticed this error.

I hope there is a solution to this error

bullox commented 8 months ago

Facing similar issues. After messing about, I'm not actually sure it's just a CCT/brightness issue...

I'm running a couple of CCT strips from an RGBW2, on 24V, well below max rating per channel. First encountered issue when turning on both strips and switching one from warm to cool white. But have been trying to diagnose and it's been resetting at other times too. Tried in RGBW mode, and similar reset happens, mainly when messing with channels quickly, but that might just be coincidence too.

Tried @timoschilling firmware from Feb 2023, but same issue. Happy to try more diagnosis, would love to get this working.

campino60 commented 8 months ago

A short update Shelly RGBW2 works without any problems when the brightness is set to 95% no matter if W or RGB no reboot or hang up

campino60 commented 4 months ago

many thanks for your work and the further development of this project

after the first tests the error has been fixed and all channels can be operated at 100% without the system resetting and hanging up

Tony3b commented 4 months ago

Hello everyone,

Unfortunately, I cannot confirm that the error has been fixed.

I have just reset my Reserve Shelly again and then installed the latest firmware. After a few minutes, the Shelly crashes and restarts. As soon as you regulate the power, the HomeApp shows the message “No response”.

In the long term, I will probably replace all Shellys with other systems that can be used with AppleHome without errors.

Greats Tony

josetavares83 commented 4 months ago

Hi,

Error still exists.. if it helps to solve it I can leave a direct access to one of the devices for remote testing.

I hope you can find a solution to this error soon.

Thanks

KR José

markirb commented 4 months ago

I fear this problem lies within ESP-IDF at least there have been some bugfixes related to pwm in newer version.

Needs a deeper look. But unfortunately I cannot reproduce this in any way...

cdhutzler commented 4 months ago

Would a “stupid” solution just be to convert 100% into say 97% so the device just doesn’t crash? I doubt anyone would be able to see the difference in brightness.

 Or maybe the issue is something more intricate(?)

Carl Hutzler (c) 703.915.6862

On Jul 24, 2024 at 8:33 AM -0400, Markus Kirberg @.***>, wrote:

I fear this problem lies within ESP-IDF at least there have been some bugfixes related to pwm in newer version. Needs a deeper look. But unfortunately I cannot reproduce this in any way... — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

markirb commented 4 months ago

The current fix is kind of this way (though not using pwm anymore for 100% but a fixed level). Some posts say it resolved the issue, some apparently do not.

Can somebody just confirm that on 99% this does not happen, or write in more detail what they do to provoke this? Does this also happen when you set brightness via Webinterface?

matthias-zivim commented 4 months ago

I have two RGBW2 in white mode. Both on 2.12.1 behave the same. 99% as the maximum setting at the moment it seems stable.

Juanpermon commented 3 months ago

Hi there. I have the same problem. Where are we on this issue? Thank you for everything.

markirb commented 3 weeks ago

I think we are nowhere really on this issue. Whatever I try I cannot reproduce this on any of my RGBW2s....

So currently this seems like a Hardware related / Powersupply issue which happens at full brightness. Only explanation would be power spikes due to the synchronized timers...