homebridge-people icon indicating copy to clipboard operation
homebridge-people copied to clipboard

Ping does not work

Open oynek opened this issue 7 years ago • 14 comments

Webhook looks good and triggers work as expected. But the frequent pings do not work. Does anyone has some suggestion what I can try so solve this?

I use homebridge via Synology Docker.

[2018-1-30 14:04:46] Loaded plugin: homebridge-people
[2018-1-30 14:04:46] Registering platform 'homebridge-people.People'
[2018-1-30 14:04:46] Registering accessory 'homebridge-people.PeopleAccessory'
[2018-1-30 14:04:46] Registering accessory 'homebridge-people.PeopleAllAccessory' [2018-1-30 14:04:47] [People] Initializing People platform...
[2018-1-30 14:04:47] [People] Initializing platform accessory 'user1'...
[2018-1-30 14:04:47] [People] Initializing platform accessory 'user2'...
[2018-1-30 14:04:47] [People] Initializing platform accessory 'Anyone'...
[2018-1-30 14:04:47] [People] Initializing platform accessory 'No One'...
[2018-1-30 14:04:47] [People] WebHook: Started server on port '51828'

oynek avatar Jan 30 '18 15:01 oynek

I am having the same issue. Also on Synology Docker

Segelfeldt avatar May 07 '18 21:05 Segelfeldt

I am having the same problem too. Also on Synology Docker

methol avatar Jun 29 '18 15:06 methol

Same issue, running Synology Docker.

alexbaldwin avatar Aug 09 '18 00:08 alexbaldwin

I have the same problem but I run homebridge on a raspberry pi with docker

getafe83 avatar Oct 17 '18 06:10 getafe83

I’m having the same issue with homebridge on an unRAID docker.

seanwalter avatar Nov 19 '18 09:11 seanwalter

I did a little digging and it looks like there is no ping utility installed by default with the docker container I was using. As a temporary fix, I opened a bash shell in the container and installed a ping utility manually:

docker exec -it HomeBridgewithwebGUI /bin/bash

then:

sudo apt-get install inetutils-ping

Hopefully this can help others on this thread who are using Homebridge in a docker. I suspect ping will need to be reinstalled after any update to the container, unless the container developer(s) address this directly.

seanwalter avatar Nov 28 '18 07:11 seanwalter

I did a little digging and it looks like there is no ping utility installed by default with the docker container I was using. As a temporary fix, I opened a bash shell in the container and installed a ping utility manually:

docker exec -it HomeBridgewithwebGUI /bin/bash

then:

sudo apt-get install inetutils-ping

Hopefully this can help others on this thread who are using Homebridge in a docker. I suspect ping will need to be reinstalled after any update to the container, unless the container developer(s) address this directly.

Any suggestions for windows? It looks like I am not getting pings either therefore not getting occupancy changes.

400HPMustang avatar Dec 06 '18 00:12 400HPMustang

any solutions for homebridge on macOS?

Salsalove avatar Dec 21 '18 15:12 Salsalove

If you've installed the Synology package to run docker homebridge, then this creates a startup.sh file in the volume you choose during the setup wizard. The Homebridge UI does not provide a way to edit this file so you'll need to do this using DSM or your own computer's editor. Add the following line to the bottom of the startup.sh file:

apk add iputils --no-cache

To apply the changes made to the startup.sh file you need to restart the entire container using the Docker app in DSM.

Barloew avatar Jan 26 '19 10:01 Barloew

If you've installed the [Synology package../.. apk add iputils --no-cache

This fixed my issue! Thanks for your help!

LucasJanin avatar Jan 31 '19 02:01 LucasJanin

If you've installed the Synology package to run docker homebridge, then this creates a startup.sh file in the volume you choose during the setup wizard. The Homebridge UI does not provide a way to edit this file so you'll need to do this using DSM or your own computer's editor. Add the following line to the bottom of the startup.sh file:

apk add iputils --no-cache

To apply the changes made to the startup.sh file you need to restart the entire container using the Docker app in DSM.

Thank you! fixed mine aswell. For anyone else - you can run this in the terminal as well (tried from windows tbh) image

kelos-01 avatar May 08 '19 15:05 kelos-01

sudo apt-get install inetutils-ping apk add iputils --no-cache

Both of these packages have been added to the base oznu/homebridge docker image.

oznu avatar May 22 '19 13:05 oznu

@oznu Having ping helps, but the container user ‘abc’ still gets this trying to execute it :

ping: socket: Operation not permitted

So you might want to add this into your startup.sh too,

setcap 'cap_net_raw+ep' $(which ping)

Which then allows non-root user to use ping successfully, assuming no other docker restrictions on capabilities being set.

tomtastic avatar Sep 04 '20 19:09 tomtastic

@oznu any chance you would make the non-root user able to run the ping command within the homebridge docker image? Running homebridge on DSM with docker-compose, the "homebridge-people-guest-mode" plugin seems not to be working correctly because of this issue.

I tried to add

apt-get install inetutils-ping
setcap 'cap_net_raw+ep' $(which ping)

to the startup.sh script, as suggested by @tomtastic but without any success. :(

bxlouis avatar Feb 09 '21 00:02 bxlouis