awawa-dev / HyperHDR

Highly optimized open source ambient lighting implementation based on modern digital video and audio stream analysis for Windows, macOS and Linux (x86 and Raspberry Pi / ARM).
http://www.hyperhdr.eu/
MIT License
1.13k stars 117 forks source link

Hue entertainment not working #21

Closed gogui63 closed 3 years ago

gogui63 commented 3 years ago

Steps to reproduce

Create fresh hue entertainment instance (new user, new token, ...) Run instance

What is expected?

Nothing, in hue app I don't see the message indicating that my hues plays are being synchronized

What is actually happening?

Nothing :) (see log above) And for information my hue bridge is on different subnetwork (raspberry with HyperHDR is on 192.168.0.x and my hue bridge on 192.168.2.x)

System

Important logs are : 2021-01-01T22:03:51.193Z [hyperiond LEDDEVICE] (WARNING) The Hue bridge is not ready... trying to reconnect. 2021-01-01T22:03:58.472Z [hyperiond LEDDEVICE] (ERROR) Give up waiting for the Hue bridge. Response error code: 99 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (ERROR) Device disabled, device 'philipshue' signals error: 'No light-IDs found at the Philips Hue Bridge'

Full logs :

2021-01-01T22:03:44.939Z [hyperiond LEDDEVICE] (INFO) Start LedDevice 'philipshue'. 2021-01-01T22:03:44.940Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:149:init()) deviceConfig: [{"blackLevel":0.009,"blackLightsTimeout":5000,"brightnessFactor":1,"brightnessMax":1,"brightnessMin":0,"brightnessThreshold":0.0001,"clientkey":"xxxxx","colorOrder":"rgb","currentLedCount":3,"debugLevel":"1","debugStreamer":false,"groupId":11,"hardwareLedCount":3,"latchTime":0,"lightIds":["24","26","27"],"onBlackTimeToPowerOff":600,"onBlackTimeToPowerOn":300,"output":"192.168.2.12","restoreOriginalState":true,"sslHSTimeoutMax":1000,"sslHSTimeoutMin":400,"sslReadTimeout":0,"switchOffOnBlack":true,"transitiontime":1,"type":"philipshue","useEntertainmentAPI":true,"username":"xxxxx-gH4","verbose":false}] 2021-01-01T22:03:44.943Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:408:setLatchTime()) LatchTime updated to 0ms 2021-01-01T22:03:44.943Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:435:setRewriteTime()) RewriteTime updated to 0ms 2021-01-01T22:03:44.943Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) DeviceType : philipshue 2021-01-01T22:03:44.943Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) LedCount : 3 2021-01-01T22:03:44.943Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) ColorOrder : rgb 2021-01-01T22:03:44.944Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) RefreshTime : 0 2021-01-01T22:03:44.944Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) LatchTime : 0 2021-01-01T22:03:44.944Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Hostname/IP : 192.168.2.12 2021-01-01T22:03:44.944Z [hyperiond LEDDEVICE] (DEBUG) (ProviderRestApi.cpp:121:get()) GET: [http://192.168.2.12/api/xxxxxx-gH4/] 2021-01-01T22:03:49.154Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1087:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.0.34 2021-01-01T22:03:49.225Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1096:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.0.34 2021-01-01T22:03:50.701Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:30:WebSocketClient()) New connection from ::ffff:192.168.0.34 2021-01-01T22:03:50.701Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:85:handleInstanceSwitch()) Client '::ffff:192.168.0.34' switch to Hyperion instance 0 2021-01-01T22:03:50.959Z [hyperiond V4L2:/DEV/VIDEO0] (DEBUG) (V4L2Grabber.cpp:1137:process_image()) Video FPS: 15.00, av. delay: 29ms, good: 900, bad: 0 (60.01,15) 2021-01-01T22:03:51.192Z [hyperiond LEDDEVICE] (DEBUG) (ProviderRestApi.cpp:187:getResponse()) Reply.httpStatusCode [0] 2021-01-01T22:03:51.193Z [hyperiond LEDDEVICE] (WARNING) The Hue bridge is not ready... trying to reconnect. 2021-01-01T22:03:51.256Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:85:handleInstanceSwitch()) Client '::ffff:192.168.0.34' switch to Hyperion instance 1 2021-01-01T22:03:51.310Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1087:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.0.34 2021-01-01T22:03:51.381Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1096:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.0.34 2021-01-01T22:03:51.702Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1087:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.0.34 2021-01-01T22:03:51.761Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1096:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.0.34 2021-01-01T22:03:52.196Z [hyperiond LEDDEVICE] (DEBUG) (ProviderRestApi.cpp:121:get()) GET: [http://192.168.2.12/api/xxxxx-gH4/] 2021-01-01T22:03:58.472Z [hyperiond LEDDEVICE] (DEBUG) (ProviderRestApi.cpp:187:getResponse()) Reply.httpStatusCode [0] 2021-01-01T22:03:58.472Z [hyperiond LEDDEVICE] (ERROR) Give up waiting for the Hue bridge. Response error code: 99 2021-01-01T22:03:58.472Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:455:setBridgeConfig()) Bridge is not Entertainment API Ready - Entertainment API usage was disabled! 2021-01-01T22:03:58.472Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Bridge Name : 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Model : 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Bridge-ID : 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) SoftwareVersion : 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) API-Version : 0.0.0 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) EntertainmentReady : 0 2021-01-01T22:03:58.473Z [hyperiond LEDDEVICE] (ERROR) Device disabled, device 'philipshue' signals error: 'No light-IDs found at the Philips Hue Bridge' 2021-01-01T22:03:58.474Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:149:init()) deviceConfig: [{"blackLevel":0.009,"blackLightsTimeout":5000,"brightnessFactor":1,"brightnessMax":1,"brightnessMin":0,"brightnessThreshold":0.0001,"clientkey":"xxxxxx","colorOrder":"rgb","currentLedCount":3,"debugLevel":"1","debugStreamer":false,"groupId":11,"hardwareLedCount":3,"latchTime":0,"lightIds":["24","26","27"],"onBlackTimeToPowerOff":600,"onBlackTimeToPowerOn":300,"output":"192.168.2.12","restoreOriginalState":true,"sslHSTimeoutMax":1000,"sslHSTimeoutMin":400,"sslReadTimeout":0,"switchOffOnBlack":true,"transitiontime":1,"type":"philipshue","useEntertainmentAPI":true,"username":"xxxxxxx-gH4","verbose":false}] 2021-01-01T22:03:58.474Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:408:setLatchTime()) LatchTime updated to 0ms 2021-01-01T22:03:58.474Z [hyperiond LEDDEVICE] (DEBUG) (LedDevice.cpp:435:setRewriteTime()) RewriteTime updated to 0ms 2021-01-01T22:03:58.474Z [hyperiond LEDDEVICE] (DEBUG) (ProviderUdpSSL.cpp:96:init()) Successfully parsed 127.0.0.1 as an ip address. 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (ProviderUdpSSL.cpp:127:init()) UDP SSL using 127.0.0.1:2100 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Off on Black : 1 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Brightness Factor : 1.000000 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Transition Time : 1 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Restore Original State : 1 2021-01-01T22:03:58.475Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Use Hue Entertainment API : 0 2021-01-01T22:03:58.476Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Brightness Threshold : 0.009000 2021-01-01T22:03:58.476Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Time to power off the lamp if the black level is triggered: 600 2021-01-01T22:03:58.476Z [hyperiond LEDDEVICE] (DEBUG) (LedDevicePhilipsHue.cpp:393:log()) Time to power on the lamp if the signal is restored: 300 2021-01-01T22:04:50.959Z [hyperiond V4L2:/DEV/VIDEO0] (DEBUG) (V4L2Grabber.cpp:1137:process_image()) Video FPS: 15.00, av. delay: 28ms, good: 900, bad: 0 (60.00,15) 2021-01-01T22:04:52.847Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:204:sendClose()) send close: 1000 2021-01-01T22:04:54.167Z [hyperiond WEBSOCKET] (DEBUG) (WebSocketClient.cpp:30:WebSocketClient()) New connection from ::ffff:192.168.0.34 2021-01-01T22:04:54.170Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:85:handleInstanceSwitch()) Client '::ffff:192.168.0.34' switch to Hyperion instance 0 2021-01-01T22:04:54.583Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:85:handleInstanceSwitch()) Client '::ffff:192.168.0.34' switch to Hyperion instance 1 2021-01-01T22:04:54.635Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1087:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.0.34 2021-01-01T22:04:54.703Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1096:handleLoggingCommand()) log streaming deactivated for client ::ffff:192.168.0.34 2021-01-01T22:04:55.044Z [hyperiond WEBSOCKET] (DEBUG) (JsonAPI.cpp:1087:handleLoggingCommand()) log streaming activated for client ::ffff:192.168.0.34

awawa-dev commented 3 years ago

There is no connection to the Hue bridge for these settings and UnknownNetworkError (99) is critical Give up waiting for the Hue bridge. Response error code: 99 BTW Did you try to set it up as one instance in HyperHDR?

gogui63 commented 3 years ago

Same issue on main instance And same with single instance

awawa-dev commented 3 years ago

Stay for one instance for now. Did you try to copy that GET (http://192.168.2.12/api/xxxxxx-gH4/) to curl or www browser to see what happening? From Rpi of course?

gogui63 commented 3 years ago

pi@raspberrypi:~ $ curl http://192.168.2.12/api/xxx-gH4/ curl: (7) Failed to connect to 192.168.2.12 port 80: No route to host

My pi is in 192.168.0.x My hue Bridge in 192.168.2.x

awawa-dev commented 3 years ago

Yes, I see. But you must to enable communication between these 2 sub-networks on the router/firewall. You can test it with a browser or curl. Not only http (this doesnt work now) but also UDP (next point as Entertainment API requires it).

gogui63 commented 3 years ago

Yes, it's fixed , I moved my pi on subnetwork 2.x and everything works fine !

Good job and thanks for your help :)