-
Notifications
You must be signed in to change notification settings - Fork 107
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
Support for Hue Entertainment #150
Comments
Please figure out how to implement this. I want so bad to use the new Razer Synapse 3 with my MiLights and it require Hue Entertainment |
i need to find some software that works with hue entertainment protocol in order to progress. I believe pydtls and sslpsk libraries are enough, they only need to be implemented. |
try Razer Synapse 3 to try the entertainment protocol |
Issue is with secondary listening service that is not implemented. Now if you set apiversion to 1.22 in config.json you will be able to specify the lights and position for light in room, but this is not enough. Marius. |
Not sure if available libraries for python can create the dtls server with psk authentication. |
I think that this library could help |
i believe this must be used, but all examples i found are based on certificates authentication, not with psk. If you find any examples i will implement-it. Philips provide all the needed details for Entertainment protocol, just the handshake is the main issue. |
https://github.com/drbild/sslpsk With this you can add psk autentication writing sslpsk.wrap_socket instead of ssl.wrap_socket |
This is for TLS, we need DTLS. Anyway i ask it here |
Will it work ?: |
#ifdef DTLS_PSK
|
Sorry |
they found the solution i think |
Can the dtls server be run using C/C++ and the data then piped into our python script? |
Yes, but it need to expose a method for sending the data to hue emulator (socket file ?) |
I believe this is one good option https://github.com/wolfSSL/wolfssl-examples/blob/master/dtls/server-dtls.c |
Getting anywhere with this? |
I don't know c++, cannot start here. Only when sombody will write here that will help us there can be a progress. |
Hello, Again. https://pypi.org/project/Dtls/#description cipher: 0x00a8 |
This repo has the installer corrected, you just have to download it and execute: python3 setup.py install |
check this comment from here,it looks like the required cipher is missing rbit/pydtls#20 (comment) |
In this post they use the same library but with a different cipher and apparently it works (kershner/screenBloom#66) n°7 PSK-AES128-CBC-SHA |
the next library is more updated and has the support of python3 corrected: |
Hey Guys, I was able to create a server using the mbedtls ssl_server2 program. It supported the required dtls, cipher suites etc. I only had to disable the http response and create a loop to wait for more messages if the first character of the recv buf is 'H' of the huestream entertainment sdk message format. I am able to properly handshake and get the messages in a char buffer in the c program. I tried this with the example dtls_client.txt program provided by the entertainment sdk page. I am sure it should work for the other clients such as Razer Synapse too. I'll try confirming it later today. Now my question is what should I do with the light data? should I process it in the c program and send http msgs to the lights? should I forward it to the Hue-emulator python script using an unsecured udp channel? does the python script have implementation already done for entertainment? Thanks |
WOW, this is the news we expect to hear in this thread. For the moment we can do this: implementation with no security, meaning one static authentication string that will be provided to all users. Later we may find a way to fetch this via http request from bridge emulator. Light data must be passed mandatory to emulator because hue app configure xy data of the lights in every entertainment area so a believe it must be an http PUT or POST request in 127.0.0.1/entertainment (or any location). |
I understood the first part, which is getting the static auth string which i have hard coded into the server script for now, multiple username support is causing a slight problem, but I am sure I can figure it out later. I was just wondering if the python script has the implementation for parsing the light data and physically lighting up the bulbs and if yes can you please give me a line number in the file its done in. I am not very good at python sorry. |
So I just PUT/POST the light data bytes to a url hosted by the python emulator script. If I can see the implementation(if it exists) on the python script side I think I can understand it well. |
i create the service but currently it only prints the messages and don't do anything else. Once i will have some sample output i can go forward with the implementation. |
Sure, exactly what I was thinking. If you want sample data, you can create a script that sends dummy data to the udp port 2101 at these rates specified by the entertainment api.
It is a little bit confusing but I'm sure you'll figure it out. I'll do the unencrypted data forward asap and report. |
If you have some sample output of python script with original data please paste it here so i can start the implementation Thanks. |
Just finished the server. Should be seamlessly installed and started using easy_install.sh. |
Hi, Just to provide the current status:
TO DO.
|
This is the problem with Razer Synapse too. I've noticed requests to /api/username/groups/id when streaming show no changes. Is this the expected behavior? because I am pretty sure this is the issue as synapse requests a GET to this address and then immediately stops broadcast and shows stream busy error. |
I manage to made Hue Sync to work. Still i need a few changes because in hue application i still see a message that some lights cannot be controlled while hue entertainment is active despite i stop it. Hope today i will push a new release. |
With the last commit Hue Sync for Mac is working fine. I still have issues with All 4 Hue application for android that is not broadcasting or is broadcasting just one frame. Next step is to simplify the installer by providing precompiled binaries for arm and amd64 platfrorms. |
Latest commit works beautifully with Razer Synapse and Chroma apps(such as Overwatch). |
Today i add more improvements and with this i will close this issue. |
Thank You for this wonderful project. Hope everyone has fun with the new features. |
Hey there! I'm working on a project that aims to send color data directly to my hue system using the entertainment endpoint. Just curious, did you ever manage to get a working solution for dtls-handshaking? If so, would you care to share the trick? I'm struggling to get the handshake bit to work... |
I manage to get entertainment working, the source code is present in the repo, but from my understanding you try to create the client, here we made the server. |
I looked at the repo, but it seems as if you're using a compiled binary to do the transmission? I checked the entertainment.py file, but see nothing there for dtls. Is this implemented somewhere else? |
The compiled binary is generated from https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/ssl_server2_diyhue.c |
Thank you. I'm not too familiar with C (although happy to try and learn). Is there some way I could chat with you about the issue a bit more? i don't want to keep posting on a closed issue thread. ;) |
Unfortunately i did not made this, i just ask for help and i receive it. |
Do you know if I would be able to use the binary to accomplish my goal? Current handshake request:
Current "send message" function:
|
You are on the right track but this binary is the server and is used to receive the message. Something is probably wrong with your message configuration. |
I never get to the point of trying to send the message, the handshaking fails and I never get the "Socket wrapped" message printed. |
Two final questions:
|
@avinashraja98 can you help us with an update to the ciphers? Hue Sync start to use new ciphers since PSK-AES128-CBC-SHA is considered week now. |
Oh I see. Its been a while since I looked at diyHue, I'll check it out and try getting a solution over the weekend. Lmk if you have any more information thanks. |
@avinashraja98 i think i found a solution to star the dtls server with openssl and get the data output from stdout in realtime. It seams openssl has the needed ciphers. Thanks for your work again, you made a very important implementation for diyhue. |
That's great! No problem haha thanks. |
Hi,
I need some help in order to create the dedicated service for hue entertainment. The requirements are these:
the challenge is to have this DTLS protocol implemented for steam decryption.
The api to create the Hue Entertainment area from mobile application seams to work with no changes.
The text was updated successfully, but these errors were encountered: