homebridge-broadlink-rm
homebridge-broadlink-rm copied to clipboard
couldn't learn code device not found: please help!!
Hi, so i have installed the broadlink plugin and i'm trying to get it working but when i use the learn switch in home kit it just gives me this error in the log,
6/9/2020, 9:51:26 PM [BroadlinkRM] Scan Frequency getSwitchState: undefined 6/9/2020, 9:51:26 PM [BroadlinkRM] Learn getSwitchState: undefined 6/9/2020, 9:51:41 PM [BroadlinkRM] [35m[INFO][0m Learn Code initializing (undefined) 6/9/2020, 9:51:41 PM [BroadlinkRM] [31m[ERROR][0m Learn Code (Couldn't learn code, device not found)
I have no idea where to go from here. Do i need have a host in the config file and if so how and where do i write that in my config file?
Hey @xkyle22x, I'm also having some issues with getting this to work. I have the following setup:
- RPi Model 2B
- Node.js v12.18.0
- npm v6.14.5
- homebridge v1.1.0
- Plugin 3.6.22
I installed Homebridge recently using this doc
Today, I got my Broadlink RM mini 3 and installed this plugin via Homebridge UI. I set up Wifi using the app, and didn't assign it to a room in the app. After that I installed the plugin. That didn't work though.
`[6/9/2020, 5:27:03 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [6/9/2020, 5:27:08 PM] [HB Supervisor] Restarting Homebridge... [6/9/2020, 5:27:08 PM] [HB Supervisor] Starting Homebridge with extra flags: -I [6/9/2020, 5:27:08 PM] [HB Supervisor] Started Homebridge v1.1.0 with PID: 3854 [6/9/2020, 5:27:11 PM] Loaded config.json with 0 accessories and 2 platforms. [6/9/2020, 5:27:11 PM] --- [6/9/2020, 5:27:13 PM] ==================== [6/9/2020, 5:27:13 PM] ERROR LOADING PLUGIN homebridge-broadlink-rm: [6/9/2020, 5:27:13 PM] Error: Cannot find module 'hap-nodejs' Require stack:
- /usr/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/dist/accessory.js
- /usr/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/dist/index.js
- /usr/lib/node_modules/homebridge-broadlink-rm/platform.js
- /usr/lib/node_modules/homebridge-broadlink-rm/index.js
- /usr/lib/node_modules/homebridge/lib/plugin.js
- /usr/lib/node_modules/homebridge/lib/pluginManager.js
- /usr/lib/node_modules/homebridge/lib/api.js
- /usr/lib/node_modules/homebridge/lib/server.js
- /usr/lib/node_modules/homebridge/lib/cli.js
- /usr/lib/node_modules/homebridge/bin/homebridge
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
(/usr/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/src/accessory.ts:3:1) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) [6/9/2020, 5:27:13 PM] ==================== [6/9/2020, 5:27:14 PM] Loaded plugin: [email protected] [6/9/2020, 5:27:14 PM] Registering platform 'homebridge-config-ui-x.config' [6/9/2020, 5:27:14 PM] --- [6/9/2020, 5:27:14 PM] Loading 2 platforms... [6/9/2020, 5:27:14 PM] [Config] Initializing config platform... [6/9/2020, 5:27:14 PM] [Config] Running in Service Mode [6/9/2020, 5:27:14 PM] Error loading platform requested in your config.json at position 2 [6/9/2020, 5:27:14 PM] Error: The requested platform 'BroadlinkRM' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/lib/node_modules/homebridge/src/pluginManager.ts:224:15) at /usr/lib/node_modules/homebridge/src/server.ts:386:37 at Array.forEach ( ) at Server.loadPlatforms (/usr/lib/node_modules/homebridge/src/server.ts:373:27) at Server.start (/usr/lib/node_modules/homebridge/src/server.ts:152:29) at cli (/usr/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) [6/9/2020, 5:27:14 PM] Got SIGTERM, shutting down Homebridge...`
I then searched the webs for solutions & tried downgrading to 3.6.10. This worked for me then, I didn't get the error shown above. Unfortunately, I then had the issue you are describing above.
Mind sharing your setup?
cheers
Hi sorry for the late reply. I’m not sure I can help you much I’m new to to most of this. I’m running Current version of hoobs on rp3 and I’ve tried a couple of different plugins all same problem for me.
I got it working. Though only by using a recently updated fork of this repo.
https://www.npmjs.com/package/homebridge-broadlink-rm-pro
https://github.com/kiwi-cam/homebridge-broadlink-rm
Good luck. :)
So are u saying u deleted the original plugin and then installed this one? Or you just put that command into the terminal? Sorry like I said total noob....
No worries.
So uninstall this one here first.
Then, depending on your installation method, install the new plugin.
npm i -g homebridge-broadlink-rm-pro
or
sudo npm i -g homebridge-broadlink-rm-pro
If you want a nice UI for Homebridge management & plugin installation like this:
-> I did my Homebridge installation as described in here: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian
Ok thanks for the help I’ll let u know how I go.
hi again, so i tried to install the file u sent me and got this?? any ideas?
hoobs@hoobs:/home/hoobs/.hoobs/etc $ npm install -g npm npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/graceful-fs npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/mkdirp npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/nopt npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! syscall access npm ERR! path /usr/local/lib/node_modules/npm/node_modules/graceful-fs npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/graceful-fs' npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/graceful-fs'] { npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/graceful-fs'", npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/graceful-fs' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in: npm ERR! /home/hoobs/.npm/_logs/2020-06-12T05_32_58_293Z-debug.log hoobs@hoobs:/home/hoobs/.hoobs/etc $
Hey, quick question: Do you have the same user interface as I have? If so, you can go to Plugins and search for the plugin there.
FYI: When working with Linux/Unix based machines, you always have the sudo prefix option.
eg. sudo npm i -g homebridge-broadlink-rm-pro
. The sudo means super user do. A super user is an admin in this case.
Personally I'm not a bit fan of JS/Nodejs, as errors are hard to figure out.
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
<<<< Error Access - the program cannot access the folder >> sudo
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/graceful-fs'
So: To continue, try to install the plugin via the Homebridge UI :
or open the terminal in the Homebridge UI & enter sudo npm i -g homebridge-broadlink-rm-pro
as seen here:
I’m using HOOBS interface. Can’t find it in the plugins section. I ran this command sudo npm i -g homebridge-broadlink-rm-pro And it said I need to run another command to update then when I ran the other command I didn’t put sudo In Front of it and that was the error I got.
No luck. It installed with the sudo command but then nothing shows up in the plugin section
can you follow this dude's explanation & does it help: https://www.youtube.com/watch?v=Brik7usfKaE
Unfortunately, I haven't installed Hoobs, so I don't know what it looks like on your part.
To be a bit more independent from preset installs, I'd suggest you install NOOBS (Raspbian) and then install eg. Pi Hole & HomeBridge
I installed Homebridge recently using this doc
It’s not the interface it was that I didn’t run the sudo command but it didn’t work after I got it installed anyway.
Before u installed that plugin did u do the step where u had to reset the broadlink and then after it connects to wifi close it before u add it to a room for this to work?
Yes, you have to set up the Wifi using the app. After that, you can remove the app.
What I mean is did u set up the wifi in the broadlink app and assign the RM to a room or did u back out of the app before u assigned it to a room? Not sure if this will make a difference but I saw a post saying that it could work to recognise the device.
There is no need to assign it to a room or sth. like that. The app is needed to set the wifi connection. The rest will come from a config setting. This is my Broadlink config: https://jsonblob.com/ae2c9b31-acdd-11ea-850e-25b7cf6256a2
Notice, there are two relevant lines:
"hideScanFrequencyButton": false,
"hideLearnButton": false,
After the install of the plugin and making the adaptions to you config, restart the server & make sure in the logs, that the broadliink device was found. Check the home app & two devices should be in the default room. Those are learning devices. Tap either device to learn a code. In my case I had to press remote buttons for my TV. (No experience with RF.) After you hit the button the code should be visible in the terminal. Something like that (for IR codes): 26008c008f94143614351337141112131212131213121238123713371213121312131212131213121337121312131213121213121213123812131237123812371337123812381200060493941237133712381212131213121213121312371337143614111410131212131213121314351213141114111411121213121238141114351337143515351436143515000d0500000000000000000000
Ok thanks I’ll try it today. I am getting the learn and scan buttons but when I press the learn button to try and get a hex code that is when it gives me the error in my original post. This one. 👇👇👇
6/9/2020, 9:51:26 PM [BroadlinkRM] Scan Frequency getSwitchState: undefined 6/9/2020, 9:51:26 PM [BroadlinkRM] Learn getSwitchState: undefined 6/9/2020, 9:51:41 PM [BroadlinkRM] �[35m[INFO]�[0m Learn Code initializing (undefined) 6/9/2020, 9:51:41 PM [BroadlinkRM] �[31m[ERROR]�[0m Learn Code (Couldn't learn code, device not found)
Just an update and for anyone with the same problem. I got it working, i had to delete and re-setup broadlink again in the app connecting it to wifi but not assigning it to a room. This is where I went wrong! As soon as I did that and installed the fork worked correctly.
panagiotisTB Thanks for all your help your a ledgend! Appreciate it 👍
Hi, Got RM4 PRO, installed the plugin by KIWI-CAM. Receive the following message: [homebridge-broadlink-rm-pro.BroadlinkRM] [Info] We've discovered an unknown Broadlink device. This likely won't cause any issues.
Please raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: "6026".
Does anyone has a solution?
Thanks.
Hi, I just flashed the homebridge image to my raspberry today and as I have a RM4 pro I tried to install and config this plugin. I get this message after it appears in HomeKit and I try scan RF code: [INFO] Learn Code (Couldn't learn code, device not found)
node:12.8.3 npm 6.14.8 homebridge 1.1.2 homebridge-broadlink-rm-pro 4.2.9
The RM4 pro device is connected to Broadlink app and I can ping it.
Do you have and advice? Thanks!
When you set up the broadlink app did you stop before allocating it to a room?
Thanks @xkyle22x ! That was the issue. Now it is working fine with IR, but I'm not able to scan RF codes... I didn't really find solution for that in other threads so far.
"Scan RF (found frequency - 1 of 2)" message. is not show up. My device use 315 Hz. When device was added to the broadlink app I was able to scan it.
This is all I see: [8/25/2020, 09:01:09] [Broadlink RM] [INFO] Scan RF (scanning) [8/25/2020, 09:01:09] [Broadlink RM] [ACTION] Hold down the button that sends the RF frequency. [8/25/2020, 09:01:30] [Broadlink RM] [INFO] Scan RF (stopped - 20s timeout) [8/25/2020, 09:01:31] [Broadlink RM] [INFO] Scan RF (stopped)
Any idea what I should do differently? Thanks!
What exactly is it doing? Just won't scan at all or error in the logs or no scan button in HomeKit?
Learn and Scan Frequency button is in the homekit. I'm able to start the Scan Frequency button, but it is not scanning the frequency or code. So it does not scan at all. This is all I see in the the homebridge log: This is all I see: [8/25/2020, 09:01:09] [Broadlink RM] [INFO] Scan RF (scanning) [8/25/2020, 09:01:09] [Broadlink RM] [ACTION] Hold down the button that sends the RF frequency. [8/25/2020, 09:01:30] [Broadlink RM] [INFO] Scan RF (stopped - 20s timeout) [8/25/2020, 09:01:31] [Broadlink RM] [INFO] Scan RF (stopped)
So when u push the button on your rf remote it is not showing in the logs? Said it scanned..
When I push the button it is not showing in the log. I got the timeout message only.
That's strange, by the logs it said it was scanning. I'm not sure. I just point my remote at the rm mini while it is in that scanning process and push the button and the hex code comes up in the logs and I copy it from there.