BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

More than 4 Blynk.virtualWrite ESP8266 re start to connect

Hoi

I am busy to extent my arduino nano weather station to Blynk. I have 14 values to display for now. Ik extent my nano with ESP8266 12E Dev kit.
and via Serial i receive the data in json string at the ESP al this is tested before started with blynk work oke.

The code as show below works until i enable the 5the Blynk.virtualWrite statement in the code. Then my connection on the ESP constantly restarting and also a stack dump i think.

What do i do wrong?

Chris

stack>>>

ctx: sys
sp: 3fffed90 end: 3fffffb0 offset: 01b0
3fffef40: 00000000 3fffdad0 3ffeeddc 40204fb5
3fffef50: 3ffe9080 40000f49 3fffdab0 40000f49
3fffef60: 40000e19 40001878 00000002 00000000
3fffef70: 3fffff10 aa55aa55 000000b2 40104c60
3fffef80: 40104c66 00000002 00000000 402162b4
3fffef90: 4010000d 40217720 00000064 40216fc0
3fffefa0: 40100c00 3fffef3c 40100bad 3ffff2e8
3fffefb0: 00000000 00000000 00000020 4010175e
3fffefc0: 3ffe9010 40104b3c 3ffec8e8 feefeffe
3fffefd0: 00000001 40103d5f 3ffed190 feefeffe
3fffefe0: 401041c2 feefeffe feefeffe feefeffe
3fffeff0: feefeffe feefeffe feefeffe feefeffe
3ffff000: 40103ca6 0000002b 7fffffff 00000000
3ffff010: 0000012b 00000000 3ffe9161 00000008
3ffff020: 40102b27 00080000 00000014 4022df0b

#define BLYNK_PRINT Serial

#include <SoftwareSerial.h>
SoftwareSerial s(D6,D5);
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

char auth[] = "D52MPya59BwHinOzPCVUli";
char ssid[] = "blabla";
char pass[] = "HalloWorld";

//SimpleTimer timer;
BlynkTimer timer; // Create a Timer object called "timer"! 

void sendSensorData()
{

StaticJsonBuffer<800> jsonBuffer;
  JsonObject& root = jsonBuffer.parseObject(s);
  if (root == JsonObject::invalid())
    return;
  
float mySQMreading=root["data1"];
Blynk.virtualWrite(V1, mySQMreading);
float nelm=root["data2"];
Blynk.virtualWrite(V2, nelm);
float mlx90614ambient=root["data3"];
Blynk.virtualWrite(V3, mlx90614ambient);    
float mlx90614object=root["data4"];
Blynk.virtualWrite(V4, mlx90614object);        
bool   raining=root["data5"];
Blynk.virtualWrite(V5, raining);             
int volts=root["data6"];
Blynk.virtualWrite(V6, volts); 
//float lux=root["data7"];                      
//Blynk.virtualWrite(V7, lux);    
//int skystate=root["data8"];                  
//Blynk.virtualWrite(V8, skystate);    
//int setpoint1=root["data9"];                 
//Blynk.virtualWrite(V9, setpoint1);    
//int setpoint2=root["data10"];                
//Blynk.virtualWrite(V10, setpoint2);    
//int bme280humidity=root["data11"];           
//Blynk.virtualWrite(V11, bme280humidity);    
//float bme280temperature=root["data12"];      
//Blynk.virtualWrite(V12, bme280temperature);    
//int dewpoint=root["data13"];                
//Blynk.virtualWrite(V13, dewpoint);    
//int bme280pressure=root["data14"];            
//Blynk.virtualWrite(V14, bme280pressure);    
}

void setup() {
  Serial.begin(9600);
  s.begin(9600);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, sendSensorData);
}
 
void loop()
{
  Blynk.run();
  timer.run(); 
}



I’d try putting some Blynk.run(); commands in your void sendSensorData() function, maybe after each block of three virtualWrite commands.

I’d also try calling the the sendSensorData function less frequently, at least during your debugging process.

Pete.

Pete,. Thanks for you reactions. I The mean time i found the solution IT was the amount of memory during when uploading the code i had the lowest balie selecties for the esp8266 do issue solved