mpolednik / script.kodi.hue.ambilight

Kodi add-on for Philips Hue lights with ambilight support. Based on @cees-elzinga 's original work.
Do What The F*ck You Want To Public License
156 stars 42 forks source link

It won't start #51

Open azriel84 opened 7 years ago

azriel84 commented 7 years ago

Strangest thing. I install the addon just fine in LibreElec 8.0.1 running on an Intel NUC. It finds the HUE bridge just fine, I configure the lights for ambience. Then I reboot the system and addon pops up an error message during start up and won't work... I was advised to turn off hardware acceleration options and I tried one be one but nothing changed. Any ideas?

mpolednik commented 7 years ago

Could you add the debug logs? (the process is in the README)

Without logs, there's a bit too much guessing involved.

azriel84 commented 7 years ago

https://paste.ubuntu.com/24262890/

Hope this helps, addon keeps poping the error in startup, dunno what else to do.

mpolednik commented 7 years ago

Seems like your bridge's IP has changed, can you run discovery again?

azriel84 commented 7 years ago

Have tried that too, every time discovery finds the bridge just fine (or so it says), I configure the addon just fine but when I reboot I always get the error message again. I don't if it's relevant, but I also got Hyperion running on the machine to control my ambilight led strips (just saying just in case it causes a conflict or smt...). Cheers!

JesCR commented 7 years ago

You could try to put a fixed ip to the bridge, out of the DHCP range... Then re-discover the bridge and try the addon. If this doesn't work, try to turn-off hyperion (to check if there is some conflict...)

azriel84 commented 7 years ago

OK so I think I have isolated the problem. First of all I set a static IP (inside the DHCP range for starters). Secondly, I got today another update from Philips, maybe it helped maybe it didn't. I did a hard reset on the hue after the update. Thirdly, I tried the following and it worked. I reset the app settings. I disabled and re-enabled the app. Run the configuration again, it found the bridge, I put a movie on, boom everything works like a charm!

BUT: I reboot the system and after the restart I get the same app error at the start up of LibreElec and the app doesn't work. If I do the above procedure again with the settings reset etc it will work like a charm but it will crash again with every system reboot. Setting an IP outside the DHCP range or a conflict with Hyperion isn't the case since the app is working, as long as I don't reboot the system, it's like it doesn't save the settings and needs to be configured every time. Hope this helps a bit... Cheers!

mpolednik commented 7 years ago

The settings are actually stored in a plaintext file in the filesystem - could you get them?

http://kodi.wiki/view/Userdata

They're somewhere under I think addon_data/script.kodi.hue.ambilight/settings.xml. I think it saved the ip - otherwise you wouldn't see the error (if there is no ip saved, it doesn't try to connect). I could very possibly be wrong in some regard though. :)

ghost commented 7 years ago

You forgot the userdata folder : userdata/addon_data/script.kodi.hue.ambilight/settings.xml .

I did some tests today related to this, not having an IP set in settings.xml acts like you said, so you're not wrong, @azriel84 may want to confirm his bridge IP is saved in settings.xml but it's safe to assume it does. The plugin settings show an empty "ip adress" case, the addon doesn't popup any notifications when starting kodi, playing a movie doesn't act on the lights. (tested on kodi v17 / windows setup)
So my guess was that maybe rate-limit or wierd network configurations and/or slow bridges can provoke those hard-to-spot connection errors.

With rate-limit in mind, I did a very basic "workaround" that waits 5sec before retry (link for ref : https://github.com/Moyster/script.kodi.hue.ambilight/commit/05720890d77096d4722d44bab6d87df8c68b54a3 ) for upnp (first discovery) errors, but that might be extended to bridge_ip (maybe with a max retry).

It would be good to know what bridge revision you guys have (I have a square/v2, maybe round/v1 bridges behave differently) and how you installed (or what version of) the request plugin you're using, on that note, kodi installs "requests" by himself when I install the hue plugin, I never installed manually the requests plugin and some logs pointed to the request feature/plugin, that may also be part of it?

Edit: a "smarter" solution would be to fetch dynamically the bridge ip on every starts using upnp, and adding the possibility to manually set the bridge ip :

azriel84 commented 7 years ago

Thank you both for your answers and effort. First of all, @Moyster I am using LibreElec 8.0.1 (kodi 17.1 latest version) on a Nuc with latest bios installed and the latest square/v2 Hue bridge that as I mentioned got an update today. Bridge Model BSB001, version 01038390 and Hue color lamp 1 model LCT010 with version 1.15.2_r19181.

Now spam time. The setting.xml file from the Userdate folder:

The above values are with the addon working. The following are after the reboot with the addon not working:

I hope I helped a bit, cheers!

JesCR commented 7 years ago

The only difference:

vs

The nuc and the bridge are in the same subnetwork? There are more than one upnp servers? two routers? firewalls? Seems like a network problem...

azriel84 commented 7 years ago

Both the NUC and the bridge are in the same home network, they are connected on the same switch and I only have one router. I don't have any problems with my other connected devices on the network, my TV, NUC, AV receiver, the Hue bridge, everything are connected and working fine. The only issue is the communication of the addon with the bridge after (and only after) a reboot. I have also set a fixed IP for the bridge. I could try to suspend the NUC every time instead of shutting it down or rebooting it, it could be a temporary solution :)

rusak-zip commented 6 years ago

I know, this is a little outdated thread, but I still want my Hue lightstrip working with Kodi!

Looks like I have the similar problem (issue #116). However in my case the plugins popups with the error after restart and throws "Network Unreachable" error in the log for the addon.