Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shelly app causes Homey to restart continuously and show a red ring #28

Closed
mkwanten85 opened this issue Nov 13, 2019 · 41 comments
Closed
Labels
wontfix This will not be worked on

Comments

@mkwanten85
Copy link

When I installed the Shelly app last week, my Homey started rebooting continuously. At first I thought it was the power supply of my Homey so I replaced it with a new one without any result.

When my Homey rebooted I was able to navigate to the apps section. There I noticed the Homey rebooted again when it was starting the Shelly app. At some point it was running for a short while and I've managed to use the Shelly 2.5 switch, but when I tried to install the Shelly H&T yesterday the Homey kept rebooting again.
For now I've deleted the Shelly app so my Homey (software version 3.1.0) keeps working fine. I've tried installing and deleting the Shelly app at least three times now and every time the app is installed my Homey keeps rebooting itself.

Would be nice if this problem can be found and fixed so I can use my Shelly devices with Homey.

If you need more information just let me know.

Best regards,
Marcel

@jghaanstra
Copy link
Owner

Interesting, out of +450 users you are the first to report this. Do you know how to run the app from the command line? Perhaps that will give more details as to why this is happening. It might also help if you are able to send a crash report from the app settings through the Homey smartphone app.

@mkwanten85
Copy link
Author

I'm not able to send a crash report from the app. As soon as I install the app, my Homey reboots. When it's loading the apps again I'm able to get into the Shelly app, but I'm not able to send a diagnostic report (button is disabled). When all apps are loaded and it's trying to load the Shelly app it reboots again.

Are there any instructions on how to run the app from the command line? I'll try it as soon as I get home this afternoon. I think I'm able to send a report to Athom when I don't have the Shelly app installed, but I don't know if it is useful for them in this case.

@jghaanstra
Copy link
Owner

You can find information on how to use the command line here: https://community.athom.com/t/how-to-cli-install-method/198

Make sure you run the app with athom app run

@jghaanstra
Copy link
Owner

Als have a look at this, perhaps that helps you as well.

#18 (comment)

@mkwanten85
Copy link
Author

Tried both options, first via console gave this result:
Schermafbeelding 2019-11-13 om 16 10 12
Homey rebooted again.

Then by first installing the device, same issue; Homey reboots.

Thanks for the help and quick responses so far!

@jghaanstra
Copy link
Owner

jghaanstra commented Nov 13, 2019

Does it also crash when you remove all Shelly devices first?

@mkwanten85
Copy link
Author

I've done that already so there are no Shelly devices installed.

@jghaanstra
Copy link
Owner

If that is the case I think it's highly unlikely it's related to my app. I dont want to scare you but it sounds more like some corrupt memory. Have you tried installing any other app recentely to see if that does not cause similar issues?

@mkwanten85
Copy link
Author

Yes I've tried several times. Even today I was able to install the Xiaomi Aqara Zigbee app (and install sensors) and the Ubiquiti Unifi app. I'll report the issue to Athom tomorrow, maybe they can help finding out what causes the problem.

@Spijkmans
Copy link

Ooh... So I'm not the only one having this issue.....
I have two types of Shelly's, a Plug S and a Roller Shutter.
By making a (big) modification to the code, basically stripping every thing except the two types of shelly devices I have from 'apps.js', I got it running. I used atom cli to install it on my Homey.
That has worked so far without issues. But resolving the issue altogether would be great.
I'm very curious if Athom can help out finding the issue....
Schermafbeelding 2019-11-17 om 22 51 34

@jghaanstra
Copy link
Owner

Ooh... So I'm not the only one having this issue.....
I have two types of Shelly's, a Plug S and a Roller Shutter.
By making a (big) modification to the code, basically stripping every thing except the two types of shelly devices I have from 'apps.js', I got it running. I used atom cli to install it on my Homey.
That has worked so far without issues. But resolving the issue altogether would be great.
I'm very curious if Athom can help out finding the issue....

It would be very helpful for me if you could slowly re-add the removed cards to see what is causing it. My guess is that you can re-add all the action cards at once and see if any of the condition cards is the culprit. It's still strange only a two or maybe three out of 450 users experience this.

@mkwanten85
Copy link
Author

I've reported the issue to Athom on November 14th, so far no response. As soon as I receive an answer I'll let you know.

@mkwanten85
Copy link
Author

A week ago I got an answer from Athom (sorry for reporting it so late). The answer was in Dutch, I'll summarize it here in English so it's clear for everyone reading this issue.

I suspect the problem is in the Shelly app because this is clearly the cause and the problem ends as soon as the app is no longer installed.

They are going to send me a new adapter to rule out that this causes the problem. I already tried another adapter so I don't think this is the problem, but it's worth trying.

@jghaanstra
Copy link
Owner

It's definitely in the Shelly app since removing some flow cards seems to fix it according to @Spijkmans. But since I can not reproduce it and about 500 other users do not seem to have this problem it's hard to troubleshoot. As mentioned to @Spijkmans you would have to do a trail and error slowly removing more and more cards to see which one causes it (and start with the condition cards). Once I know which card(s) cause then issue I can perhaps understand why. But this is something you guys need to do for me to be able to solve this.

@mkwanten85
Copy link
Author

Hopefully @Spijkmans is able to do so. I'm not a programmer myself, so I have to do some research (and find some spare time) first before I'm able to understand what I'm doing.

Isn't it easier to do a trial and error by commenting out all the cards and start adding them one by one, instead of removing them one by one? In that way Homey isn't restarting every time.

I'll wait for an answer from @Spijkmans and for the new adapter to arrive, otherwise maybe I can try something somewhere in the future. For now I'm using the app from Shelly itself to automate my home ventilation.

@Spijkmans
Copy link

I finaly found some time to test things out. This is what I've done;
I downloaded a copy of 'cloud.shelly-master.zip' , unpacked it and made a n extra local copy of cloud.shelly-master for me to test with.

I first tried running it as-is => Crash.
Next I commented out the flowcards code in 'app.js' => Crash.
I removed 1 by 1 all the drivers from the 'drivers' folder, remove the driver in 'app.json' from the driver and discovery sections and then test. Repeated this until none where left... It crased every time...

Reverted to state where all flowscards where remarked and I removed the folder ' tinycolor2' and it's dependency lines in 'package.json' => Crash.
Then I also removed the drivers depending op 'tinycolor2' ie ShellyRGB and Shelly Bulb => Crash.

Removed the 'Shelly EM' , 'Shelly Pro 4' , 'Shelly HT', 'Shelly Flood' and 'Shelly Dimmer' 1 by 1 and test.
With only 'Shelly 1', 'Shelly 1PM', 'Shelly 2(.5)', 'Shelly Roller Shutter', ' Shelly Plus (S)' remaining, Iit loaded and didn't crash!!!!!

Tried adding a Shelly Plug S and that worked, but when adding a flow => Crash.
Uncommented the flows for Shelly 1/2/2.5/Roller Shutter/Plug (S) and even adding a flow worked.

Re-adding the 'Shelly HT' seems to work fine but as soon as I add any other driver => Crash.
At this moment I realised that the crashes might be related to 'tinycolor2', but when adding 'Shelly Pro 4' it again crashed...
Restoring the folder 'tinycolor2' => Worked.
Re-adding the dependency in 'package.json' => Crash.

So this is what I have now;
image

For now I'm gone let this run for some time, hopefully it won't crash.. :)
Then I have to figure out what to do next...

@jghaanstra
Copy link
Owner

Thanx for all the effort, unfortunately the information isnt very conclusive in pinpointing the issue. I doubt tinycolor2 is the cause since adding the Shelly Pro 4 driver caused a crash as well. It's really strange either way as these drivers do absolutely nothing if no devices for these drivers have been paired.

Did you test it repeatedly to make sure your action have the same result and to rule out it's just random behaviour if if crashes or not (and thus unrelated to the changes you made)?

@Spijkmans
Copy link

Every test I did, I repeated before moving to the next step (so 2 tests per step).
And yes it inconclusive. As you point out Shelly Pro 4 has nothing with tinycolor2 (as far as I can tell) and yet it crashed.
I'm planning to retest this step tomorrow evening, to make sure I didn't miss out any thing.
I just want to see it run for (almost) a day first.

@jghaanstra
Copy link
Owner

@Spijkmans did you ever re-test this? So far you guys seem to be the only two out of 700+ users that have this issue. I really dont know where to look.

@Spijkmans
Copy link

Sorry for the late response, but I did some further testing. But to no avail...
I’ve even checked with a friend of mine, with whom I bought the Homey at the same time. He had no issues with the Shelly app.
Even more debugging, I added lots of logging lines to the app, had no results. The app crashes the Homey right after loading the app.js.
Even removing all devices (still crashed) and all apps (still crashed) I have had no luck in getting the Shelly app to run on my Homey.
Even a factory reset, with just the Shelly app installed and no devices, no flows, no logic, didn’t help. The Homey just crashes.

As you I’m baffled as where to look to fix this problem.

@mkwanten85
Copy link
Author

I'll try to install the app again later today. If the problem still occurs I'll let you know, but if I am the second to only one of all users experiencing this problem you don't have to spend any time on it. Then I'll just use the app from Shelly and I have to accept that I cannot use it with Homey.

@mkwanten85
Copy link
Author

I tried again yesterday but Homey restarted immediately. I'll be using de Shelly devices without Homey then.

Maybe somewhere in the future I can figure out what is causing the problem, but I don't see that happening soon.

@jghaanstra jghaanstra added wontfix This will not be worked on and removed waiting for input labels Jan 29, 2020
@jghaanstra
Copy link
Owner

I'm closing this. I have absolutely no idea what is going on and you seem to be the only two out of 770 users that experience this.

@Spijkmans
Copy link

I know this issue is closed, however I wanted to tell you this;
Last week I bought an Homey Pro, which was deliverd at the office I work (yeah even with Covid-19 people still get to offices...) and I tested out the Homey by restoring a backup of my other Homey. I even created my home wifi at the office. And when it all worked I installed the Shelly App. No issues what so ever, I was pleased..!
But when I came home and turned on the new Homey Pro..... It crashed even before I could connect to it, with a red led ring... Aaaargh not again..!
I got it working again by removing the Shelly App. The next office day I toke my old Homey to the office and powered it up. Next I installed the Shelly App which worked without any issues.

My conclusion: there is nothing wrong with the Shelly App and the issue mentioned must have some other cause, possibly environmental (Z-wave/Zigbee or wifi) related.
Just wanted to let you all know, as @mkwanten85 also mentioned this issue and it may help us both in finding the real cause.

@jghaanstra
Copy link
Owner

Thanx for updating the issue with extra issue. It seems to be related to the netwerk Homey is connected to (probably the way the router is setup) and in relation of the mDNS broadcast messages which are send to discover the devices during pairing. There is more info in this topic on the community forum.

https://community.athom.com/t/installing-shelly-app-makes-homey-unresponsive/33157/13

@Spijkmans
Copy link

Hi Jelge, I tried to enable/disable mDNS in my Unifi router in order to fix the crasing of my Homey.
No result yet. Next I tried contacting Athom support asking to send me the diagnostic report I created, however they wont send it... They would only send it to developers of the app involved.
So I installed the Shelly, Homey crashed, rebooted, I uninstalled Shelly app, created a Diagnostic Report (ID: ED81AFF11E). Now I hope you would be willing to ask Athom for the diag report and share it with me.
Should I also message Athom Support?

@jghaanstra
Copy link
Owner

I believe the logs are cleaned on a reboot so there might not be much in there anymore after a reboot. But I'll contact Athom and will request the log. Let's see if they are willing to supply this to me. I'll open the issue as well if we are going to troubleshoot it once more.

@jghaanstra jghaanstra reopened this Aug 18, 2020
@jghaanstra
Copy link
Owner

jghaanstra commented Aug 19, 2020

@Spijkmans I submitted a support request and talked with Boaz from Athom support today. As another user already noticed it does indeed seem to be related to DNS calls. Your log contains this warning *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***.
During Homey startup it starts the mDNS/DNS-SD stack which shortly after fails to load with the error (uncaughtException) Error: dns service error: unknown. From there on it loops between starting up and crashing causing a high system load.

You said you already enabled/disabled mDNS on your UniFi router. But are you perhaps also running a custom DNS server like Pihole that could be misconfigured? If so, try to use an external DNS server (8.8.8.8 for instance) and see if that solves the issue.


For reference, these errors are also in the log but it seems to me that this is a consequence of Homey struggling with the DNS resulting in timeouts.

Aug 18 22:09:35  rc.local[537]: 2020-08-18 22:09:35 homey:manager:apps             [App] [cloud.shelly] Error: Timeout
Aug 18 22:09:35  rc.local[537]:     at timeoutPromise (/opt/homey-client/system/helpers/index.js)
Aug 18 22:09:35  rc.local[537]:     at /App.js:
Aug 18 22:09:35  rc.local[537]:     at Array.map (<anonymous>)
Aug 18 22:09:35  rc.local[537]:     at App._setState (/App.js)
Aug 18 22:09:35  rc.local[537]:     at async /App.js {
Aug 18 22:09:35  rc.local[537]:   cause: 'timeout'
Aug 18 22:09:35  rc.local[537]: }
Aug 18 22:09:35  rc.local[537]: 2020-08-18 22:09:35 homey:manager:apps             [App] [cloud.shelly] Error: Timeout
Aug 18 22:09:35  rc.local[537]:     at timeoutPromise (/opt/homey-client/system/helpers/index.js)
Aug 18 22:09:35  rc.local[537]:     at /App.js
Aug 18 22:09:35  rc.local[537]:     at Array.map (<anonymous>)
Aug 18 22:09:35  rc.local[537]:     at App._setState (/App.js)
Aug 18 22:09:35  rc.local[537]:     at async /App.js {
Aug 18 22:09:35  rc.local[537]:   cause: 'timeout'
Aug 18 22:09:35  rc.local[537]: }

@jghaanstra jghaanstra added waiting for input and removed wontfix This will not be worked on labels Sep 8, 2020
@jghaanstra
Copy link
Owner

@Spijkmans , are you still alive and able to answer the last question?

@mkwanten85
Copy link
Author

@jghaanstra Yesterday I had some time to change some settings in my network environment as well. I have a few Unifi access points so at first I thought I had to look over there, but the mDNS settings were already disabled. Then I checked my ASUS router, I couldn't find any mDNS settings in there but I disabled some other settings with no luck (Homey started rebooting again after installing the Shelly app). After disabling some media server and Network Place settings in my router and installing the Shelly app again it worked fine.
At this moment the app and Homey are still running ok. I've also added the Shelly 2.5 Relay and H&T devices and these work fine as well.
Looks like this issue is fixed for me by changing some settings in my router. Hopefully disabling these settings won't cause any other network problems for me, but so far I haven't encountered any other problems.

@jghaanstra
Copy link
Owner

@mkwanten85 , thanx for looking into this. I would be really helpfull to know which settings you changed in your router. Do you have the description of the settings you changed?

@mkwanten85
Copy link
Author

@jghaanstra Never mind my previous comment. Today I was trying to pinpoint the exact problem by enabling the options one by one again.
I started by enabling the UPnP Media Server in the router. When I restarted Homey the problem was back again. So I thought this was causing the problem.
But now I disabled the UPnP Media Server again and tried to re-install the Shelly app on my Homey but the problem is still there. So now I have the exact same settings as yesterday but Homey keeps rebooting after I installed the Shelly app. Problem is back again..

@Spijkmans
Copy link

@jghaanstra Sorry for my late reply...
I did try the 8.8.8.8 DNS server as suggested, to no avail...
I even removed my PiHole from the network and tried the ISP DNS AND THE 8.8.8.8 DNS. Still the Homey crashes.
May be an short description of my home network can give some insights. @mkwanten85 how is your network setup compared to mine?

I have a KPN fiber all-in-one (Internet/TV/Phone) with an UNIFI USG-3 as router. (I also tried the ISP supplied router, a ZTE router, but that also didn’t help)
Two UNIFI switches, two UNIFI AccessPoints and a UNFI Cloud Key 2 as controller. No vlan other than needed in the KPN router config.
IGMP Snooping is enabled on the router and switches as this is required for ipTV too work. (And yes I did try disabling it but that didn’t help either).
A PiHole is setup as a local DNS server (functions as a network add filter).
The UNIFI devices are all of a the latest firmware.
My Homey is connect with the wifi network and has good signal (according to my UNIFI controller) The Homey has the latest update.

Still looking for a solution... 😁

@mkwanten85
Copy link
Author

@Spijkmans I'm not an expert but this is my network setup:
I have Ziggo as a provider (Ziggo Complete with Next Media box) so no IPTV here. Ziggo Connectbox modem in Bridge mode. Asus RT-AC66U as router, three UniFi AC PRO access points all on latest firmware. No specific DNS server.

Also still looking/hoping for a solution..

@jghaanstra jghaanstra added wontfix This will not be worked on and removed waiting for input labels Sep 18, 2020
@jghaanstra
Copy link
Owner

I talked about this issue with Athom support. It seems to be a user specific problem related to a combination of my Shelly app, Homey core and the network configuration of the user. This makes it hard to troubleshoot and Athom told me it has very low priority as it only seem to affect a couple of users. Since I'm out of ideas myself as well I'm tagging this as "wont fix" for now until more information becomes available.

@timofp
Copy link

timofp commented Nov 4, 2020

For those with the issue of Homey Crashing/Freezing in combination with the Shelly App. It was discussed earlier that it only occurs in specific network conditions. After allot of digging I pinpointed the issue to the Bonjour Service on my Synology NAS. So for others having this issue, it might be relevant looking into any network device (nas, router, pc, others) running the Bonjour Service and disabling it

@Spijkmans
Copy link

Spijkmans commented Feb 21, 2021

@jghaanstra I know this item is closed but I have a small update on this matter.
Since my first report I’ve been trying to install the Shelly app whenever a new update/release came out or when a Homey release/update came out.
Until yesterday all gave the same result, a red ring crash...
Yesterday however Homey 5.0 was installed and later that day I tried the Shelly app again. To be honest I expected it to crash my Homey 🙏 😉

To my surprise it didn’t...! 🥳 I now works just as intended.

I’m very, very pleased now!

@jghaanstra
Copy link
Owner

Guess Athom fixed something with the mDNS flooding some specific networks in firmware 5.x. Thanks for the update, I'm closing this.

@frankie1984
Copy link

Since version yesterday (3.7.2) i have the same issue. I disabled Bonjour on my NAS and that fixed the rebooting of homey for now.
What was the big change to start this problem again?

@jghaanstra
Copy link
Owner

No big change in the Shelly app, it's an issue with the mDNS implementation of Homey that sometimes affects users with specific network setups. It could very well be something changed in your network recently which triggered this.

It seems the mDNS implementation of Homey listens to mDNS broadcast messages even without the pairing wizard being active. With over 70+ drivers in the Shelly app and most have their own mDNS filter set up this requires resources. In combination with specific network setups Homey seems to choke on this. It's been reported to Athom but they have decided not to look into this further due to it being a corner case scenario that only affects some users.

@frankie1984
Copy link

hahaha youre absolutely right.
Since yesterday im using https://multipass.run/ running a ubuntu VM with a k3s kubernetes cluster on VirtualBox in bridged network mode. Before that it was just using my macbooks hyperkit.
I needed it in bridges mode so i can share its dockerhost on the network and bind it to the VPN config in my unify router.

I just stopped the multipass VM, enabled Bonjour services en reinstaled the shelly app in homey and its now running a solid 10m without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants