NetworkHealth : Unable to detect some devices?

It’s usually not a good idea to run applications as root, so instead of starting openhab as root you can also grant java the permission to use raw and packet sockets. Install setcap (sudo apt-get install libcap2-bin) and figure out where the java binary is located on the filesystem:
pi@rpi-openhab ~ $ which java
/usr/bin/java
pi@rpi-openhab ~ $ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 jan 31 2015 /usr/bin/java -> /etc/alternatives/java
pi@rpi-openhab ~ $ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 51 jan 31 2015 /etc/alternatives/java -> /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java

then execute:
sudo setcap cap_net_raw=ep /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java
and restart openhab
Now openhab (java) can do ICMP.

9 Likes