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
157 stars 42 forks source link

Can't discover bridge in an Android TV box (Nvidia Shield) #37

Open JesCR opened 7 years ago

JesCR commented 7 years ago

Yesterday arrived my new nvidia shield tv, to replace the hdmi output from my Qnap NAS (no more kodi support, no hevc hadrware support...) I setup everything in kodi, media from nas, skins and addons like in the qnap, and the only thing that don't work was hue 🤦‍♂️

And again, a new problem that i never seen before.

First try: When i push the "discover bridge" (don't remember the exact text)... hue starting notification and nothing happens, the classical "press bridge button" didn't come up.

Seccond try: I copy/paste the settings.xml file from my nas to my shield and restart kodi17. This time hue addon starts and all the settings are ok. i play a movie and the theater mode dimmed the lights BUT the ambilight lights get stucked, they changed their colors/brightness one time but then never updates.

Third try: Next i tried again the "Bridge discover" button, to uses a new "hue user" and this time it works, a new user was generated and theater mode works properly again, but the ambilight mode still get frozen when i start playing a video...

Fourth try: Reinstall everything, and returned to "first try" results... Log from the last try: 10:10:40.874 T:138001024080 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated. 10:12:03.053 T:138001024080 WARNING: Previous line repeats 1 times.

10:15:14.720 T:138376418384 NOTICE: CAESinkAUDIOTRACK::Initializing with: m_sampleRate: 44100 format: AE_FMT_FLOAT (AE) method: PCM stream-type: PCM-STREAM min_buffer_size: 30208 m_frames: 1888 m_frameSize: 8 channels: 2 10:15:18.823 T:138001024080 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated. 10:15:52.832 T:138001024080 WARNING: Previous line repeats 1 times. 10:15:52.832 T:138001024080 NOTICE: Storing total System Uptime 10:15:52.833 T:138001024080 NOTICE: Saving settings 10:15:52.840 T:138001024080 NOTICE: Saving skin settings 10:15:52.844 T:138001024080 NOTICE: stop all 10:15:52.897 T:138001024080 NOTICE: stop player 10:15:52.897 T:138001024080 NOTICE: ES: Stopping event server 10:15:52.897 T:138001024080 NOTICE: stopping upnp 10:15:53.611 T:138534700112 NOTICE: ES: UDP Event server stopped 10:15:53.699 T:138001024080 NOTICE: clean cached files! 10:15:53.716 T:138448995408 NOTICE: Skin Helper Service --> Shutdown requested ! 10:15:53.721 T:138448995408 NOTICE: Skin Helper Service --> Skin Helper Service version 1.1.3 stopped 10:15:53.744 T:138488562768 NOTICE: Skin Helper Widgets --> Backgroundservice stopped 10:15:53.760 T:138491671632 NOTICE: NEXTUP SERVICE NOTIFICATION Service -> ======== STOP NEXTUP SERVICE NOTIFICATION ======== 10:15:53.766 T:138491671632 WARNING: CPythonInvoker(6, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.nextup.notification/service.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.nextup.notification/service.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE,N9XBMCAddon9xbmcaddon5AddonE,N9XBMCAddon4xbmc6PlayerE 10:15:54.181 T:138001024080 NOTICE: closing down remote control service 10:15:54.181 T:138001024080 NOTICE: stopped 10:15:54.381 T:138001024080 NOTICE: destroy 10:15:54.382 T:138001024080 NOTICE: unload skin 10:15:59.905 T:138001024080 ERROR: CPythonInvoker(15, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/default.py): script didn't stop in 5 seconds - let's kill it

This it's my firs time with android tv, so maybe there are some box settings wrong?

JesCR commented 7 years ago

More testing... Repeat the settings.xml copy/paste from my nas. Same as the last time. Here is the log:

`13:04:08.830 T:138001024080 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated.

13:04:11.316 T:138492707920   ERROR: EXCEPTION Thrown (PythonToCppException) : 

->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>

Error Contents: 'MyMonitor' object has no attribute 'update_controllers'
                                            Traceback (most recent call last):

File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/default.py", line 61, in onNotification
                                                self.update_controllers()

AttributeError: 'MyMonitor' object has no attribute 'update_controllers'

-->End of Python script error report<--

13:04:12.179 T:138001024080 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated.
13:04:14.516 T:138492707920   ERROR: EXCEPTION Thrown (PythonToCppException) : 

-->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'MyMonitor' object has no attribute 'update_controllers'
                                            Traceback (most recent call last):

File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.kodi.hue.ambilight/default.py", line 83, in onNotification

self.update_controllers()

 AttributeError: 'MyMonitor' object has no attribute 'update_controllers'

-->End of Python script error report<--

13:04:22.695 T:138001024080 WARNING: RunScript called for a non-script addon 'script.kodi.hue.ambilight'. This behaviour is deprecated.
13:04:33.646 T:138404103248   

ERROR: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.requests/lib/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
                                              InsecureRequestWarning)

13:05:14.569 T:138001024080  NOTICE: Samba is idle. Closing the remaining connections
13:05:22.426 T:138001024080  NOTICE: VideoPlayer: Opening: smb://192.168.1.200:445/multimedia/Videos/Server/-=PELICULAS=-/Stalingrad (2013)/Stalingrad (2013)[BDRip 1080p][AC3 5.1 - DTS - Rus][DUAL][SUBS Esp - Ing].mkv
13:05:22.427 T:138001024080 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
`
JesCR commented 7 years ago

I try with kodi16, just for check... and, as suppossed, don't work at all.

ghost commented 7 years ago

Hi @JesCR Can you try this branch and tell me if your android box can discover the bridge ?
https://github.com/Moyster/script.kodi.hue.ambilight/tree/issue-37
I kind of suspect the rate-limit / slow response from the bridge and just added a loop on the upnp discovery request.get() that waits 5sec before trying again 'til it has an answer from the bridge. I couldn't reproduce your bug but my modifications shouldn't break anything.

JesCR commented 7 years ago

Sure! But not today :( I get back with the result.

tfraley commented 7 years ago

Any update on this, runing into the same thing

JesCR commented 7 years ago

I forget to try this branch... I fixed the problem by editing the config file and hard-coding the ip...

tfraley commented 7 years ago

I figured out my issue. I guess the searching times are not fast enough. In my case, my IP for the Nvidia shield was on x.x.70.x, and my hue was on x.x.71.x Normally this is not an issue the way I have my network setup, but in this case, I guess it takes too long to locate the hub and times out by having them both on x.x.70.x it worked fine.