I’ve got two ESP devices connected to the same project.
One was an original ‘hello digital pin’ type thing, and isn’t really doing anything other than pushing a variable that contains the temperature, and responding to a write request on a digital pin defined in the App/Button. It’s fat and happy (or skinny and happy, see below).
The other device is where I’m adding code, sensors-reads from various internet snippets, some with nastier than not delay() calls. I clean up the code, states instead of waits n-stuff, but I’ve noticed Blynk disconnects, I’m assuming disconnects since I see frequent (2-5 in a 10 second span):
[23140] Connecting to cloud.blynk.cc:8442
[23259] Ready (ping: 4ms).
I think my device-wifi->router connection is good enough, but who knows what the full path looks like from devices to Blynk server.
I’ve also noticed that if I reduce/eliminate the code delay() calls, or call Blynk.run() from inside a particularly slow piece of code, along with calling it inside of the main loop(), the disconnect/connect issue goes away.
I only noticed any of this when I saw the app<->device reactions were getting lost or sluggish. Seemed to correlate to the disconnects.
So, what’s the approach? How often does the device need to call run()? How much time can pass before a re-connect is initiated? Which side initiates it? Anything else cause disconnects, or is notorious for temporary sluggishness?
Thanks!
ko
And yeah, being lazy here, I should grab the server side, locally deploy so I can see/control/contribute to both ends (day job priorities though).