Spikes in Virtual Pins

Hi all,

I have a VirtualPin attached to a Superchart. In my IDE scketch, the value of the variable, which is float type, is converted to int when is sent to Blynk:

Blynk.virtualWrite(V1, int(PotenciaFV));

The value of the Variable (PotenciaFV) is limited to 30000 in the arduino IDE, son no higher values could be stored in it.

Well, from time to time, I have spikes in my superchart, always with the same value (357920000). Any idea why I’m having these spikes?

Big spike… no wonder you are running out of space on your chart :stuck_out_tongue:

Can you post the full code here… there might be something else causing the value to go beyond whatever method you are using to limit the value.

Blynk - FTFC

Here is the code related to that variable calculation. I added the fourth line when I had the spikes for the first time,. thinking that it could be a problem with the modbus reading, but I got the spike again yesterday, so not solved.

PotenciaFV = 0;
pun.ModbusInt = ((uint32_t)regs[4] << 16) | regs[5];
PotenciaFV = pun.ModbusFloat;
if (PotenciaFV >= 30000){PotenciaFV = previousPotenciaFV;}
previousPotenciaFV = PotenciaFV;
if (PotenciaFV >= PotenciaFVMaximoDiario) {PotenciaFVMaximoDiario = PotenciaFV;}

Blynk.virtualWrite(V1, int(PotenciaFV));

Your chart shows the spike at 3000… or I guess that is the max range you have? So, where are you seeing this rather large number? is that variable only used in this little code snippet you have shown?

Really need more info here.

3000 is the maximum range of the chart. I can check the value of the spike just exploring the data when continues pressing the screen.
The whole code is quite large, but I don’t manipulate that data in the rest of the code, for sure. In any case, I will double check and come back.

A simple IDE search for the variable PotenciaFV will make the check easier.

EDIT - Find (CTRL-F)

@Jomugu @Gunner I too have experienced this problem with a DHT22 temp humid sensor…my fix was to connect that paticular esp to another wifi access pt.

I guess my point here is that the data spike is coming from the sketch in some way, and not a likely a fault of the chart.

And was it solved? So do you think is a connection problem?

@Jomugu I don’t know what the exact problem is…it may very well be signal strength. It’s worth trying if you have an AP or even if you have an old wifi modem/router around you can put into bridge mode and connect it to your existing network as a wifi extender. Oh…and yes it has solved my problem. I haven’t had a spike since.

1 Like

Thanks a lot

Guys… the chart is pulling hard digital data from the server, even a poor WiFi signal will not cause a ‘spike’ … this is not a noisy analog scope here :slight_smile:

@Jomugu Did you find any further references to that variable or even the V1 and for that matter, do yu have anything on the App itself, like Eventor that might be triggering the V1 pin? It is possible to have shared vPins with a chart.

It’ll be good to see if @Jomugu did try a different AP to confirm whether its a fix for the problem.

I’m using Ethernet with a 3/4G modem, with no option to test with any other one by now.

For sure the variable is limited in software, and Virtualpin is only used with Blynk.