lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
571 stars 285 forks source link

Unable to start Learn Code #437

Open takamasa-arch opened 6 years ago

takamasa-arch commented 6 years ago

I have installed this module to my homebridge but can't learn anything with my RM mini 3 S/N RM312208xxxx. Whenever I tapped "Learn" button in my home.app but always returns Error as below.

Can anyone help me for my issue?

[2018-9-19 22:10:53] [Broadlink RM] Initializing BroadlinkRM platform... [2018-9-19 22:10:53] [Broadlink RM] [INFO] Automatically discovering Broadlink RM devices. [2018-9-19 22:10:53] [Broadlink RM] [INFO] Running Homebridge Broadlink RM Plugin version 3.5.5 [2018-9-19 22:10:53] [Broadlink RM] TV On/Off Accessory Ready [2018-9-19 22:10:53] [Broadlink RM] Initializing platform accessory 'Learn IR'... [2018-9-19 22:10:53] [Broadlink RM] Initializing platform accessory 'TV On/Off'... [2018-9-19 22:10:53] [Broadlink RM] TV On/Off getSwitchState: false [2018-9-19 22:11:07] [Broadlink RM] TV On/Off getSwitchState: false [2018-9-19 22:11:07] [Broadlink RM] Learn IR getSwitchState: undefined [2018-9-19 22:11:09] [Broadlink RM] TV On/Off setSwitchState: true [2018-9-19 22:11:09] [Broadlink RM] TV On/Off setSwitchState: false [2018-9-19 22:11:11] [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found) [2018-9-19 22:16:01] [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found)

{
    "platform": "BroadlinkRM",
    "name": "Broadlink RM",
    "hideWelcomeMessage": true,
    "accessories": [
        {
            "accessory": "Broadlink RM Learner",
            "name": "Learn IR",
            "type": "learn-code",
            "host": "192.168.xx.xx"
        },
        {
            "name": "TV On/Off",
            "type": "switch",
            "data":{
                "on": "",
                "off": ""
            }
        }
    ]
}

$ node -v v8.11.4 $ npm -v 6.4.1

$ node ~/.nvm/current/lib/node_modules/homebridge-broadlink-rm/helpers/getDevice.js $

Btw I've confirmed I can reach out my RM mini by ping command but in the case of above command, no message returned.

takamasa-arch commented 6 years ago

Hi, I found below instructions that seems related my problems, but how should I put this to my config.json? Can anyone exactly point out where it should be stated in config.json?

Or, is there no relationship for my issues?

QUOTE

Device Discovery Include in the top of the platform config (not in any of the accessories). ... "hosts": [ { "address": "192.168.1.76", "mac": "34:ea:34:e7:d7:28", "isRFSupported": true } ], ... Generally Broadlink RM devices should be detected automatically. I've resolved many issues related to this in recent releases however if your network doesn't support UDP for whatever reason then your device still won't be discovered.

To help combat this there's a "hosts" option that can be defined at the top level of the plugin config.

kiwi-cam commented 6 years ago

I can't remember why, but I have a hosts section in my config. Here's a copy, to help you fit yours in:

{
    "bridge": {
        "name": "Living Room HUB",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": 51826,
        "pin": "123-456-78"
    },

    "hosts": [{
        "address": "192.168.1.50",
        "mac": "34:EA:34:XX:XX:XX",
        "isRFSupported": true
    }],

    "platforms": [{
        "platform": "BroadlinkRM",
        "name": "Broadlink RM",
        "accessories": [{
        ....

I hope that helps.

takamasa-arch commented 6 years ago

Hi, kiwi-cam.

Thanks for your comments. I added "hosts" section and could load it without issue. But still can't start "Learn" mode with error below.

[Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found)

Does it mean that homebridge couldn't reach my RM mini 3 even my homebridge on Raspberry pi can ping it...?

takamasa-arch commented 6 years ago

Hi, I could solve it.

That's caused by my port firewall config. After disabling firewalld, I could start learn mode. Does anyone know which port RM mini uses for communication?

port number will be automatically changes in time by time. you can't use firewall for this. you should consider to place this inside LAN, not like DMZ.

tinoargentino commented 5 years ago

Hi, I could solve it.

That's caused by my port firewall config. After disabling firewalld, I could start learn mode. Does anyone know which port RM mini uses for communication?

port number will be automatically changes in time by time. you can't use firewall for this. you should consider to place this inside LAN, not like DMZ.

Hi @tkmmobile , how do you disable the firewall?

tinoargentino commented 5 years ago

@tkmmobile I disabled it and it worked, thanks!

takamasa-arch commented 5 years ago

Great :)

tinoargentino commented 5 years ago

Question @tkmdmobile , is there a workaround to make this work without disabling my firewall, or without compromising my security?

takamasa-arch commented 5 years ago

@tinoargentino No, at least I don't have any idea.

foretony5211 commented 5 years ago

@tinoargentino disable firewall in my homebridge pi device? I don’t install firewall ever . How to disable firewall?thanks

tinoargentino commented 5 years ago

I had to do it in the configuration of my router

lprhodes commented 5 years ago

Hey, I'll be jumping back on the project over the week or so. Disabling a firewall shouldn't be a solution so I'll get back to you on this.

ZacGrose commented 5 years ago

Hooray! How long for?

lprhodes commented 5 years ago

I'll be making use of the broadlink again in a van conversion I've been working on so I'd say indefinitely.

docwindsor commented 4 years ago

I'm having same (or similar) problem: getting [ERROR] Learn Code (Couldn't learn code, device not found) in the Homebridge log whenever I press the "learn" button in the Home app.

I'm running Homebridge using latest docker image for Synology from Oznu: Homebridge on Synology · oznu/docker-homebridge Wiki

I've tried turning off the firewall on the Synology, but that hasn't helped. Any suggestions are appreciated, as are alternatives to getting IR codes from the Broadlink RM mini 3.

bjbech commented 4 years ago

I'm having same (or similar) problem: getting [ERROR] Learn Code (Couldn't learn code, device not found) in the Homebridge log whenever I press the "learn" button in the Home app.

I'm running Homebridge using latest docker image for Synology from Oznu: Homebridge on Synology · oznu/docker-homebridge Wiki

I've tried turning off the firewall on the Synology, but that hasn't helped. Any suggestions are appreciated, as are alternatives to getting IR codes from the Broadlink RM mini 3.

Have you adding in the host information? Running in a docker container I ran into the same issue. Wasn't sure if it was UFW or Docker causing it not to be able to be found but as soon as I entered the devices info in host it was able to communicate.

 {
            "platform": "BroadlinkRM",
            "Name": "Broadlink RM",
            "hideScanFrequencyButton": false,
            "hideLearnButton": false,
            "hideWelcomMessage": false,
            "hosts": [
                {
                "address": "xxx.xxx.x.xx",
                "mac": "xx:xx:xx:xx:xx:xx",
                "isRFSupported": false
                }
            ],
docwindsor commented 4 years ago

@b-bech Hey, appreciate the help. Unfortunately I'd already added that to my config. I double-checked the addresses, restarted the homebridge Docker container, and tried again just now. Still no luck.

For reference here is my homebridge platforms section (addresses "x"-ed out):

    "platforms": [
        {
          "platform":"BroadlinkRM",
          "name":"Broadlink RM",
          "hideWelcomeMessage": true,
          "hideScanFrequencyButton": true,
          "hideLearnButton": false,
          "hosts":[{
            "address":"xxx.xxx.x.xxx",
            "mac": "xx:xx:xx:xx:xx:xx",
            "isRFSupported": false
          }]
        }
    ]

When I open the Home app on my iPhone I see the Learn button for the Broadlink. But when I tap it and then press my IR remote button all I see in the homebridge log is this:

[11/29/2019, 6:16:21 PM] Homebridge is running on port xxxxx.
[11/29/2019, 6:17:28 PM] [Broadlink RM] Learn getSwitchState: undefined
[11/29/2019, 6:18:47 PM] [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found)
chemelli74 commented 4 years ago

Hi,

exactly same behaviour here with a RM mini3 and firmware v44057.

Another user reported that version 3.5.5 of the plugin works fine for him. How can I downgrade for a test ?

Thank you,

Simone

chemelli74 commented 4 years ago

Hi again,

used "tcpdump host 192.168.xxx.yyy and not arp -vv -X" to investigate further. Hopefully the info helps you dig into the issue:

20:55:02.828761 IP (tos 0x0, ttl 64, id 14215, offset 0, flags [DF], proto UDP (17), length 164) HomeNAS.station.38586 > new-host-3.station.http: [bad udp cksum 0x83ff -> 0x4370!] UDP, length 136 .... 20:55:02.847946 IP (tos 0x0, ttl 255, id 21458, offset 0, flags [none], proto UDP (17), length 84) new-host-3.station.http > HomeNAS.station.38586: [udp sum ok] UDP, length 56 ....

Simone

chemelli74 commented 4 years ago

Hi,

anything I can do to help fix this issue ?

Thank you,

Simone

cmlad commented 4 years ago

I think I have the same issue, firmware 44057. Discovery never seems to even kick in.

Homebridge v0.4.53 RM plugin v3.6.22 Node.js v13.12.0 Npm v6.14.4 MacOS 10.15.4

IP and MAC are correct, verified though the ihc app, router interface, and pinging manually from laptop.

I couldn't capture any UDP traffic, will look more into this one of these days.

config:

{
    "bridge": {
        "name": "Homebridge 6EB2",
        "username": "0E:70:45:C1:6E:B2",
        "port": 51168,
        "pin": "181-33-617"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "platform":"BroadlinkRM",
            "name":"Broadlink RM",
            "hideScanFrequencyButton": false,
            "hideLearnButton": false,
            "hideWelcomeMessage": false,
            "hosts": [
                {
                    "address": "192.168.1.23",
                    "mac": "C8:F7:42:83:26:73",
                    "isRFSupported": false
                }
            ],
            "accessories": [
                {
                    "accessory": "Broadlink RM Learner",
                    "name": "Learn IR",
                    "type": "learn-code",
                    "host": "192.168.1.23"
                }
            ]
        }
    ]
}

Log:

[4/4/2020, 10:07:44 PM] [Broadlink RM] Learn IR getSwitchState: undefined
[4/4/2020, 10:07:49 PM] [Broadlink RM] [INFO] Learn Code initializing (192.168.1.23)
[4/4/2020, 10:07:49 PM] [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found)
cmlad commented 4 years ago

Was able to connect after resetting and setting up with https://github.com/mjg59/python-broadlink

mxbusch commented 3 years ago

Was able to connect after resetting and setting up with https://github.com/mjg59/python-broadlink

Thank you so much, this worked for me as well 👍