-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera Snapshots stop updating after awhile #1274
Comments
I found an easier work around. I delete the cameras from the cache in the HomeBridge settings. Once I do that, the camera updates. I did that this morning when the cameras were 16 hours out of date and weren’t updating. |
I want to also mention that when the snapshots stop updating, live camera also stops working. It just spins forever. The fact that clearing the cache fixes this seems to indicate a problem on the HomeBridge/plugin side rather than the HomeKit side. I also have Blink cameras and while they don’t support live view in HomeBridge, they do support snapshots which work flawlessly. As such that would appear to eliminate HomeBridge as a problem which leaves the Ring plugin. Another thing I’ve noticed is that the last snapshot time differs on different devices. As such it doesn’t seem like the cache is providing images. |
@Morac2 thanks for the updated info! This definitely sounds like a HomeKit issue, and not something we can fix at the homebridge/plugin level. Glad you got it working! I don't think there is anything else for us to look into at the point. |
@dgreif I’m not sure how this is a HomeKit issue when clearing the cache fixes it temporarily and it only affects Ring cameras and not Blink cameras (different plugin). |
@Morac2 You didn't provide any logs, do they happen to show anything interesting, for example, when it's working vs not and when you delete the cache? There's not much to go on with just an open issue. I took a quick look at the Blink plugin vs this one and there's not much difference here. It appears that there's a call to handleSnapshotRequest() in both cases, and they simply return a snapshot via the appropriate API. I wonder if perhaps the cameras are going offline or maybe a request is getting stuck since you say that streaming is also not working, and maybe removing them from the cache somehow refreshes them. But logs might tell something. If not, it's really very difficult to know what to do here. |
There are no logs at all when it stops working. If I reboot homebridge there’s logs saying the camera was read from the cache but that’s it. When it works I see a lot of stuff in the logs. Next time it happens I’ll grab them. One other thing to mention is that the mDNS for HomeBridge changes periodically from http://homebridge.local to http://homebridge-2.local/ until I restart the Avahi service. I don’t know if the plug-in uses that or not, but that’s usually when I also notice the Ring cameras stop updating. |
Correction. There’s only log data when viewing a ring camera live. There’s no log data when the snapshot updates. |
@tsightler so I checked and the Ring plug-in never logs anything whether or not the snapshots update. When I open a view with a Ring camera the last update time displays until the time when the snapshot updates and then it changes to 0 seconds. In comparison, the Blink plug-in immediately updates the “update time” in Home (goes back to 0 seconds) when I go to a view with a Blink camera and then the log shows “refreshing snapshot”. As such the reason I didn’t include any logs is that the Ring plugin doesn’t log anything for refreshing snapshots. The only time the plug-in logs anything is on HomeBridge boot up and if I open a live view of a Ring camera. |
So I noticed in the code that logging is only done in debug mode so I enabled that. And this is what shows up when it works. I’ll need to wait for it to break again. It does seem to load the snapshot a lot. This was just one time opening the Home app. [02/08/2023, 20:06:50] [homebridge-ring] No snapshot cached for Garage |
That seems about right, it should settle in to about once every 10s or so for each camera, which it seemed to do. |
I think this is a combination HomeKit, HomeBridge problem. Today I noticed the Ring cameras weren't updating, but only on my iPad and iPhone. The cameras worked on my Apple TV and Mac, which I hadn't used to access them previously. I noticed this when someone Rang my doorbell. I checked HomeBridge and the mDNS name had changed again from homebridge.local to homebridge-2.local. Restarting the avahi-daemon server fixed that, but when that happens my iPhone and iPad no longer trigger requests to the Ring cameras. I tried turning Wifi off and on, but that didn't fix it. I had to restart the iOS devices to get them to work with the Ring cameras (Blink still works fine), so something must be caching on the Apple side. I have a feeling if I could solve the problem with the homebridge switching mDNS names that would solve the Ring plugin problem. I tried setting a CRON job to restart the avahi-daemon nightly, but that didn't help. |
I think I might have seen this in my environment as well. My wife's iPad would stop refreshing snapshots unless I performed some manual action to get it going again (usually I could just swipe down from the top to force a refresh and it would come back, but sometimes not even that). It seems like switching from Bonjour-HAP to Ciao for the mDNS Advertiser may have resolved it for me, at least, it hasn't reproduced since then. It still sometimes takes 15-20 seconds for that first snapshot to refresh when I open the Home app, but it eventually picks up on its own, whereas before it wouldn't refresh no matter how long it was left there. I saw some other reports for other camera platforms and similar recommendations, so maybe worth a shot if you are still seeing this. |
It's also worth reading through https://github.com/dgreif/ring/wiki/Snapshot-Limitations if you haven't already. TL;DR - there are a lot of compromises and caching that we do for snapshot due to limitations both by Ring and homebridge/HomeKit. It's entirely possible there is a bug in there somewhere, but in general it's never going to perform perfectly. |
Is there an existing issue for this?
Describe The Bug
I have a Ring Doorbell and an indoor camera. After about a week, the snapshot for both stops updating. Restarting HomeBridge doesn’t fix this. Neither does moving the plug-in to a child bridge and restarting that.
The only work around I’ve found is to hide the cameras in the plug-in settings, restart HomeBridge (or the child bridge) and then unhide them and restart again. This fixes them until the problem occurs again.
I have cameras from Blink also using HomeBridge and don’t see this problem with them.
To Reproduce
Add cameras and wait
Expected behavior
Camera snapshots should update within about 30 seconds when open Home app
Relevant log output
No response
Screenshots
No response
Homebridge Ring Config
Additional context
HomeBridge seems to be using a cached version of the cameras. Hiding and unhiding them removes them from cache and refreshes them.
OS
Linux Homebridge (Raspberry PI)
Node.js Version
V18.16.0
NPM Version
9.5.1
Homebridge/HOOBs Version
v1.6.1
Homebridge Ring Plugin Version
v11.8.0
Operating System
Linux Homebridge 6.1.21-v7+
The text was updated successfully, but these errors were encountered: