Blynk struggles? Check the frequency of updates

Hi all.

I finally seem to have cracked the use of Blynk with a Mega and an Ethernet shield. I have a lengthy script and was finding that Blynk was responding to some Blynk code, but very slowly i.e. several seconds after the event. I also had only 2 Blynk virtual pins working and the remainder were not updating even though my code was the same.

What I finally found was that my loop was updating these 2 pins through every iteration, leading to a high volume of updates that were presumably leading to a flooding and thus disabling the receipt of data from the other virtual pins. Once I amended the code to call these 2 pins periodically, the other pins started to be received too.

So if you see long latency or delays or see only some pins responding, check these pins aren’t being updated too frequently.

Hope my learnings help others. Thanks, Blynk guys, for a fantastic solution!

Glad you found it out for yourself.
However, we’ve provided example sketch, where it was described. :wink:

I was about to reply that the converse is also something to be aware. Make sure you’re you’re not flooding with traffic, and make sure you’re not starving behind the scene tasks. Ensure you’re calling frequently. I don’t know how frequently, I’d guess it depends on the amount of work needed to be handled on each pass. I can see some timeout to be pretty big (15s or so), but bad connectivity happens long before that, depending on work to be done and run() frequency. I have no formula or rules of thumb yet.

Yes, that sketch is what gave me the idea to check this.

My point is that there was no obvious way to see that this was happening. The Blynk app does not show that data has been throttled due to flooding. You just see partial responsiveness.

When I first started with Blynk, I managed to get the debug to Serial to work and that showed flooding there (although this has not worked recently, but I have not had time to focus on why that was the case). But if you can’t keep a laptop connected, then this information is not available.