AlexanderBabel / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
46 stars 11 forks source link

Broadlink RM won't detect device failures due to a permissions issues with "net-ping" #70

Open kiwi-cam opened 4 years ago

kiwi-cam commented 4 years ago

I've just merged version 4.1.0 (#69) and it includes a complete overhaul of how ping works. Because of this, permissions may be an issue in some distributions. After updating, you may see this in your logs:

Jan 09 11:06:39 homebridge[25722]: [Broadlink RM] Broadlink RM won't detect device failures due to a permissions issues with "net-ping".
Jan 09 11:06:39 homebridge[25722]: To fix:
Jan 09 11:06:39 homebridge[25722]:  1. Run "which node" to determine your node path.
Jan 09 11:06:39 homebridge[25722]: 2. Run "sudo setcap cap_net_raw+ep /path/to/node".
Jan 09 11:06:39 homebridge[25722]: Note: Replacing /path/to/node with the path you found in the first step.

To fix this, follow the steps as outlined:

which node
sudo setcap cap_net_raw+ep /path/to/node

If that works, the plug-in should now run. However, you may then get this error:

Failed to set capabilities on file `/usr/bin/node' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

In that case take the path to node from above and run this: ls -al /usr/bin/node That will return the path to where node really is, e.g.:

pi@homebridgepi:~ $ ls -al /usr/bin/node
lrwxrwxrwx 1 root root 20 Sep  2 13:53 /usr/bin/node -> /opt/nodejs/bin/node

Then just run the command from above with the second path: sudo setcap cap_net_raw+ep /opt/nodejs/bin/node