Blynk lost Wifi connection / reconnect?

I wrote the following post:

I got all running now and was wondering what Blynk is doing once connection to my Wifi is lost (for example after Router Reset or Line reset of my Provider).

Do I need to worry about lost connections to Wifi or will Blynk.Run() check for that and reconnect once connection is lost?

For how long will it try? Will it give up or try forever?

In which interval will it try to reconnect (if so)?

Is there any Flag I can use in my software if Blynk can’t re-connect?

@Gorkde

  1. Yes you should find out why you are losing connection as it might disconnect at a critical time e.g. when the Timer widget is due to start or end. Can be difficult to identify the problem but normally comes down to flooding the server, power supply problems, bad coding or simply down to ESP’s as a WiFi shield is not an ideal system.

  2. Forever and unless you include code for this scenario it will stop your Arduino doing the tasks you asked it to do.

  3. Interval is 5 to 10 seconds.

  4. Flag is covered by Blynk.connected()

Thanks!

I dont loose connection now I was just wondering if I need to write some kind of reconnect routine.

I was thinking also about an automatic reset od the Arduino once no connection is mader for some 10 minutes or so. Regarding your reply I assume this wont make any sense right?

But you pointed sonething out I didnt even think of: Flooding the Server.
I got 16 sensors and was thinking of sending all or just 2 (lowest and highest value).

I want to send my sensor data regulary to the App.
How often can I do that without flooding the server?

@Gorkde limit is 100 req/sec per user. But have in mind that not all hardware able to handle such load :wink:

Resetting the Arduino with code might be required.

Dozens of sensors are not a problem. You are allowed 100 / 1000 transactions per second.

It is bad code like the following that floods the server and the server terminates your connection. Bad code isn’t normally as obvious as this example.:

void loop()
{
   Blynk.virtualWrite(V0, 1);
}

ok, another one…

I want to use the History-Graph.

How much data is saved an can be displayed?

I believe I can set it to multiple weeks, so for example sending sensor data every second would be a huge ammount over weeks. will it be saved or is there a limit also?

Do I need to make sure to only send every hour or so?
If so I would loose my short data which might be less than 10 Sec. and which I planned to show there.

As long as you stick to less than 100 requests per second then you can send as much data as you like to History Graph.

Thanks. Im amazed if thousands of User do 99 request per second that need to be stored that must be massive data to be stored!

If you look at the protocol used you will see the data size is very small.

Most users don’t send anywhere near 99 requests per second, maybe one every 10 or 20 seconds, some perhaps as few as a handful per day.

1 Like

@Gorkde yes. However as Blynk cloud is free we do not store every request. We aggregate data within minute interval. So in case you sent 6000 requests within 1 minute in DB only 1 average number will be stored.

@Dmitriy when did you abandon the Energy system?

:slight_smile: Energy is one-time purchase, so it is not a payment for server use. It is payment for widgets :slight_smile:.

I don’t think Blynkers look at it that way @Dmitriy. What good is a Widget without a running server? I know they can be used on a local server but If I’m not mistaken if you buy the Widgets for Cloud use they can’t be transferred to a local server.

Hopefully your Energy system has been worked out to cover costs of maintaining the widgets, developing new ones and running a cloud server.:slight_smile:

It is not :slight_smile:. And will never cover.

Ok, but then I got a problem. I want to send

a) Moisture sensor data
b) when my plants are watered

to compare it in History Graph.

When only one request per minute is stored but my water is only on for 3 seconds I will never be able to see it right?

What make you think so?

I assumed since if I send 10 LOW value per minute and only one is HIGH I assume I wont see it if you’re either taking one of them or calculate a middleed value of them.

@Gorkde what is your use case? What is 10 LOW values?

I want to water plants.

I do check 16 pots for wetness and do water them by 4 pumps.

I want to see the correlation of wetness to when the pumps are active.

So if my pump is off most of the time (for days) and then activated for some seconds could I see that?

You will send this data on different pins, so you’ll see all your data as you expect it to see. Just try :wink: