luisiam / homebridge-foscamcamera

Foscam Plugin for HomeBridge (API 2.1): https://github.com/nfarina/homebridge
Apache License 2.0
42 stars 6 forks source link

If camera is off, it will no be configured. #49

Open kikeenrique opened 7 years ago

kikeenrique commented 7 years ago

Hi, If the camera is not powered on, it will never be detected. Currently I’m having this message: Sep 18 22:41:17 raspberrypi homebridge[28823]: (node:28823) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RequestError: Error: connect EHOSTUNREACH 192.168.0.14:589
After this, turning on cam has no effect. In my workflow, I usually turn on/off camera on demand, using a controlled plug.

luisiam commented 7 years ago

This is the way the plugin works. The camera has to be on all the time.

kikeenrique commented 7 years ago

But my point is not only about the cam not being on all the time, any temporal network issue could also be affected by this problem I guess. I would suggest adding two new config parameters. One for a timer to retry a request in case of any communication error (or no reply), that would retry communication for example after 10 minutes. And a second parameter for the number of retries, for example to 3 attemps (and in my use case it will retry infinitely). But I think this shall be reported also to plugin dependencies, shall it?