sunoo / homebridge-rpi-rf-switch Goto Github PK
View Code? Open in Web Editor NEWrpi-rf Plugin for Homebridge
License: Apache License 2.0
rpi-rf Plugin for Homebridge
License: Apache License 2.0
The plugin always throws this error: (vanilla installation, only added provided sample-config)
[2/25/2020, 21:01:21] TypeError: Cannot read property 'forEach' of undefined
at rfSwitchPlatform.didFinishLaunching (/usr/lib/node_modules/homebridge-rpi-rf-switch/index.js:45:25)
at API.emit (events.js:311:20)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:103:13)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
[2/25/2020, 21:01:22] Got SIGTERM, shutting down Homebridge...
After installing the plugin and adding two "outlet" config using the Homebridge-x I get the following error in the logs:
[7/27/2020, 00:21:48] [Config] Homebridge restart request received
[7/27/2020, 00:21:48] [Config] UI / Bridge settings have not changed; only restarting Homebridge process
[7/27/2020, 00:21:48] [HB Supervisor] Sending SIGTERM to Homebridge
[7/27/2020, 00:21:52] [HB Supervisor] Restarting Homebridge...
[7/27/2020, 00:21:52] [HB Supervisor] Starting Homebridge with extra flags: -I
[7/27/2020, 00:21:52] [HB Supervisor] Started Homebridge v1.1.1 with PID: 4731
[7/27/2020, 00:21:53] Loaded config.json with 0 accessories and 2 platforms.
[7/27/2020, 00:21:53] ---
[7/27/2020, 00:21:54] Loaded plugin: [email protected]
[7/27/2020, 00:21:54] Registering platform 'homebridge-config-ui-x.config'
[7/27/2020, 00:21:54] ---
[7/27/2020, 00:21:55] Loaded plugin: [email protected]
[7/27/2020, 00:21:55] Registering platform 'homebridge-rpi-rf-switch.rfSwitch'
[7/27/2020, 00:21:55] ---
[7/27/2020, 00:21:55] [HB Supervisor] Sending SIGKILL to Homebridge
[7/27/2020, 00:21:55] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGKILL
[7/27/2020, 00:22:00] [HB Supervisor] Restarting Homebridge...
[7/27/2020, 00:22:00] [HB Supervisor] Starting Homebridge with extra flags: -I
[7/27/2020, 00:22:00] [HB Supervisor] Started Homebridge v1.1.1 with PID: 4751
[7/27/2020, 00:22:01] Loaded config.json with 0 accessories and 2 platforms.
[7/27/2020, 00:22:01] ---
[7/27/2020, 00:22:02] Loaded plugin: [email protected]
[7/27/2020, 00:22:02] Registering platform 'homebridge-config-ui-x.config'
[7/27/2020, 00:22:02] ---
[7/27/2020, 00:22:02] Loaded plugin: [email protected]
[7/27/2020, 00:22:02] Registering platform 'homebridge-rpi-rf-switch.rfSwitch'
[7/27/2020, 00:22:02] ---
[7/27/2020, 00:22:03] Loaded plugin: [email protected]
[7/27/2020, 00:22:03] Registering platform 'homebridge-zigbee-nt.ZigbeeHomebridgeNTPlatform'
[7/27/2020, 00:22:03] ---
[7/27/2020, 00:22:03] Loading 2 platforms...
[7/27/2020, 00:22:03] [Config] Initializing config platform...
[7/27/2020, 00:22:03] [Config] Running in Service Mode
[7/27/2020, 00:22:03] [RF Switch] Initializing rfSwitch platform...
[7/27/2020, 00:22:04] Error: Wrong type of arguments
at Interpreter.createSync (/usr/local/lib/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python/index.js:58:24)
at new RfSwitchPlatform (/usr/local/lib/node_modules/homebridge-rpi-rf-switch/src/index.ts:63:28)
at /usr/local/lib/node_modules/homebridge/src/server.ts:397:40
at Array.forEach ()
at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:374:27)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:153:29)
at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
[7/27/2020, 00:22:04] Got SIGTERM, shutting down Homebridge...
[7/27/2020, 00:22:09] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
The config.json file looks correct and generated by the plugin:
{
"bridge": {
"name": "Homebridge B634",
"username": "0E:13:7C:CD:B6:34",
"port": 51974,
"pin": "786-99-349"
},
"accessories": [],
"platforms": [
{
"name": "Config",
"port": 8581,
"platform": "config"
},
{
"devices": [
{
"name": "Outlet 1",
"on_code": 86101,
"off_code": 86099,
"pulselength": 350,
"protocol": 1,
"codelength": 24
},
{
"name": "Outlet 2",
"on_code": 83029,
"off_code": 83023,
"pulselength": 350,
"protocol": 1,
"codelength": 24
}
],
"name": "RF Switch",
"gpio": 17,
"repeat": 10,
"platform": "rfSwitch"
}
]
}
Any idea where to look for a possible solution?
Thanks
When I search for this plug in in the Homebridge-x and press install it generates the error below and I cannot install it:
USER: pi
DIR: /usr/local/lib
CMD: sudo -E -n npm install homebridge-rpi-rf-switch@latest
> [email protected] install /usr/local/lib/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python
> node-gyp rebuild
/bin/sh: 1: python3-config: not found
gyp: Call to 'python3-config --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-07-26T20_32_11_980Z-debug.log
Command failed. Please review log for details.
Any idea what to do?
Hi, After updating Pi
Linux HomeBridge 6.6.22-v8+ #1747 SMP PREEMPT Wed Mar 27 17:04:50 GMT 2024 aarch64 GNU/Linux
using last 2.2.3
I have
3/30/2024, 10:55:12 AM] [Portillon RF Switch] Initializing rfSwitch platform...
[3/30/2024, 10:55:12 AM] Error: Not running on a RPi!
at Interpreter.callSync (/var/lib/homebridge/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python/index.js:59:24)
at new RfSwitchPlatform (/var/lib/homebridge/node_modules/homebridge-rpi-rf-switch/src/index.ts:70:12)
at /var/lib/homebridge/node_modules/homebridge/src/server.ts:474:40
at Array.forEach ()
at Server.loadPlatforms (/var/lib/homebridge/node_modules/homebridge/src/server.ts:401:27)
at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:176:29)
[3/30/2024, 10:55:12 AM] Got SIGTERM, shutting down Homebridge...
[3/30/2024, 10:55:13 AM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
at Bridge.Accessory.setupURI (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
at Server.setServerStatus (/var/lib/homebridge/node_modules/homebridge/src/server.ts:155:45)
at Server.teardown (/var/lib/homebridge/node_modules/homebridge/src/server.ts:199:10)
at signalHandler (/var/lib/homebridge/node_modules/homebridge/src/cli.ts:93:12)
at process.emit (node:events:518:28)
at process.emit (/var/lib/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
All other HB plugins are working wo errors
Please help
BR
try to install the plugin and get errors,
i did the preinstallation like in the installation manual
hoobs@hoobs:~ $ sudo npm install -g homebridge-rpi-rf-switch --unsafe-perm
[email protected] install /usr/lib/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python
node-gyp rebuild
gyp: Call to 'python3-config --ldflags --embed' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Linux 5.10.17-v7l+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/homebridge-rpi-rf-switch/node_modules/node-calls-python
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-11-14T14_38_35_873Z-debug.log
Hi there,
this seems to be a great plugin. Unfortunately, I cannot get it to work.
I can perfectly switch my power socket via terminal on the standard rpi-rf script via
python3 sendRF.py -p 315 -t 1 4261201
This also works from the terminal within the homebridge UI.
sendRF.py is setup so that it uses GPIO17, which I also set in the plugin's config:
{ "devices": [ { "name": "Outlet A", "on_code": 4261201, "off_code": 4261204, "pulselength": 315 }, ], "name": "RF Switch", "gpio": 17, "platform": "rfSwitch" }
When switching "Outlet A", I do not see any logs in homebridge's main log apart from the following:
[27/03/2023, 16:26:25] [RF Switch] Outlet A is turned off. [27/03/2023, 16:26:43] [RF Switch] Outlet A is turned on.
Did you ever encounter this issue?
Any help is greatly appreciated, thank you very much!
I tryed to use the plugin on hoobs nut it wont strat.
[Homebridge] [3/7/2020, 5:51:43 AM] TypeError: Cannot read property 'forEach' of undefined
at rfSwitchPlatform.didFinishLaunching (/home/hoobs/.hoobs/node_modules/homebridge-rpi-rf-switch/index.js:45:25)
at API.emit (events.js:203:15)
at Server.run (/home/hoobs/.hoobs/node_modules/@hoobs/homebridge/lib/server.js:91:15)
at module.exports (/home/hoobs/.hoobs/node_modules/@hoobs/homebridge/lib/cli.js:90:12)
at Object. (/home/hoobs/.hoobs/node_modules/@hoobs/homebridge/bin/homebridge:10:63)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
the config has nor devices set. Even when i set one, I get the same error message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.