-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Yeelight music mode server binding to wrong IP address (is more than one interface exists) #580
Comments
The ip is correct because that's the network interface the app can see from inside the container. Use bridge connection then it should work. |
It also fails with bridge. In fact, it may be worse because music mode server port is random so it can't opened using a single port. Docker container sees the host network interface but it is picking ¿the first one? that is the docker (in fact, as container is in host mode it should not be using docker0 network interface). I think this happens because you are looking for the first non loopback network interface:
But what if you have more than one? In my case, the correct network interface is the second non loopback network interface. I may be fixes letting the user choose the network interface manually (maybe a list?) This problem may occur in any setup with a server with more than one network interface. I would love to help with a PR but C is not my friend (i will try to do my best anyway cause love this project and really want to get it working with yeelight lights...WLED works like a charm btw). |
I completely dont see any reason why it should fail in the bridge mode. Long time ago I tested in VBox and I really dont want to rework it for such specific scenario. With bridge-only networking you can have only one IP, because the container joins the host network. If you want to add new field for your IP you must modify yeelight scheme in the LED drivers folder, in the C++ file that you've already mentioned: add to config loading section reading its value provided by users and finally add new condition to the loop (comparing to the user IP if provided). But such corresponding to user IP interface must exists in the docker. |
I did some similar. I just added some aditional filters to avoid docker network interfaces and it is working now
With this bulbs are binded with my host ip [{"command":"leddevice","ledDeviceType":"yeelight","params":{"hostname":"192.168.1.27","port":55443},"subcommand":"identify","tan":1}] Won't PR because as you said it appear to be a border case that just happens with my specific network configuration. |
Good to hear that your workaround fixes the problem. If new rules work, then probably it's also enough to add |
Got it working by deleting a docker that was using a bridge network instead of the host. |
Bug report, debug log and your config file (FULL LOGS ARE MANDATORY)
Steps to reproduce
Add a working yeelight bulb/stripe
![image](https://private-user-images.githubusercontent.com/132377440/242655709-db9310cf-20d1-49be-89c7-76d161c70e4e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODIwNzAsIm5iZiI6MTczOTI4MTc3MCwicGF0aCI6Ii8xMzIzNzc0NDAvMjQyNjU1NzA5LWRiOTMxMGNmLTIwZDEtNDliZS04OWM3LTc2ZDE2MWM3MGU0ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxMzQ5MzBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMTNmYTUwY2JkYzBlMDZmNjZkZTJjNzk2MjI4ODQ2MTQ0ZTQ0OTYxMjA4MjgzNzMwNGRiMmNkZDc5NGZhOTgyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pnC2UdGS9XB6ImiMuQ6_v0g9RqrJXNTQntd3v0d_x1M)
What is expected?
Light works using music mode.
What is actually happening?
Light is failing to connect to HyperHDR because the wrong IP address is being send to the light. Important to note that HyperHDR is reaching the buld the identify button is working.
This is the important log line:
2023-06-01T15:45:41.221Z [LEDDEVICE_YEELIGHT] (LedDeviceYeelight.cpp:958) 2| 192.168.1.27| writeCommand() : {"id":12,"method":"set_music","params":[1,"172.17.0.1",44775]}
Thing is, i am using it in a docker (using host mode) so i have more than one IP and the yeelight component is sending the wrong IP address to the bulb (172.17.0.1 is the internal container IP address. This IP should be something like 192.168.1.x). One possible and general solution would be to allow yeelight componente to specify the ip address to bind to the music mode server. I am very confident this is the problem and should be solves just sending the right IP address
System
The text was updated successfully, but these errors were encountered: