First, your image needs to be available to the App via whatever network it connects to. You can use whatever URL you need and as long as the Widget sees it, it should work.
For example: On my Local Server I use SimpleHTTPServer and run this in my /etc/rc.local
cd /home/gunner/Blynk/images/
sudo python -m SimpleHTTPServer &
Then I put all my wanted images in the server’s Image folder .
In the App, I point to said file location as such (currently only visible when inside my network)…
Then I can change which image I want shown via code like this…
Arduino/ESP code:
BLYNK_WRITE(V4) { // Button widget on V4
if (param.asInt() == 1) {
Blynk.virtualWrite(V3,1); // Show image 1 - Widget on V3
} else {
Blynk.virtualWrite(V3,2); // Show image 2 - Widget on V3
}
}
Python code:
@blynk.VIRTUAL_WRITE(4) # Button Widget on V4
def my_write_handler(value):
if int(value) == 1:
blynk.virtual_write(3,1) # Show image 1 - Widget on V3
else:
blynk.virtual_write(3,2) # Show image 2 - Widget on V3
As of yet, or at least as far as i have tested, there is no way to send the image URL directly from the script, or to populate the Widgets image collection from the script. So far it must be all manually entered in the App… but then it is still in Beta

