Hello,
could you recommend me any way, how to update a lot of data (i.e. after push button - reqest)? I have probably problem with flooding, since I’m uploading a lot of data in short time… Easyest way will be to add delay(1000); after each single Blynk.virtualWrite command, but it is not recommended…
Just few a days? Let’s say 5 times…
The amount of data is not so huge (measured per day or hour). But I’m not able to push all the data at the “same moment” - from the point of Blynk server. I think, that this is a problem of fooding prevention on server…
Regarding ESP core library version, I’m not sure now, I have to check it later.
Ok, sorry guys. It’s matter on device, you have convinced me.
Is there any published limit, how many data can I pass to Blynk server in one minute or so? Is there any difference on the way? I mean from device - to blynk server and/or from blynk server - to android?
The most of my variables are 4 bytes, either long or floats…
Yes it’s in the docs that Blynk prepared, no more than 100 commands per second but each MCU also has it’s own limits. Most Blynkers are using Arduino ESP libraries that are over 12 months old. With these libraries any more than about 4 consecutive virtualWrite() commands will crash the ESP. With the new libraries this is not an issue but there will still be a limit.
Ok, thaks for advices.
First of all I’ll try to update library. Then I can try increase BLYNK_MSG_LIMIT. Em I right, that does not matter on the type of variable? It’s counted just per request (I mean at Blynk server side)?
But, back to the programming issue, do you have any suggestion how to pass/send all of the request with delays between them? I mean somehow easily, by elegant way?
The V for Virtual is not actually required, although I generally use it as it avoids confusion with digital pins.
If you were to structure your project so the 20 widgets were numbered 0 to 19 and put the data for each in an array then this should work.
for(int i = 0; i < 20; i++){
Blynk.virtualWrite(i, DataArray[i]);
delay(10);
}
Delay()?!?
If it is allowed, I can add this to my sketch like this
void updateStatisticData() {
Blynk.virtualWrite(V11, t1min);
delay(10);
Blynk.virtualWrite(V12, t1max);
delay(10);
Blynk.virtualWrite(V13, t1avg);
delay(10);
But I was wondering, if there is any elegant use of timer instead of delay
I’m sure there is but experienced Blynkers don’t normally send 20 variables at a time.
Another sample for you. Extract from the end of setup() onwards:
timer.setInterval(2000L, updatetwenty); // 1s gives flood error
}
unsigned int sliderValue = 0;
void updatetwenty(){
for(int i = 50; i < 70; i++){
Blynk.virtualWrite(i, millis());
delay(sliderValue); // i.e. no delay but you can test with a slider
}
}
On a decent ESP with latest Arduino ESP core gives:
My program runs automatically and there is no need to upload all of the statistic data to the server, just 4 of actual values for graphs. But, when I start the control app, I’d like to see all available data. I dont want to update them regulary, since I need to keep data traffic as low as possible. So I’d like to send them just on reqest. BTW, I changed float variables to int, in order to save a few bytes. But, as I saw in docs, all data are send as string? So the only way, how to reduce amount of transfered data is to cut unnecessary decimal places? Right?