Giter Club home page Giter Club logo

Comments (31)

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware that is a really interesting issue! I assumed they were keeping every version up-to-date on firmware since they have so many for sale, but it makes sense that they would let the first gen slide a little. A couple things I need before I can implement a fix:

  • Is this snapshot issue documented anywhere? I haven't seen anything about this in the existing ring codebases that I dug through while writing this one.
  • I need to know the kind value for that older model. You can find this in the Model field if you open the settings for the camera in the Home app.
  • A screenshot of what it looks like when it stops responding, just so I can make sure it's different from the live stream not responding.
  • What do you think we should do when it fails to fetch the new snapshot? Keep trying for 10 minutes, or just display the previous snapshot?

from ring.

OABsoftware avatar OABsoftware commented on May 24, 2024

To answer your questions:

  • I don't know if the max of 1 snapshot per 10 minutes is documented anywhere. What I do know is that I see the same behavior in the Ring app: it won't show a recent snapshot until the previous snapshot is at least 10 minutes old.

  • The kind value is "doorbell_v3".

  • Hmm, I already made a number of modifications in the code, so taking a screenshot is a bit difficult now. But trust me, I understand the difficulty of converting a SIP stream to an RTSP one :-). We're talking about the snapshot here.

  • I changed the implementation of the refreshSnapshot() method to this:

            const timeLatest = new Date().getTime() - 10 * 60 * 1000;
            var timestamp = yield this.updateTimestamp();
            var attempt = 0;
            while(timestamp > 0 && timestamp < timeLatest && attempt <= 15)
            {
                attempt++;
                yield util_1.delay(1000);
                
                timestamp = yield this.updateTimestamp();
            }
            return timestamp;

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

same here

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware I modified the refreshSnapshot method to try for 10 minutes for doorbell_v3 devices. I debated for a while about going with the approach you have above and decided against it. My goal is to make sure that the timestamp you see in HomeKit is accurate to when the snapshot was taken so that users can be confident they are seeing an accurate image. If we simply return after 15 attempts without erroring, an outdated snapshot will be downloaded from Ring, but will be displayed as current in Home. With my approach, the snapshot will update when it is able and will always have an accurate time marker in HomeKit. I'm happy to discuss further if you think my approach is incorrect. Otherwise, please give v3.2.2 a try and see how it works for your device. Thanks for letting me know about this issue, and for the detail on what's causing it!

from ring.

OABsoftware avatar OABsoftware commented on May 24, 2024

@dgreif I agree it's better that the user sees a valid age of the snapshot in the Home app.
But in the current implementation (version 3.7.0) I only get a fresh snapshot in the Home app once every 30 minutes...

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware @divemasterjm I really want to get you guys the best fix for this that I can. The camera itself is limiting how frequently new snapshots can be taken. Would you prefer I always hand you the latest snapshot, even though the timestamp in Home won't match when it was actually taken? I'm open to any other suggestions...

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware @divemasterjm give v3.7.1 a try. I have it set to try for 5 seconds to get a new snapshot, falling back on the stale snapshot if that times out. Sorry I don't have a better solution, but this is definitely a drawback of that particular camera model.

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

It works!!!, now the user experience is much better, thanks for your help. I didn’t try rich notifications yet.

from ring.

OABsoftware avatar OABsoftware commented on May 24, 2024

@dgreif Yes, this works. But 5 seconds is a bit short, e.g. if you have a low bandwidth internet connection (like I do).

from ring.

divemasterjm avatar divemasterjm commented on May 24, 2024

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware I was fairly intentional about use 5 seconds because I wanted it to fail fast if there is no new snapshot. Every second that it waits for a new snapshot is another second that HomeKit waits to send out the notification for motion/doorbell press because it is waiting for the snapshot. I could have it wait 15 or 20 seconds, but that means your notifications will be delayed that long if there is no new snapshot available. Does that make sense, or do you think it would be worth it to wait a little longer in case it is in the process of uploading the snapshot? If we wait, how long is reasonable?

from ring.

OABsoftware avatar OABsoftware commented on May 24, 2024

@dgreif Well, as I wrote earlier, I'm on a rather low-bandwidth internet connection (8 mbps down, 800 kbps up).
Your (great) plugin hammers the Ring dings/active service every 5 seconds to check if the doorbell was pressed (and indeed, that is the only way to find out).
If it was pressed, the plugin sends a request to the Ring servers to tell my doorbell to upload a snapshot.
In my situation the snapshots/timestamps service gets called at least 5 times before a new snapshot is available (I modified your code so that the service is called once per 1000 milliseconds instead of 2000).
And than that snapshot is downloaded by the plugin and uploaded again to APNS.
So, before I see the snapshot in a notification on my phone, it is at least 10 seconds old.
In my opinion adding a few seconds more is not too much of a problem, because the snapshot is (too) old anyway.

I also see something else happen.
When the doorbell is pressed, I first receive a text-only notification from my Home app, and a couple of seconds later that notification is replaced by one that includes the snapshot.

You could add a optional configuration item in which the user can specify how long the plugin should try to get the snapshot.

from ring.

rgerr avatar rgerr commented on May 24, 2024

To be clear, this ‘10 minute snapshot’ issue, is only on the first generation Ring doorbell? I currently have the first generation, but want to receive snapshots on my iPhone when the actual Ring button is pushed.

from ring.

dgreif avatar dgreif commented on May 24, 2024

It’s an issue on all battery powered cameras (see #64 for more detail on that). I released an update last night that should cover all of them. It’s possible you are on one that wasn’t assuming slow snapshots for your model

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware I rewrote the logic around snapshot timing and it should work much better for your situation now. If the current snapshot is < 10 minutes old, it will be used immediately without waiting for a new one at all. If the current snapshot is > 10 minutes old it will wait ~30 seconds for the snapshot to update, falling back to the stale snapshot after that. Give it a try with v4.0.7

from ring.

rgerr avatar rgerr commented on May 24, 2024

Is this also the issue with newer Rings?

from ring.

dgreif avatar dgreif commented on May 24, 2024

@rgerr can you be more specific? The new Ring Door View Cam is battery powered, so it has 10 minute snapshot refreshes.

from ring.

rgerr avatar rgerr commented on May 24, 2024

I have the Ring doorbell, first Version (doorbell_v3) hardwired. So it is not on battery. How does the snapshot interval work in that case?

from ring.

dgreif avatar dgreif commented on May 24, 2024

@rgerr that is a great question! All of my cameras as wired only so I haven't been able to test it out. Could you try opening your Ring app periodically and seeing how frequently you can get snapshots from that camera? Just open the app and look at the camera photo, without going into live view. It will either be every 30 seconds that it refreshes or 10 minutes, so it should be pretty obvious.

from ring.

rgerr avatar rgerr commented on May 24, 2024

I will try this out later today, thanks for the tip. Another question, will the experience be better with a Ring 2 doorbell? Faster snapshots e.g.?

from ring.

dgreif avatar dgreif commented on May 24, 2024

The Ring Doorbell 2 has a battery as well, but can be hardwired. I'm guessing it will function the same as the regular Doorbell. I have a Doorbell Pro, which can only be hardwired, and it has 30 second snapshots. I am really interested to see what you find with the hardwired Doorbell, thanks for looking into it!

from ring.

rgerr avatar rgerr commented on May 24, 2024

Definitly not a 30 sec interval on the original Ring with snapshots. Checked it for over 15 minutes and it updates only once, after the suspected 10 minutes, unfortunatly.

from ring.

dgreif avatar dgreif commented on May 24, 2024

@OABsoftware @rgerr how have snapshots been on your battery cameras? If everything seems good we can get this issue closed

from ring.

rgerr avatar rgerr commented on May 24, 2024

As mentioned above, once every 10 minutes. Too bad. :(

from ring.

dgreif avatar dgreif commented on May 24, 2024

@rgerr unfortunately I can't make them refresh more frequently. My main question is whether or not the are showing up reliably (even if they are stale by a few minutes)

from ring.

rgerr avatar rgerr commented on May 24, 2024

No, not so much. Probaly 50% of the time I get a snapshot, and half of the time it is a old snapshot. The connection should not be a problem, i have 100/100 down/up and the Ring doorbell is 2m from the nearest access point. Also, I completely turned of the motion detection so that Ring will not update the snapshot when motion is detected. Therefor it should only update when the doorbell is pressed. But as I mentioned, snapshots hardly come through. And when they do, they’re not from when the actual doorbell was pressed.

from ring.

dgreif avatar dgreif commented on May 24, 2024

@rgerr give snapshots a try in v4.3.2. They now return immediately for battery cameras so they will most likely always be stale, but they should show up 100% of the time. Let me know how it works for you.

from ring.

dgreif avatar dgreif commented on May 24, 2024

I think I have the snapshot logic as good as it can get for now. If anyone has spefic feedback, feel free to open a new GitHub issue. Thanks everyone who tested out my updates along the way!

from ring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.