stfnhmplr / homebridge-synology

Control your Synology Diskstation with Homekit
MIT License
159 stars 16 forks source link

Device is not online #86

Closed nh13 closed 1 year ago

nh13 commented 1 year ago

(copied from here)

Error messages like:

[9/29/2022, 11:36:18 AM] [DiskStation] Device is not online; Polling temperature disabled.
[9/29/2022, 11:36:18 AM] [DiskStation] Device is not online; Polling disk temperature disabled.

The ping module used by this plugin routes its request to the underlying ping command line utility (see here). Running ping <ip address> in the terminal gives me the error: ping: socket: Operation not permitted. This lead me to looking here.

The solution was to separately log into the DiskStation via ssh and execute sudo setcap 'cap_net_raw+ep' "$(which ping)". Then restart HomeBridge and voila, it can now ping the DiskStation and operate normally. Note: I also updated the homebridge dependency to 1.6 just in case the API changed.

nh13 commented 1 year ago

I think a more permanent solution is needed without the user having to manually ssh into the disk station. Thoughts?

stfnhmplr commented 1 year ago

Thanks for figuring this out. The older version of this plugin did just call the diskstations webinterface to detect the online state. Reverting this back should solve this issue. What do you think?

nh13 commented 1 year ago

@stfnhmplr that works for me!

stfnhmplr commented 1 year ago

I finally found some time to fix this. Instead of ping, an HTTP request is sent to the web interface to determine the online state.

kolorfilm commented 1 year ago

I finally found some time to fix this. Instead of ping, an HTTP request is sent to the web interface to determine the online state.

Hello there 👋🏻. Unfortunately this leads to another error/bug when the synology diskstation is off https://github.com/stfnhmplr/homebridge-synology/issues/89

It constantly restarting the whole Homebridge.

stfnhmplr commented 1 year ago

Hi. Thanks for reporting. Missed the error-handling part. Fixed with 1e59af8 (0.5.2)

kolorfilm commented 1 year ago

Hi. Thanks for reporting. Missed the error-handling part. Fixed with 1e59af8 (0.5.2)

Hi. You are welcome. Thanks for fixing! 🙂