Image Gallery

After some research I found Blynk HTTP RESTful API but I still have a problem… when I run this url

http://ip:port/auth/update/V5?urls=http://ip:port/Desktop/test3.png

nothing happens in the browser (and that’s good) but nothing happens in the app too…
I have tried the link with a button and it worked so the link isn’t the problem. I am pretty sure that the problem is the ?urls=url part. Is there a way to do it like “url”, 1, url instead of “urls”, url ??

that’s the second way that I found a solution for my problem, if you can make any progress for the first way(doing it via py script) it would be much more stable(I think) and helpful for me :slight_smile:
thanks a lot

@Smackflad I am unsure if any of my attempts are benefiting you, but here we go… It does seem that the provision for this new Widget is not fully formed in the API… or we are just missing the proper syntax.

For example, this API setProperty with ‘urls’ WILL work, but it actually erases all prior settings and only populates the initial image position [1] with whatever the final URL is… in my case 4.png

http://10.10.3.13:8080/280f6dd930f24473b2c9bdb139c84b7b/update/V4?urls=http://10.10.3.13:8000/awakish.png,http://10.10.3.13:8000/sleeping.png,http://10.10.3.13:8000/4.png

And again, (for me at least) the image is blank despite the url being correct.

The API setProperty ‘url’ just seems to be in error…

1 Like

Well for me the url doesn’t even change…
I believe that the best way to do It is by the py script.
Also I am 70% sure that because of the fact that the py blynk library is in Alpha there isn’t any setProperty and I am hoping that they will include it in the near future.
Do you have any inside connection with the py development team? Maybe ask them about it? thanks a lot :slight_smile:

@vshymanskyy :wink:

2 Likes

Got it :wink: will add soon.

3 Likes

Thank you :grin:

Hi Dmitry,

This is understandable, but… when we change the image, and click the Refresh button in the app at design time where we define the URL, surely the expectation is to flush the cache and fetch the image again? If, not what is the refresh button for?

I just updated 7 images that I use in an image gallery widget. No URL changes. 2 out of the 7 images have updated themselves. I have clicked the refresh on all 7 and I have tried editing the URL and setting it back again on one that won’t update to no avail.

furthermore, explicitly setting the urls via

Blynk.setProperty(V20, "urls", "https://s3.amazonaws.com/etc/etc");

also does not flush the cached images/

and the cache seems to be global too…

I added a new picture gallery to a new app, added one of the cached URLs, and it shows the old cached copy there also.

I have separately fetched the image via HTTP and verified it has been updated on the server.

I can provide the urls via private message. They are gif files hosted on amazon.

Please provide urls so we can check them. Maybe they are just not available. @BlynkAndroidDev FYI.

Yep, of course, we are caching them, so they wouldn’t be downloaded every time. Ill remove cache for images reload logic in the image widget settings, so it will be possible to refresh them after a change

1 Like

sounds great - thanks. That will resolve my issue.

For others, though, I am wondering if a “flush” command may also be needed, such as
.setProperty(V20, “flushcache”…);

If someone wants to view a webcam and they have some other script updating the image, they will need to be able to flush the cache from code…

or

a no-cache option in the widget.

Yep, there should be some cache option in the widget, for sure. We’ll think about that

1 Like

Yep, that’s a good idea to flush saved images on setProperty - I’ll implement it for nearest 2.27.2 release.

3 Likes

no news about image buttons widgets ? :thinking:

No new widgets at least during winter

1 Like

so, after the 20th of March :star_struck:
that’s a good news indeed Alexander !

is this for python? because I am not even able to use the setProperty in the python code…

FYI, I am not sure if the cached images invalided themselves after some days, or if you flushed them, but the new copies of the hosted files are now appearing in my app…
Flush/refresh still needed though… just adding the info that they did come right eventually.

It will be available in 2.27.2 beta soon, like you proposed in urls set property command or refreshing image in its settings.

3 Likes