-
Notifications
You must be signed in to change notification settings - Fork 20
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
Using TCP as optionnal feature #1
Comments
Awesome feedback and glad you're enjoying the project! Sure thing. I've added some code and hopefully this should work for your device: So, instead of using:
please use:
Let me know what the result is! I'm also not sure if the tcp sends will send all responses 3 times or a single time (due to a loop to mimic keypresses). Let me know if you try sending a single brightness_down() command and you see the brightness decrease 3 times. Thanks! |
Hello, Thanks for your answer. I'm sorry I didn't had the time to test it, but anyway, thanks for your reactivity. I will try to give a test during next week and keep you informed. Thanks ! |
Hello, I had to fix the init.py : def connect(address='192.168.1.100', port=50000, protocol='udp'):
return bridge.Bridge(address=address, port=port, protocol=protocol) Without setting which parameter you pass, the short_pause_duration had the value of the "tcp" protocol. I haven't done a pull request as I can't connect to the controller... Thanks for the quick change of your code :) |
Heh, thanks for catching that. It's been fixed with 8690a9e. Could you send me the complete stacktrace? Just to make sure the issue is not on my end? Can you try creating a sample script to connect to your bridge via TCP? If it connects, can you send that my way as well? Perhaps I need to connect in another way. Thanks! |
Here's the traceback :
|
I'm thinking TCP may have a different port than the UDP port? Here's the code that I based my assumptions off of: https://wiki.python.org/moin/TcpCommunication If you wouldn't mind trying to figure out the TCP port or perhaps playing with Once we have the connection portion then the rest of the code should be reusable, save for a fix or two that I'm foreseeing for better performance. Thanks again! |
It's strange because a nmap reveal the 50000 port listen in tcp mode. So it seems OK on the controller side. I will try to dig deeper with the python code. |
Hello,
My controller (firmware 3.00.08) seems to offers the possibility to use TCP instead of UDP.
I tested your library yesterday and had sometimes packet transmitted but not received by the controller.
Should be great to use TCP to avoid this kind of things, even if you transmit few times the udp packet to avoid this behavior.
What do you think about this ?
Anyway, I wanted to thanks you a lot, you saved me a LOT of time by sharing this library. I will use it in my project ! Thanks !
The text was updated successfully, but these errors were encountered: