Graph widget,update speed and data loss

I am using Blynk libraries on a NanoPi Neo (linux, 256MB ram) with app code written in C.

I am familiarising myself with the in’s and out’s of the various widgets and have come across an “issue” with the graph widget.

Briefly, my application sends a series of data to the widget and occasionally there is a data element that does not get through to the graph, To make it easy to spot, the data I am sending is a descending sequence: 200, 190, 180 … so it is easy to see if there is a problem.

Here’s a screenshot from my phone of correct behaviour:

and here is a faulty graph with 1 element missing:

You can see the step in the otherwise smooth descending data. You will also notice that the first element is not against the left-side of the graph. (There is also an “off by 1” error when the graph is first written, but we’ll save that for another time).
The data for the graph is shifted in from the right and you can see the single, lone,bar towards the right (element 28 when you look at the code) is in the same place relative to the screen - but the leftmost data isn’t. So there is 1 data element missing.

Next is the Blynk config for the graph widget:

and finally the code on the Linux board:
//#define BLYNK_DEBUG
#define BLYNK_PRINT stdout

#include <wiringPi.h>
#include <BlynkApiWiringPi.h>

#include <BlynkSocket.h>
#include <BlynkOptionsParser.h>

static BlynkTransportSocket _blynkTransport;
BlynkSocket Blynk(_blynkTransport);

int pirhits[]={200,190,180,170,160,150,140,130,120,110,100,90,80,70,60,50,40,30,
20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

// VPin 4 - PIR hits for graph

int main(void) {
time_t t;
int i;

wiringPiSetup () ;

Blynk.begin(“a8 … 49”, “blynk-cloud.com”, “8442”);

t = millis();

while(true) {
if((millis() - t) >= 60000) {
t = millis();
for(i=0; i < sizeof(pirhits)/sizeof(int); i++) {
if(i == 28) { pirhits[i] = random() % 200; printf(" Random value = %d
n", pirhits[i]); }
if(pirhits[i] > 200) { pirhits[i] = 200; }
if(pirhits[i] < 0) { pirhits[i] = 0; }
printf(“Graph: element % 2d: value: % 3d\n”, i, pirhits[i]);
Blynk.virtualWrite(4, pirhits[i]);
delay(500);
}
}

Blynk.run();

delay(50);

}

return 0;
}

The reason I have a 500mS delay between writing each element is that I have found
that with smaller delays, even more data is lost.
Any ideas would be gratefully received.

Pete

Hello. Thank you for reporting. At Monday we will make new release with bunch of fixes. This issue should be fixed in new version.