Blynk.setProperty() not correctly responding to color variables - at times

I am a little hesitant to bring this up again, as it was difficult to get acknowledgment of the initial issue and the past “resolution” now appears to have been more chance related.

However I have more data :slight_smile: The issue seems linked to use of a variable vs. direct #HEX input.

i.e. (With V9 being a Value Display) This…

Blynk.setProperty(V9, "color", "#0000FF");  // Hasn't failed yet.

…works. But this…

String HEXstring = String("#0000FF"); 
Blynk.setProperty(V9, "color", HEXstring);  // May or may not work!!
Blynk.setProperty(V9, "label", HEXstring);  // Will always display the correct HEX string...
Blynk.virtualWrite(V9, HEXstring);  // ... as will this always display the correct value.

…tends to just stop changing colours for no apparent reason… but in a few days, it will likely start working as normal, with no changes to related code.

And the issue even oscillates between to different projects on different hardware… sometimes works on one but not the other, or works/fails on both. Very random.

PS, I am always updating to the latest, app, library or Local Server… so not sure if issue resonates with these updates.

Try HEXString.c_str(), I’m not sure if the Blynk libraries are handling the String object well. I wish that for color one could use a uint32_t or uint8,uint8,uint8 r,g,b version of the setColor method.

HEXString.c_str() didn’t even compile :wink:

Be aware the HEXsring is just the name of the variable… so I could remember that it needs to be a string, but in #RRGGBB format as required by Blynk.setProperty() for colour.

You don’t need .c_str() - it should just work.
This is probably an App issue is it iOS or Android?

Android - Nexus 6 ver7.0 and Samsung Note8 ver4.4.2 both running Blynk ver2.7.1

I have found that the issue can sometimes be affected by decreasing or increasing the BAUD rate that is used in the USB link… so there is clearly a timing factor involved; probably also dependent on the amount of active widgets and whatever else I am running on the boards.

Unfortunately, I am unable to use any other form of communication between my various arduino boards and my local server. My Ethernet shield was flaky and finally failed altogether, and I haven’t yet experimented, let alone mastered, RPi or C.H.I.P. as Blynk controlled devices (they have Ethernet and WiFi capabilities respectively).

I am currently stuck with the toys I have, so any suggestions or further tweaks to the USB link and/or other timing factors is greatly appreciated.

@Gunner KISS for you. Just try to keep things simple until you have decent hardware. Don’t send too many virtualWrite /setProperty commands in close succession etc.

I suspect it may be your Arduino that is struggling and you should look into ESP’s.

I spent the last couple of days working with the Pi as the MCU (and server) and even though my java skills are basic I was pleased with the outcome. Might be useful for your camera snapshot implementation as it doesn’t require a webserver like our ESP implementation.

Might not be too useful for me as we don’t have port forwarding available but for others it should be useful.

My CHIPS are now less than 2km away. Off to pick them up this morning.

Edit: That should have read Omega2 and 2+'s not CHIPS, which are slightly different.

Good Mornign Costas. I received mine two hours ageo (Omega2, Omega2 plus). Let’s see what will do with them!

1 Like

Hi @mikekgr I was just going to correct my posting. For some unknown reason I keep thinking they are CHIPS but as per your delivery they are also Omega2 and 2+'s that I am picking up. Similar but different.

I remember from your older posting that you are waiting for omega2… !

Glad you remembered @mikekgr as I think i’m losing the plot :slight_smile:

Cheeky… we hardly know each other :stuck_out_tongue:

Seriously though, I know… I have been focusing on cramming as many different operations together as I can… mainly so I can practice managing and manipulating the code… and watching all the blinky colorfulness doesn’t hurt either (easily amused am I) :smiley:

Having not dug through the specs, isn’t an ESP just an arduino like device with built in WiFi? Not a clone per-say, but same clock speed and all? I will have to look into the specs.

I don’t think I have run out of horsepower, yet, on the hardware side, as tweaking the BAUD rate can get things running smoothly, despite the bloat (and I still have a Mega, being ignored for now)… it was just frustrating until I discovered that fact about the BAUD rate… always had it as high as I could, not understanding how that can effect, or be effected, by internal timers and interrupt issues.

But that is what learning is all about I guess :)[quote=“Costas, post:9, topic:10889”]
keep thinking they are CHIPS
[/quote]

Too bad… I am starting to think I always pick the wrong hardware to experiment with… I have a near useless Light Blue Bean and three C.H.I.P.s (one installed in the PocketCHIP case)… and no one seems to be using any of them with Blynk?

Having seen your video @Gunner you certainly have plenty going on with your hardware.
ESP’s were designed to connect to the internet, Arduino’s weren’t.
One big difference is the size of the memory on ESP’s and some Arduino projects fail as they run out of memory. That said the ESP’s do have all the WiFi stuff to do but when you add internet access to an Arduino, it does too (Ehternet, USB, WiFi shield etc).
I thought you were using the MEGA. If you are not then you are using an even weaker MCU.

Good point… Over the years, my focus has generally been controlling things, not communicating over the internet to things… I have been using Blynk more as a master control panel to facilitate that use, and it works great for that as well :slight_smile:

I did use it for the video… then I started working on cramming all that functionality into the Uno… and even a ProMicro… yup, I just gotta to do things difficult like :stuck_out_tongue: