Got problem with buffer overflow

Hello everyone, … i have a project to control selenoid valve to make an irgation system using moisture senso and arduino pro mini with esp8266 as shield. it can be monitoring using gauge and controlled by widget button. and the problem is when i hit play button it working just a 5-8 second and then the notification come up and said “your arduino pro mini is disconected”. after that it will reconect again but and in 5-7 second it will disconected again. on my esp8266 i see the blue led blinking until notification came adn stop blinking

But when i dont open blynk apps and hit the play button and i watch blink led on esp it never stop blinking
and look normally
my serial monitor and it come like this when i dont hit play button

my serial monitor and it come like this when i hit play button

and this my code

    indent preformatted text by 4 spaces

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control   *
 * Arduino, Raspberry Pi and the likes over the Internet.     *
 * Blynk library is licensed under MIT license                *
 **************************************************************/
//Library 
#define BLYNK_PRINT Serial
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SoftwareSerial.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
SimpleTimer timer;
#define ONE_WIRE_BUS 12
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266 wifi(EspSerial);

int LDR = A6;
int Moisture = A7;
int sensorLDR = 0;
int sensorMoisture = 0;
int merah = 4;
int biru = 8;
int selenoid = 13;
int buzzer = 9;
int Override = 6;
int buttonPin = 10;
int tombol = 0;  
int tes = 0;

char auth[] = "02bb3311430d49df8237dfe6d51bb46f";
WidgetLED led1(2);
WidgetLED led2(3);
WidgetLED led3(4);
WidgetLCD lcd(5);

void setup()
{
  Serial.begin(9600);     // Set console baud rate
  delay(10);
  EspSerial.begin(9600);  // Set ESP8266 baud rate
  delay(10);
  pinMode(13, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(buttonPin, INPUT);
  pinMode(LDR, INPUT);
  pinMode(Moisture, INPUT);
  digitalWrite(buzzer, HIGH);
  Blynk.begin(auth, wifi, "R101 Andrians.Net", "notonline123");
  timer.setInterval(1000L, ldr);
  timer.setInterval(1000L, moisture);
  timer.setInterval(1000L, sendUptime);
  lcd.clear();
  lcd.print(3, 1, "System Online");
  lcd.print(0, 2, "Sprinkler System");
}
/////////////////////////////////////////////////////////////////
void loop()
{
  digitalWrite(merah, HIGH);
  Blynk.run();
  timer.run();
  cek_ldr();
  cek_moisture();
  cek_tombolf();

}
//++++++++++++++++++++++Blynk App++++++++++++++++++++++++++++++//
/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////
void ldr()
{
  sensorLDR = analogRead(LDR);
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(0, sensorLDR);
}
/////////////////////////////////////////////////////////////////
void moisture()
{
  sensorMoisture = analogRead(Moisture);
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(1, sensorMoisture);
}

void sendUptime()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(8, millis() / 1000);
}

//===================Akhir Blynk APP===========================//


//++++++++++++++++++++++Input  Fisik+++++++++++++++++++++++++++//
void cek_ldr()
{
  sensorLDR = analogRead(LDR);
  if (sensorLDR < 200)

  {
    led1.on();
  }

  else
  {
    led1.off();
  }
}
/////////////////////////////////////////////////////////////////
void cek_moisture()
{
  sensorMoisture = analogRead(Moisture);
  if (sensorMoisture > 250)
  {
    led2.on();
    sprinklerOn();
  }
  if (sensorMoisture < 250 && tes == 0)
  {
    led2.off();
    sprinklerOff();
  }
}
/////////////////////////////////////////////////////////////////
void cek_tombolf()
{
  tombol = digitalRead(buttonPin);
  if (tombol == HIGH)

  {
    sprinklerOn();
  }
}
//===================Akhir Input Fisik========================//


//+++++++++++++++++++Manipulasi Output+++++++++++++++++++++++++//
void sprinklerOnTask()
{
  led3.on();
  digitalWrite(selenoid, HIGH);
  digitalWrite(buzzer, LOW);
  digitalWrite(biru, HIGH);
  delay(2500);
}
void sprinklerOn()
{
  led3.on();
  digitalWrite(selenoid, HIGH);
  digitalWrite(buzzer, LOW);
  digitalWrite(biru, HIGH);
}
/////////////////////////////////////////////////////////////////
void sprinklerOff()
{
  led3.off();
  digitalWrite(buzzer, HIGH);
  digitalWrite(biru, LOW);
  digitalWrite(selenoid, LOW);
}
//===================Akhir Manipulasi Output========================//

Edited : It’s working right now, it’s my bad,i have ro use reading frequency to fast (500ms). and also maybe my internect conection not good to reach the server blynk, assuming with ping hit 4xxxms. so i will deploy local server to see maybe it will be more responcsive.

Yeah, I’ve got the same problem with the slider widget. I’m also using the esp8266 module as my shield, but the buffer overflow appears when I change the value.
Please help!

I got the same problem with LCD widget , using esp8266 softser with arduino UNO , same showing numerous “buffer overflow” and disconnect every 5~7 seconds after connected and worked normally and then connect again in about 4 seconds later…

@yonoodle did you ever fix the issues with using LCD and ESP8266?
I have spent a week trying to sort it, no joy and back to USB until the ESP performs better with Blynk.

@inu24ti

Hi, the issue is with the slider widget that the buffer overflows… Try other widgets on your project…
Ill post an issue regarding the bug in the slider widget.

@Dmitriy @Pavlo ESP8266 // Blynk // Arduino

Hi,

Running the code on hardware serial i see that the buffer overflows and the connection to blynk ip disconnects if the project includes any form of slider widgets.

Once the remove the slider widget, in my instance i was using it to provide PWM output to my led, the buffer overflow issue is gone and the Blynk app on android runs smooth as butter.

Please find a solution on why real time data upload hangs while using slider widget.

Thank you.

Regards,
K. Raghavendran

@sinet666 have you set slider to ‘send on release’?

Arduino with ESP will always have limitations and where possible you should consider ESP standalone unless there is absolutely no way it can be done with an ESP.

Even adding to the ESP (8 channels ADC’s etc) should perform better than adding an ESP to an Arduino.

@Costas

Hi, Thank you for your feedback… I have just started working on Blynk over the past 2 days. Cannot believe how much you can do with this app.

As of now i have ESP01 which doesnt have ADC, and has only a couple of GPIO pins… I would definitely go for ESPs that have many more features…

Ill research about the ESP12 and come back with the pros and cons.

Ill post here only and wait for your reply. Like if i wanted to use an I2C sensor, then what ? ESP12 doesnt have I2C.

Regards,
K. Raghavendran

Tevatron Technologies

@sinet666 the ESP01 does have ADC, you just need to have a steady hand when you solder the connection.

We have I2C devices connected directly to our ESP’s ie. OLED 0.96" displays.

We use ESP-07’s with aerials when we need good range and WeMos D1 Mini’s for everything else.

Depends on what you are looking to do.

Sorry for my ignorance… Thats why i said i’ll research more about this chip and get back to you …

This little buddy is pre-soldered, need to order a stand alone ESP12… Hope you understand now.

Thanks.

I know the ESP01’s are pre-soldered, I was just pointing out that you CAN enable the ADC on the ESP-01 chip by soldering your own connection.

Thank you very much. Ill experiment and post the results here…

Take care.

You will need strong soldering skills to achieve the ADC pin in the Esp-01. Keep in mind the ADC only converts voltage between 0 and 1 volt. You will need a Voltage Divider to work properly with it

1 Like

@psoro I’m not able to solder the regular break out pins let alone the chip pins :smile:
My business partner is a bit of a wizard with an iron though and we recently bought a couple of gas irons that might tempt me to do more soldering in future.

Don’t quote (or blame) me but 220K and 68K should allow ADC to read almost 4.3V (3.7V li-ion at maximum charge).

@Costas,
Fully agree with your estimation, in that case you would obtain 1.015 v as maximum.

You are lucky with your business partner… My wife looks at me as if I were crazy everytime I begin to solder…At the moment I’m not brave enought to solder chips…maybe in the near future…:wink:

1 Like