Programm disconnects dozens time a day

@elibt Welcome to the Blynk Forum.

First, I fixed your posted code formatting… please use this method, as required in the pinned topic that you should have read at the beginning: Welcome to Blynk Community!

Blynk - FTFC

Secondly there is entire sections (links at top of this page) one of which is called Help Center that has answers to many common questions and issues like you are running into

Here is a brief excerpt from one:


Avoiding the void

:point_up: :fire: :warning: VERY IMPORTANT: You can’t send sensor data in your void loop()

– Why?
– Because Blynk sends data over the Internet, and when you put something into void loop(), your microcontroller will execute it :scream_cat: gazillion number of times. Which means that Blynk Cloud will be flooded with gazillion messages from your hardware.

And when Blynk Cloud notices that, it automatically :scissors:︎ cuts your connection. Sorry…

– OK, what should I do then?
– Send sensor data in intervals!

Using timers to send sensor data in intervals

There are lots of ways to send data in intervals, but here is a simple one. We recommend using a BlynkTimer for that. It’s included in Blynk Library Package, so if you installed Library correctly, you are all set.


http://docs.blynk.cc/#blynk-firmware-blynktimer

1 Like