Page 1 of 9

Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 10:39 am
by jay (support)
I've written a small IWS plugin that will allow users to have a Refreshing Image URL redirect to the URL specified in an Indigo variable (see the Library Contribution for installation details).

To use this in a Refreshing Image URL on a control page, you specify the url:

Code: Select all
http://USERNAME:PASSWORD@localhost:8176/variable_url_redirect/redirect?name=VARIABLENAME


You substitute the appropriate information for the words in ALLCAPS. The username and password are the username and password for your Indigo Server as you specified it in the Start Local Server... dialog. You pass in the variable name (not the id).

Note: this plugin will only work with http/https URLs (not file URLs for instance) and doesn't support authentication in the URL that's stored in the variable value.

If you changed the port for the Indigo Web Server you'll need to use your custom port number. The above should work for most people though.

Note that you can also do this from a browser just by hitting the URL above.

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 11:25 am
by Different Computers
Holy moly!!

This is a big deal. Brand new? Jay you're the best. Glad I don't have a lot on my plate for this weekend so I can play with it.

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 12:33 pm
by jay (support)
I should note that the downside is that your Indigo Server password is stored in the clear (in your Indigo DB) since you have to specify it on the URL, so it's a bit of a security risk. I believe we have a more secure way of doing it coming in v7.1.

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 12:53 pm
by RogueProeliator
I believe we have a more secure way of doing it coming in v7.1.

Holy cow -- that was ALMOST an ETA post!

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 1:39 pm
by pocster
I will try this . Assuming it works ; amazing ! . Thank you so much !!!!

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 2:34 pm
by pocster
Struggling here.

Get error log :

http://localhost:8176/variable_url_redi ... MERA_IMAGE returned type text/html; charset=utf-8 (image required)

Variable CAMERA_IMAGE contains :
//Users/xxxxx/Desktop/video/Network camera/2017-07-28/28-07-2017 10-43-50 Network camera.jpg

So path to image is good........

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 2:57 pm
by jay (support)
That's not a valid URL, but even if it was a valid file URL this plugin won't work with file URLS, only network URLs.

With files, though, it's quite easy to just switch out the file (or change a symlink).

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 3:01 pm
by pocster
Ok ! I'm confused and mis using this .
So how do I specify a local file in the variable ? Or am I just doing this wrong !? :-/

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 3:04 pm
by jay (support)
As I said above, the plugin doesn't handle file URLs (URL's that point to local files on your disk). It only handles http/https URLs.

If you camera images are coming from a network source, then just insert that URL into the variable.

Otherwise, you'll need to write a script to swap out the image pointed to by the Refreshing Image URL (not using the plugin at all).

Re: Dynamic Refreshing Image URL

PostPosted: Fri Jul 28, 2017 6:54 pm
by mat
Thanks jay, been playing with this earlier. Perfect timing

Re: Dynamic Refreshing Image URL

PostPosted: Sat Jul 29, 2017 6:57 am
by pocster
OK!

I've got a bit further; but still somewhat confused.
I've set SecuritySpy to upload an image (Indigo and SS on same mac).

To access the refreshing URL in control pages I've tried (and many variations)

http://192.168.0.4:8000/image.jpg

But I get 404 - which is no file found.

SS has a server setup which seems recognised

So I guess I can't work out the correct URL for the image ...

Re: Dynamic Refreshing Image URL

PostPosted: Sat Jul 29, 2017 9:52 am
by jay (support)
I don't know anything about SecuritySpy, but I'd think they would have a separate URL for each camera. Maybe someone who uses it can chime in...

Re: Dynamic Refreshing Image URL

PostPosted: Sat Jul 29, 2017 10:05 am
by matt (support)
Instead of having SS upload an image, I'd suggest just directly accessing SS's built-in Web server. An example URL that you would stuff into the variable value would look like:

Code: Select all
http://ss_username:ss_password@192.168.0.4:8000/++image?cameraNum=1&width=320&height=240

(assuming you have authentication enabled on SS you can pass in the username/password as shown above)

Re: Dynamic Refreshing Image URL

PostPosted: Sat Jul 29, 2017 10:10 am
by Different Computers
Rather than try this and discover I misunderstand something, I thought I'd explain what I'm going to attempt and see if I have the right idea.

Install the plugin.
Create a variable called CurrentCam.
Get the URLs of my cameras on my LAN (though they could be from anywhere, I suppose.)
Create schedules that sets CurrentCam to the URL of each camera I want appearing on the Control Page I'll build. (Is there a better way to do this? Python scripting? I can't think of how to make one schedule rotate through changing variable values that aren't incrementing or decrementing.)
Create a Control Page that has a refreshing image URL of
Code: Select all
http://USERNAME:PASSWORD@localhost:8176/variable_url_redirect/redirect?name=CurrentCam

Enjoy my new rotating image.

And for other potential uses, questions: Could this be used for arbitrary valid URLs? If I inserted
Code: Select all
 http://forums.indigodomo.com/static/www/images/wordmark.png
as the variable value, would the refreshing image URL display it?

EDIT: I've got this working as above, but haven't tried to implement a schedule yet, as right now all I could figure would be to create a schedule for every cam that inserts its URL into the variable. Even so, this plugin is SUPER COOL.

Re: Dynamic Refreshing Image URL

PostPosted: Sat Jul 29, 2017 11:37 am
by pocster
matt (support) wrote:
Instead of having SS upload an image, I'd suggest just directly accessing SS's built-in Web server. An example URL that you would stuff into the variable value would look like:

Code: Select all
http://ss_username:ss_password@192.168.0.4:8000/++image?cameraNum=1&width=320&height=240

(assuming you have authentication enabled on SS you can pass in the username/password as shown above)


Yeah that worked fine . But I wanted a rotating image of each camera view - which is where the issues seem to be . As I can't use a file as a variable for the URL that's why I use SS to upload an image ; my theory was I could get a URL to that . Sounds convoluted method - but was struggling .....