NorthernMan54 / homebridge-rtl

Homebridge Plugin for rtl_433 devices
MIT License
22 stars 10 forks source link

Permissions Issue #16

Open VE5CE opened 3 years ago

VE5CE commented 3 years ago

I am trying to get this going and I can't figure out how to give users the right permissions I keep seeing this in my log.

[rtl_433] Spawning rtl_433 [20/09/2021, 15:45:48] [rtl_433] child exit code (spawn) 127 [20/09/2021, 15:45:48] [rtl_433] child close code (spawn) 127

jcmichot commented 2 years ago

spawn rtl_433 from homebridge is a bad idea because you probably need to run homebridge as root to get LimeSDR access. In my case i run homebride as simple user in a FreeBSD jail, and rtl_433 as root in the hosting system.

I start rtl_433 from another startup script (rtl_433 -v -F json -C si -M protocol > /jail/homebridge/tmp/rtl433.json) and in sensor.js i replace line // var proc = childProcess.spawn('pkill rtl_433;/usr/local/bin/rtl_433', ['-q', '-F', 'json', '-C', 'si'], { by var proc = childProcess.spawn('/usr/bin/truncate -s 0 /tmp/rtl433.json;/usr/bin/tail', ['-F','/tmp/rtl433.json'], {

NorthernMan54 commented 2 years ago

If google ubuntu rtl-sdr udev rules you will find several examples of how to use udev rules to configure to rtl_sdr device to be accessible without using root.

jcmichot commented 2 years ago

Same in FreeBSD with devfs.conf (if you stay in same jail), but if you need rtl_433 data outside homebridge it's better to run rtl_433 in a separate way. I get many data from rtl_433, car informations, house heating system, house power meter, water, etc. and they are actualy (not yet) integrated in homebridge-rtl. I process all theses data outside homebridge.

NorthernMan54 commented 2 years ago

Personally, I have started just creating these other devices in node-red/homekit-bridged. I had written homebridge-rtl before I had discovered the flexibility of node-red/mqtt, and am now using node-red to drive my new devices. And have added node-red-dashboard to the mix, to create some really cool UI's. And I run rtl_433 with the option to share the output onto my mqtt server. ( ~/.config/rtl_433/rtl_433.conf - output mqtt://127.0.0.1:1883 ). My mqtt server is on the localhost.

Screen Shot 2022-03-19 at 5 36 51 PM

This is a mix of homebridge data, with mqtt data

mjakefranklin commented 2 years ago

To answer the original question, Ubuntu/Debian packages often install rtl_433 in /usr/bin. However, this plugin has /usr/local/bin hardcoded. An exit code of 127 means command not found. Just make a softlink: ln -s /usr/bin/rtl_433 /usr/local/bin/rtl_433

OE5DRO commented 11 months ago

To answer the original question, Ubuntu/Debian packages often install rtl_433 in /usr/bin. However, this plugin has /usr/local/bin hardcoded. An exit code of 127 means command not found. Just make a softlink: ln -s /usr/bin/rtl_433 /usr/local/bin/rtl_433

i have made this now i have this error: [30/10/2023, 10:37:01] [rtl_433] child exit code (spawn) 2 [30/10/2023, 10:37:01] [rtl_433] child close code (spawn) 2

any ideas?