Continuous Refreshing URL Data Rate

Posted on
Fri Jun 02, 2017 6:36 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Continuous Refreshing URL Data Rate

If I have a control page image pointing to a jpg file that updates at an irregular rate between once per second to once per minute, does the "continuous" update option only reload the picture when it changes, or is it constantly repainting the image as fast as it can? If it IS constantly repainting, what's the "best practice" to get a reasonable response time when the image is updating at the once per second rate, but not waste bandwith when it doesn't update for several minutes?

Posted on
Fri Jun 02, 2017 9:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Continuous Refreshing URL Data Rate

Continuous just loads as often as it can (though it will be throttled if you're connecting via the reflector - see below for details). This is normally not a good way to go unless you only use the page while you're on the same local network with your Indigo Server. There's also no way for the server to "push" the image to the control page, so the control page doesn't know it's changed. Best practice is to load the image as infrequently as is practical for your usage. If you're looking for near realtime updates then you'll probably want to look at another solution that connects directly from your iOS device to the thing providing the image (either directly to the source camera or through SecuritySpy for instance).

In order to maintain security while keeping users from having to muck about with router firewall settings, Indigo Touch and the reflector system must route all traffic through our servers when connecting over the internet. We can't allow high-bandwidth data (live video or frequent image updates) or we wouldn't be able to afford to provide the service without significantly increasing the cost.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Jun 02, 2017 9:55 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Continuous Refreshing URL Data Rate

jay (support) wrote:
We can't allow high-bandwidth data (live video or frequent image updates) or we wouldn't be able to afford to provide the service without significantly increasing the cost.


And with the data cap on my satellite uplink, I can't afford it either, which was why I asked the question. And I don't see any way to set up a control page to "update only on command" trigger even if I set up a script to monitor a change in the modification time of the file... any possibility of adding that option as an enhancement to the refreshing URL? It could cut your data rate in those cases where folks are using externally triggered (ie door opened; driveway alert triggered; motion detected, etc) events to do a quick one shot data grab from an IP camera rather than spending the time, money, and effort to set up and maintain something like Security Spy?

EDIT...

Would there be a way to make it a Static image and issue a "Reload page" command from the script?

Posted on
Fri Jun 02, 2017 10:11 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Continuous Refreshing URL Data Rate

Unfortunately, I cannot think of any type of workaround that would work with the current limitations. However, we do have some items on the wish list for refreshing images that should address this.

Image

Posted on
Fri Jun 02, 2017 10:25 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Continuous Refreshing URL Data Rate

Bkmar offered a suggestion on how to do this with his Security Camera plugin--the short version is that the cameras are off until you order a snapshot from the control page, which the control page then displays.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Fri Jun 02, 2017 11:27 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Continuous Refreshing URL Data Rate

Different Computers wrote:
Bkmar offered a suggestion on how to do this with his Security Camera plugin--the short version is that the cameras are off until you order a snapshot from the control page, which the control page then displays.


That's actually what I am using currently to generate the jpgs (Copying CurrentImage.jpg to my own directory upon trigger with a script) but the problem is that as soon as the web page opens, it repeatedly downloads and displays the same image at a fixed rate as long as the browser is looking at it; What I'd like to see is having an external trigger save the image and then immediately order the Control Item to refresh itself, then leaving it as a static display so I can look at it until either the trigger updates it again or I navigate away... As is, I either have to set it to update once a minute and wait for it even if the trigger fires a few seconds after I open the page, or order it to update every second and get 60 quarter meg downloads per minute of the same picture.

Posted on
Fri Jun 02, 2017 12:11 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Continuous Refreshing URL Data Rate

Here is a convoluted idea that doesn't 100% solves the problem but would help.

Save two versions of the file one at high resolution and one at extremely low resolution.

Create a symbolic link that points to the low resolution image. Refresh the symbolic link file every second.

Create an action that, when clicked, changes the symbolic link to point to the high resolution image, waits a few seconds, and the switches back to the lower resolution.

Result: low resolution, and therefore less data, is uploaded every second. When you actually want to see the higher res version you click on the image and it uploads the higher res version and then switches back.


Sent from my iPhone using Tapatalk

Posted on
Fri Jun 02, 2017 1:10 pm
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Continuous Refreshing URL Data Rate

bkmar1192 wrote:
Here is a convoluted idea that doesn't 100% solves the problem but would help.

Save two versions of the file one at high resolution and one at extremely low resolution.

Create a symbolic link that points to the low resolution image. Refresh the symbolic link file every second.

Create an action that, when clicked, changes the symbolic link to point to the high resolution image, waits a few seconds, and the switches back to the lower resolution.

Result: low resolution, and therefore less data, is uploaded every second. When you actually want to see the higher res version you click on the image and it uploads the higher res version and then switches back.


Sent from my iPhone using Tapatalk


Actually, I think that a simpler version of that would actually work; I'll create a lowres page with a 1 second refreshand a highres page with as long a refresh time as possible and an action on the lowres page whien clicked to GoTo the highres page which will have an action to return to previous page upon click.. That way I'll get a rough image that might be only a few K updated every second, and a static 1080x768 whenever I click on it. Won't work for your Carousel though; I'll still have to set up all mu cameras as a mosaic of the lores images rather than a cycle through.

Posted on
Fri Jun 02, 2017 1:42 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Continuous Refreshing URL Data Rate

I thought of that too but depending on the page it would pull down extra data when you click on the high res version of your control page.

Btw: You can set each camera to different image quality so you could have a high res version and a low res version of the same camera. You'd increase the processing on your computer but it would allow you to use the carousel - one that rotated through the low res and one that looped through the high res.

How many cameras do you have?


Sent from my iPhone using Tapatalk

Posted on
Fri Jun 02, 2017 2:02 pm
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Continuous Refreshing URL Data Rate

bkmar1192 wrote:

Btw: You can set each camera to different image quality so you could have a high res version and a low res version of the same camera. You'd increase the processing on your computer but it would allow you to use the carousel - one that rotated through the low res and one that looped through the high res.

How many cameras do you have?


Sent from my iPhone using Tapatalk


Six cameras, soon to be 8 once the garage is completed by the end of the summer; And I am already using the size reduction to bring my native 1920X1360 camera resolution down to 1080X768 in order to make the images small enough to send to Prism, so duping them all to 135X96 will be just Duplicate/change name and settings exercise. And then create all the control pages; Since changing the page is a one shot if I've got a 1 or 2 minute refresh, I doubt it wild be anywhere close to the 300K image download.

Posted on
Fri Jun 02, 2017 3:21 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Continuous Refreshing URL Data Rate

There is another option, but it has it's own issue. In brief, rather than using a refreshing image URL, you use a variable and the image selection heuristics. The problem with this approach is that it's going to cause your image cache in IT to grow. With IT 2.1 (to be released soon) you can clear the cache when size becomes an issue (and it will eventually will).

This approach assumes that your Mac can somehow know when an image updates. Setup looks something like this:

  1. Create a variable that will be used to select the image, say "dynamic_image".
  2. Create an image as the base image which is the same size as your standard images. Save it as "dynamic_image+.png" (or similar) in the variables directory discussed in the image selection link above.
  3. Open your control page editor and place a Variable page element, select as image and select "dynamic_image+.png" from the image list

That should be all you have to do in Indigo. Now the tricky part, because it's quite specific to your setup. When something on your Mac notices that there's a new image, then you would need to do the following:

  1. Rename the image to "dynamic_image+XXXX.png", where XXXX is a unique identifier that you won't be reusing (at least for a while - see caching problem above).
  2. Move the file to the variables folder discussed in the image selection link above.
  3. Change the value of the "dynamic_image" variable to XXXX (whatever unique value you come up with)

The variable change will force IT to get the "dynamic_image+XXXX.png" from the server (because it's an image it's never cached before because XXXX is unique) and display that. As you can see, the image cache will continue to grow (we never automatically empty images used to represent variables or device states because we don't expect them to be dynamic) until you manually delete the cache. This might be OK though if the images aren't that large, it may take a while before it becomes a problem.

So, if you really have a big issue with bandwidth while you're not on your local network, this might be a better approach even though it would mean periodic cleanup. I wouldn't use this approach myself because I'd forget about manually clearing the cache then when my iPhone started having issues it'd take me a long while to figure out what was going on. But that might be a reasonable tradeoff for you.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 05, 2017 5:21 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Continuous Refreshing URL Data Rate

Actually, I implemented Bert's solution over the weekend and it works pretty well. I use his Security Camera plugin to reduce the raw 670 K camera 1920X1365 snapshots to HiRes 350K 1080x768 AND 5K 135X96LoRes images on a second by second basis and have a control page showing All the LoRes images on a 1 second refresh, which can be easily served even over the slow internet connection. Tapping on any of the thumbnails advances to a new control page that serves the 1080X768 image for that particular camera on a 4 second basis (as fast as the sat upload can handle) for a short term detail look; tapping on that image returns to the prior control page. The plugin also allows me to archive 30 seconds of the 1080X768 when an external trigger (driveway alert, motion sensor, or door switch) fires while no one;'s home and each of THOSE images has their own control page on a one minute refresh linked to advance through the sequence on tap... it's a lot of control pages even when arranged in a dozen folders (nested folders sure would be nice in this case, hint, hint), but it DOES work, and I haven't seen any of the "Touch grows out of control" problems that others have, although I admit I haven't really stressed the video options.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests