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
Failed to connect to device (Broadlink RM Mini3) #23566
Comments
I'm also running 0.92.1 and I get the same error every so often, usually after i restart the wifi. |
I'm experiencing the exact same issue. Even after a reboot of both the RM mini and HASSIO it doesn't work. |
Are you using the Chinese Broadlink or the International version? |
The Chinese version. Do I need to do anything differently? |
I'm wondering if the international version makes a difference. |
+1 |
same issue with HA @ 0.93.1 |
I'm also having the same issue with 0.93.1 and my Broadlink RM-Mini3 where sending the command broadlink.learn logs out "Failed to connect to device". However I've put a switch into the configuration YAML and can see the light on the Broadlink flashing when I toggle the switch which shows that it is able to communicate with the RM-Mini3. This would suggest that it's an issue with the broadlink.learn command |
Is there any workaround we can use for this? Maybe learn through another piece of software? |
Robhofmann you can learn command with broadlink manager (windows exe) |
@wzwick this comment is saying that the send commands do work. I havent got the change to try this yet. I'll try this asap. |
For me I can neither learn nor send. |
I read that comment as it saying that while they cant send commands by adding a 'hacky' switch they can prove there is communication to the device. |
I added a switch (as described in the documentation https://www.home-assistant.io/components/broadlink/) with a bogus "command_on" and "command_off" base64 string which caused the LED to flash on the Broadlink when toggled. This suggested to me that there was communication between the Broadlink and homeassistant. |
I just tested it. Using the broadlink manager to learn the commands, I got it to work. The sending of the commands works like a charm. Here is my config:
PS. Don't forget to add the "==" at the end of the commands. This got me searching for a while. |
@RobHofmann Brilliant |
Thats a really good question. This is my next step to figure out :). I'll post back when I know more. With a bit of luck I can spend some time on this later today. |
First i created an input_boolean which keeps track of the state of the TV Lift:
Next i created 2 scripts which set the input_boolean and do the sending actions to the IR receiver. One script is with a delay (because the lift goes down for 36,5s then has to stop).
Finally i created a switch using the template switch:
Finally i added the switch to my ui-lovelace:
And as a bonus i decided to add a nice icon to my switch in customize.yaml
Good luck! PS. Of course i stripped all other non related config from this example. If something is missing or not working, don't hesitate to reply here. Also i translated it from Dutch, so there might be some mistakes :). |
For others reading this to try make sesne of it all here is the break down to its simplest form: In order to have the broadlink.send and broadlink.learn functions you need to add the following to your configuration.yaml file
This is the minimum required to get the broadlink unit configured on HA
If you dont want switches but prefer to use a list of commands then add the following to your scripts.yaml file:
you can also combine commands, to change source on my TV i need to press 'input', 'right', 'ok'
Massive thanks to @RobHofmann for working out the nitty gritty of it all |
Thanks for the clarification! Looks great. I hope people are helped by this :). |
Ok, but does broadlink.learn works? |
I couldn't get it working. |
Same. I used the broadlink manager to get the Base64 strings which I used in my send commands. broadlink.learn doesn't work for me either ;) |
I just attempted to.set up my RM mini 3 tonight. I was able to learn a total of 1 command with broadlink.learn, after which homeassistant began serving the same Failed to Connect to device described here. Same symptoms as the others here: device still works with the app; network is fine; config didn't change; reboots and restarts don't help. Just seems as if broadlink.learn stopped working. |
@johnruemker have you tried broadlink manager, link is a few comments up. |
Thanks for the suggestion. Broadlink manager isn't an option for me right now. I may ultimately have to pursue that to get this setup going, but for now I need to see if I can get broadlink.learn functioning. |
To investigate further, I've been attempting to use the broadlink package directly (https://github.com/mjg59/python-broadlink) to interact with my RM mini 3. I haven't yet been able to learn any commands, but I can at least show that the auth() function works against my device. I believe auth() is what would be failing within homeassistant's broadlink component to result in the "Failed to connect to device" error, so this result leads me to believe the problem we're seeing must be in the homeassistant broadlink component and not on the broadlink side.
If anyone can figure out the sequence to result in this learning a command, it would serve as a simple workaround to the homeassistant learning problem without needing to use Broadcom [Edit: Broadlink] Manager. As far as I can tell the above commands are the only thing that the broadlink component does for an RM-type device to learn to a command, but its definitely possible I'm overlooking something since I only just started reviewing this code for the first time this morning. |
Same issue on broadlink.learn |
Same issue here, latest version of HA on Hassio, trying to talk to a RM2 Pro Plus. I managed to get it to work once and learn a single command, after that it never worked again, even after spamming the call service button several hundred times. No idea why mine worked once but I can also confirm the service is otherwise totally broken. |
works flawlessly, learn_command and send_command. |
Same exact issue here. I'm able to learn commands via the app but not Home Assistant. Connects to the device now after editing the init file but no commands received. Going to try and use Broadlink Manager via a VM on my Mac to see if I am able to get codes that way. |
I have the same problem as everyone else and works fine with the Broadlink app. When I create the custom component and modify EDIT: I ended up running Broadlink Manager on my Windows 10 work laptop and I get the same error...
Someone was talking about finding a mismatch the with device ID due to Broadlink releasing a new device revision... https://community.home-assistant.io/t/broadlink-manager-nicer-way-to-learn-and-send-ir-rf-commands/58770/181 |
I have been trying to understand the protocol here, I understand its using UDP QUIC but its a little over my head and I couldn't match up what I saw in Wireshark with what I read about. Maybe because of the encryption? There is probably a better way to do this, but I ran the Broadlink app on my iOS device and proceeded to learn a volume up command. Whilst doing so I also ran the app in Android under the BlueStacks emulator on my Mac and fired up Wireshark. I did manage to capture some traffic from the 0x5f36 device to my Mac, no idea if there are any clues in there but the dumps can be downloaded here if anyone wants to take a look: https://www.dropbox.com/s/0tlgz2y1zrfmt7c/BLink%20Dump%201.pcapng?dl=0 I don't have an older working device to compare it to but I am more than happy to sniff some more traffic from my 0x5f36 device if someone might be able to help me decipher it? I am about ready to gut this thing and stick an ESP in! |
@Siytek Thanks for your collaboration. I see a handshake with Broadlink at 556 37.676853. The IPs involved are 192.168.1.66 and 3.122.136.209. They are using TLS 1.2, so communication is encrypted. The first IP is the local address of your Mac. What intrigues me is that the second IP is not local. So devices are communicating through a cloud. If you access the IP 3.122.136.209 in a web browser this premise will be confirmed: you are communicating with a web service powered by OpenResty. Thus Broadlink app is cloud based and the data collected won't serve our purpose. We need to capture a direct communication between the computer and the device. I think it will only be possible with e-Control or Broadlink Manager, but apparently these applications don't recognize the device. If someone can make it work with one of these, please send the data for us to analyze. |
Wow its very interesting @felipediel and thank you for the detailed explanation. I did not try the e-Control app as I also read that people cannot get it to work, but I will try it later this evening. I also read about a method to capture network traffic from an iOS device so I will try it later too, this should allow me to capture any local packets between the iOS Broadlink app and the RM Mini. EDIT: I couldn't get the eControl app to work, not sure if its just because its rubbish but it just wouldn't configure the device successfully. Also you can see the RM Mini local address 192.168.1.121 (c0 a8 01 79 starting at byte 20), not sure if its relevant?
|
Ok I think I managed to sniff the packets directly between the Broadlink app on my iOS device and the RM Mini 3 using rvictl, it looks more like a usable set of data. Any chance you could take a quick look @felipediel? Just the learn command: https://www.dropbox.com/s/4z9mxsykp7vs344/Broadlink%20to%20iOS%20cap%20IR%20dump.pcapng?dl=0 Longer capture: My iPhone IP: 192.168.1.69 |
@Siytek The communication is encrypted, I can't analyze its content. So I will analyze its form. Let's start at 19 0.0007287. When you clicked learn command, your phone sent a message to the cloud containing at least the IP address of the universal remote with which you want to communicate (and perhaps a code related to the command learning function). Then the cloud sent a message to the universal remote stating that your phone wants to communicate. This message does not appear in the log because it was sent directly from the cloud to the remote. It is sometimes possible to intercept messages like this by activating promiscuous mode in Wireshark. Anyway, we can assume that this message existed, because at 21 0.007922 your phone received a UDP packet from the universal remote and they started to communicate locally. At 28 0.011493 and 29 0.011655, I see two large packets being sent from the remote to your phone. They probably contain the code you just learned. It is important to note that, although the devices have communicated locally for a while, this was only possible after the triangulation was done by the cloud. Therefore, this data is encrypted and cloud dependent. It does not serve our purpose. But thanks for trying anyway. By the way, you can configure Wireshark to automatically decrypt incoming packets, but for that you need to have access to the SSL key used in the communication. Don't ask me where to find this one. |
So my understanding from what you have said is that Broadlink have added a cloud-based authorization step and when the app requests a command, the device authenticates it directly with the cloud before opening the communication channel with the app. Thanks again @felipediel, at the very least it is interesting to have an insight into what is happening and I am sorry I cannot offer more useful input at this stage. |
@Siytek Exactly. Thanks for the data, you helped us to better understand the problem. |
Hello I am trying to connect my, Broadlink RM Mini3 but I see that nobody got it, right? Should I change my model for another recommendation? Regards |
I am looking at the communication again, now with more attention, and I think I was wrong about the triangulation process. There is definitely a cloud involved, but not needed to control the device. The response at 21 0.007922 refers to the request at 2 0.000292. Therefore, this type of device can communicate locally without intermediation. For those interested, we're getting close to the solution at #23566, but we need help with testing. |
Please let me know how I can help. Simone |
I can do some test |
Hi, I just received my RM mini 3 and of course it doesn't work with anything too. Not even with e-Control (saying it's unknown device). If you need some more help testing, let me know. |
Hi guys. I need help to test a possible solution, would you mind? Steps:
|
@felipediel thanks for looking into this. I will run that on my Debian server. I guess the RM has to be on the same subnet right? I have most of my stuff on a separate IoT subnet which is accessible from main LAN through router, but I guess it wouldn't work for the discovery. EDIT: The python app found the RM (based on the debug), so when I get home to be able to learn a command I will post the file. |
@felipediel Alright, I just tried running your code, according to debug log it finds the RM, but the LED doesn't come up and no codes are captured. |
@felipediel No problem :) Thanks for your work on this. |
Fixed in #32523. |
This issue can be closed. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Home Assistant release with the issue:
0.92.1
Last working Home Assistant release (if known):
N/A
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io
Component/platform:
/components/broadlink/
Description of problem:
I am unable to connect to my Broadlink RM Mini3. The component itself loads correctly, but I get the following error when I call the broadlink.learn service.
2019-04-30 21:12:42 ERROR (MainThread) [homeassistant.components.broadlink] Failed to connect to device
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):I've double and triple checked the IP address and MAC address and it seems fine.
Additional information:
The RM Mini 3 works fine when I use the IHC app on my phone. I can ping the IP address fine on my computer.
When I try to use Broadlink Manager, I get the following error too.
I'm not sure if it's related.
It's possible that the version of RM Mini 3 I have maybe slightly different to most, because I bought mine from Taobao, so the labelling on the bottom of it is in Chinese, while most of the ones I see on YouTube have English labelling. However, I'm not sure whether there is a way to fix it.
The text was updated successfully, but these errors were encountered: