Your Arduino went offline

Have you you tried a basic sketch to see if that goes offline? If it doesn’t then you know there is a problem with your code in the main project.

Sure, with the short code it works most of the time.

But the longer the code the more often it disconnects.

This and the buffer overflow is in my opinion a clear sign there must be a flaw in the library about memory.

This sketch uses over 50% memory and it can’t even connect at all, even there’s just variable definition, connection and the 2 in the main loop.

Anyway, already decided to change to ESP Standalone but I would like to know the reason anyway…

what is this doing ?

this is your code in “magic” code tags:

// #define BLYNK_PRINT Serial                                      // Blynk Debug Messages (muss vor dem Includes kommen) - Auskommentieren wenn nicht mehr gebraucht.
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SimpleTimer.h>

ESP8266 wifi(&Serial);


// ********  VOREINSTELLUNGEN  *****************************************************************************************************************

// ACHTUNG! ESP8266 auf 57600 Baud stellen, für diesen Sketch - Dann gibts scheinbar keine Buffer overflow Fehler!

// WLAN Einstellungen
#define WLANname "****"                                // WLAN Name
#define WLANpw "****"                                       // WLAN Passwort

// Email Einstellungen
#define EMAILto "****"                                  // Email Empfänger für Warn und Error Mails

// Blynk Token
#define authToken "****"            // Blynk Token

// Sonstige Einstellungen
byte shutdowntime = 30;                                         //Zeit(s) bis Pumpe zwangsweise gestoppt wird
//int SensorMin = 10;                                             // Minimale Schwelle Sensor bevor Fehler gemeldet wird
//int SensorMax = 1013;                                           // Maximale Schwelle Sensor bevor Fehler gemeldet wird

// ********  ENDE VOREINSTELLUNGEN  ************************************************************************************************************


// Restliches Setup
// Pumpen
#define pumpWass 6                // Pumpe1 für Wasser (gießen)
#define pumpwd 9                  // Pumpe2 für Wasser zum Düngermix-Tank
#define pumpdueng 10              // Pumpe3 für Dünger
#define pumpDWass 11              // Pumpe4 für Düngerwasser (gießen)

// Select Pins des 4051 Alalog Multiplexer (Sensoren)
#define IC4051S0 2
#define IC4051S1 3
#define IC4051S2 4
#define IC4051ENa 5
#define IC4051ENb 7

// LEDs
#define HWarnLED 12               // Warn LED
#define HErrLED 8                 // Error LED
#define PowWifiLED 13             // Power/Wlan LED (aktiv nachdem Wlan Verbindung erstmalig aufgebaut)

// Analoge Eingänge
#define SensTopf A0               // Feuchtigkeitssensor Töpfe
#define SensWass A1               // Wasserstandssensor Wassertank
#define SensDWass A2              // Wasserstandssensor Düngerwasser Tank
#define SensTemp A3               // Temperatursensor
#define SensLight A4              // Helligkeitssensor

// Error und Warnmeldungen
#define ErrorNr1 "Pflanzen: Fehler Feuchtigkeitsmessung! Dringend handeln! - Pumpen deaktiviert!"
#define ErrorNr2 "Pflanzen: Fehler Wasserstandssmessung! Dringend handeln! - Pumpen deaktiviert!"
#define ErrorNr3 "Pflanzen: Fehler Düngerwassermessung! Dringend handeln! - Pumpen deaktiviert!"
#define ErrorNr4 "Pflanzen: Fehler Pumpen-Timeout! Dringend handeln! - Pumpen deaktiviert!"
#define ErrorNr5 "Pflanzen: Fehler Kalibration notwendig! Dringend handeln! - Pumpen deaktiviert!"

#define WarnNr1 "Pflanzen: Warnung! 30% Wasserstand!"
#define WarnNr2 "Pflanzen: Warnung! 20% Wasserstand!"
#define WarnNr3 "Pflanzen: Warnung! 10% Wasserstand!"
#define WarnNr4 "Pflanzen: Wassertank befüllt!"

// Blynk Widget Pins
// Widget LEDs
#define WidWarnLED V17            // Warn LED setzen
#define WidErrLED V18             // Error LED setzen 

// Programmvariablen
//byte AnzToepfe = 0;             // Topfanzal initialisieren (wird später aus App/EEprom ausgelesen)
int FeuchtigkeitRAW[16] = {};     // Gemessene RAW Werte der Feuchtigkeit aller Töpfe
int FeuchtigkeitMAP[16] = {};     // Gemappte Feuchtigkeit aller Töpfe 0-100%
int FeuchtigkeitCALIB[32] = {};   // Kalibrationswert Feuchtigkeit 0-15 = LOW Werte 16-32 = HIGH Werte
int MoistLowHighRAW[2] = {};      // Niedrigster und höchster RAW Feuchtigkeitswert
int MoistLowHighMAP[2] = {};      // Niedrigster und höchster Gemappter Feuchtigkeitswert 0-100%
int WassCALIB[2] = {};            // Kalibrationswert Sensor Wassertank 0 = Leer 1= Voll
int DuengWassCALIB[2] = {};       // Kalibrationswert Sensor DüngewasserMix 0 = Leer 1= Voll
byte ErrorNr = 0;                 // Fehlerspeicher (wird durch Error Routine gesetzt) 0 = Kein Fehler, 1 = Feuchtigkeit Topf, 2 = Problem Wasserstandsmessung, 3= Wasser leer, 4 = Problem DüngeWasserMix Messung, 5 = Gieß-Timeout
byte WarnNr = 0;                  // Warnungsspeicher (wird durch Warn Routine gesetzt) 0 = Keine Warnung, 1 = Gießwasser 30%, 2 = Gießwasser 20%, 3 = Gießwasser 10%, 4 = Kalibration notwendig, 5 = Wassertank befüllt

// Timer definieren
 ----->  SimpleTimer ErrLEDtimer;
 ----->  int ErrLEDtimerID = 0;
 ----->   SimpleTimer WarnLEDtimer;
 ----->   int WarnLEDtimerID = 0;



// FOR TESTING PURPOSES
// ZUM TESTEN, LÖSCHEN !!!!
byte topf = 0;
byte AnzToepfe = 16;      // ALTEN WIEDER AKTIVIEREN!
int SensorMin = 0;       // ALTEN WIEDER AKTIVIEREN!
int SensorMax = 1023;     // ALTEN WIEDER AKTIVIEREN!
//int FeuchtigkeitRAW[] = {270,400,600,770,270,400,600,770,270,400,600,770,270,400,600,770,}; // TEST !! ALTEN AKTIVIEREN !!!!!!!!!!!!!!!!!
//int FeuchtigkeitCALIB[]= {200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800}; // TEST !! ALTEN AKTIVIEREN !!!!!!!!!!!!!!!!!





void ReadWass()
{
  // analogRead(SensWass);
  // Warnung wenn 30,20,10% / Error wenn 0
  // Wenn Wasserstand wieder über 30% weil aufgefüllt wurde, Warnung LED Timer löschen, Error löschen (falls richtige Nummer), Nachricht
}

void ReadDWass()
{
  //  analogRead(SensDWass);
  // Fehler wenn DW Tank keine 100% erreicht
}

void Giessen()
{
  // ***** Routine Gießen oder Düngen (Variable für rythmus in Voreinstellungen setzen und Wert nach Gießen/Düngen in EEprom)
}
void DuengerMix()
{
  // Düngerwasser anmischen
}

void Duengen()
{
  // ***** Routine Gießen oder Düngen (Variable für rythmus in Voreinstellungen setzen und Wert nach Gießen/Düngen in EEprom)
}
void Reset()
{
  // ***** RESET durch App
  // Errorflag im EEprom löschen, danach Reset
}

void CheckCalib()
{
  // Checke Kalibration ob ein Wert = 0
  // Wenn einer gleich = Dann Error5
}

void Calib()
{
  // Am Ende CheckCalib und Error 5 löschen
  // Werte ins EEprom
}

void Error(byte Nr)
{
  // Pumpen deaktivieren
  analogWrite(pumpWass, 0);
  analogWrite(pumpwd, 0);
  analogWrite(pumpdueng, 0);
  analogWrite(pumpDWass, 0);

----->      ErrLEDtimerID = ErrLEDtimer.setInterval(300L, blinkErrLED);           // Error LED Timer setzen
----->      ErrLEDtimer.enable(ErrLEDtimerID);
----->      WarnLEDtimer.disable(WarnLEDtimerID);                  // Warn LED Timer deaktivieren
----->      digitalWrite(HWarnLED, LOW);                           // Hardware Warn LED aus
----->      Blynk.virtualWrite(WidWarnLED, 0);                     // Widget Warn LED aus

  if (ErrorNr != Nr)                                     // Wenn neuer, anderer Fehler aufgetreten
  {
    ErrorNr = Nr;
    // *************** WarnNr ins EEprom schreiben
    if (Nr == 1)
    {
      Blynk.notify(ErrorNr1);
      Blynk.email(EMAILto, ErrorNr1, " ");
    }
    else if (Nr == 2)
    {
      Blynk.notify(ErrorNr2);
      Blynk.email(EMAILto, ErrorNr2, " ");
    }
    else if (Nr == 3)
    {
      Blynk.notify(ErrorNr3);
      Blynk.email(EMAILto, ErrorNr3, " ");
    }
    else if (Nr == 4)
    {
      Blynk.notify(ErrorNr4);
      Blynk.email(EMAILto, ErrorNr4, " ");
    }
    else if (Nr == 4)
    {
      Blynk.notify(ErrorNr4);
      Blynk.email(EMAILto, ErrorNr4, " ");
    }
    //  ***** Error Flag in EEprom setzen (löschbar durch Arduino Reset per App)
  }
  while (1)                                              // Programm stoppen,weiter messen und Error LED blinken lassen
  {
    Blynk.run();
----->        ErrLEDtimer.run();
    MesseToepfe();
    // Messe Wasser
    // Messe Temperatur
    // Messe Licht
    // Wenn Reset zur Resetroutine
  }
}

void Warn(byte Nr)
{
----->      WarnLEDtimerID = WarnLEDtimer.setInterval(800L, blinkWarnLED);          // Warn LED Timer setzen
----->      WarnLEDtimer.enable(WarnLEDtimerID);                                    // Warn LED Timer aktivieren

  if (WarnNr != Nr)                                                       // Wenn neue, andere Warnung aufgetreten
  {
    WarnNr = Nr;
    // *************** WarnNr ins EEprom schreiben
    if (Nr == 1)
    {
      Blynk.notify(WarnNr1);
      Blynk.email(EMAILto, WarnNr1, " ");
    }
    else if (Nr == 2)
    {
      Blynk.notify(WarnNr2);
      Blynk.email(EMAILto, WarnNr2, " ");
    }
    else if (Nr == 3)
    {
      Blynk.notify(WarnNr3);
      Blynk.email(EMAILto, WarnNr3, " ");
    }
    else if (Nr == 4)                                    // Tank aufgefüllt Nachricht senden Warnung zurücksetzen und LED stoppen
    {
      Blynk.notify(WarnNr4);
      Blynk.email(EMAILto, WarnNr4, " ");
----->          WarnNr = 0;
      // ***************** WarnNr im EEprom löschen
----->          WarnLEDtimer.disable(WarnLEDtimerID);              // Warn LED Timer deaktivieren
----->          digitalWrite(HWarnLED, LOW);                       // Hardware Warn LED aus
----->          Blynk.virtualWrite(WidWarnLED, 0);                 // Widget Warn LED aus
    }
  }
}




// FERTIGE FUNKTIONEN


int ReadPot(byte i)     // Misst einzelenen Topf (Topfnummer 1-16 an Funktion übergeben)
{
  if (i > 0 && i <= 16)
  {
    i--;                               // Topf 1-16 in 0-15 wandeln
    i <<= 2;                           // 2 nach links verschieben, damit die Zahl im Register bei Pin 2 beginnt
    byte TopfENb = i & 0b100000;       // Enable Bit B per UND rausfiltern
    TopfENb ^= 0b100000;               // Enable Bit B per XOR invertieren
    TopfENb <<= 2;                     // Enable Bit B 2 nach links damit es auf 7 liegt
    i |= TopfENb;                      // Enable Bit für 4051b hinzufügen
    PORTD = (PORTD & 0b01000011) | i;  // Ports setzen - PORTD per UND mit inv. Maske (Vorhandene Bits löschen), dann mit ODER Bits setzen
    int Wert = analogRead(SensTopf);
    if (Wert >= SensorMin && Wert <= SensorMax)
    {
      return (Wert);
    }
    else
    {
      return (-1);
    }
  }
  else
  {
    return (-1);
  }
}

int MesseToepfe()     // Misst Feuchtigkeit aller Töpfe bis zur angegebenen Anzahlund mappt danach 0-100 via MapPots()
{
  MoistLowHighRAW[0] = 1023;                   // Niedrigsten Wert mit max Wert füllen für Vergleich später
  MoistLowHighRAW[1] = 0;                      // Höchsten Wert mit min Wert füllen für Vergleich später
  for (byte i = 1; i <= AnzToepfe; i++)
  {
    if (ReadPot(i) != -1)
    {
      FeuchtigkeitRAW[i - 1] = ReadPot(i);
      if (FeuchtigkeitRAW[i - 1] < MoistLowHighRAW[0])     // Niedrigsten und höchsten RAW Wert ermitteln
      {
        MoistLowHighRAW[0] = FeuchtigkeitRAW[i - 1];
      }
      if (FeuchtigkeitRAW[i - 1] > MoistLowHighRAW[1])
      {
        MoistLowHighRAW[1] = FeuchtigkeitRAW[i - 1];
      }
      MapPots();
    }
    else
    {
      Error(1);                                // Error Routine Feuchtigkeitsmessung aufrufen (Error 1)
    }
  }
}

void MapPots()        // Map Feuchtigkeit  -- Negative Werte bedeuten trockener als Minimum, über 100 bedeutet feuchter als Maximum
{
  MoistLowHighMAP[0] = 1023;                   // Niedrigsten Wert mit max Wert füllen für Vergleich später
  MoistLowHighMAP[1] = 0;                      // Höchsten Wert mit min Wert füllen für Vergleich später
  for (byte i = 1; i <= AnzToepfe; i++)
  {
    FeuchtigkeitMAP[i - 1] = map(FeuchtigkeitRAW[i - 1], FeuchtigkeitCALIB[i - 1], FeuchtigkeitCALIB[i + 15], 0, 100);
    if (FeuchtigkeitMAP[i - 1] < MoistLowHighMAP[0])     // Niedrigsten und höchsten gemappten Wert ermitteln
    {
      MoistLowHighMAP[0] = FeuchtigkeitMAP[i - 1];
    }
    if (FeuchtigkeitMAP[i - 1] > MoistLowHighMAP[1])
    {
      MoistLowHighMAP[1] = FeuchtigkeitMAP[i - 1];
    }
  }
}

void blinkErrLED()
{
  if (digitalRead(HErrLED) == 1)
  {
    Blynk.virtualWrite(WidErrLED, 0);
    digitalWrite(HErrLED, LOW);
  }
  else
  {
    Blynk.virtualWrite(WidErrLED, 255);
    digitalWrite(HErrLED, HIGH);
  }
}

void blinkWarnLED()
{
  if (digitalRead(HWarnLED) == 1)
  {
    Blynk.virtualWrite(WidWarnLED, 0);
    digitalWrite(HWarnLED, LOW);
  }
  else
  {
    Blynk.virtualWrite(WidWarnLED, 255);
    digitalWrite(HWarnLED, HIGH);
  }
}


void setup()
{
  // Outputs deklarieren   (PWM Pins werden automatisch bei analogWrite() deklariert)
  pinMode(IC4051S0, OUTPUT);
  pinMode(IC4051S1, OUTPUT);
  pinMode(IC4051S2, OUTPUT);
  pinMode(IC4051ENa, OUTPUT);
  pinMode(IC4051ENb, OUTPUT);
  pinMode(PowWifiLED, OUTPUT);
  pinMode(HErrLED, OUTPUT);
  pinMode(HWarnLED, OUTPUT);


  // Ausgänge initialisieren
  analogWrite(pumpWass, 0);
  analogWrite(pumpwd, 0);
  analogWrite(pumpdueng, 0);
  analogWrite(pumpDWass, 0);


  // ***** EEPROM auslesen
  // ***** (Anzahl Töpfe (Erst EEprom, dann App),Dünger-Rhytmus-Counter (Erst EEprom, dann App), ErrorNr und WarnNr Flag, Kalibration Töpfe/Wasser/Düngerwasser)
  // Wenn Errorflag Error Routine aufrufen
  //  digitalWrite(HErrLED, 0);
  //  digitalWrite(HWarnLED, 0);


  // Seriellen Port starten
  Serial.begin(115200);

  // Verbindungsaufbau WLAN
  Blynk.begin(authToken, wifi, WLANname, WLANpw);
  while (Blynk.connect() == false) {}

  digitalWrite(PowWifiLED, HIGH);     // Power / Wifi-LED an (nach erstem Verbindungsaufbau)

----->      if (ErrorNr != 0)                   // Wenn Error vorhanden vor Beginn des Programms zur Error Routine springen
----->      {
----->        Error(ErrorNr);
----->      }
----->      if (WarnNr != 0)                    // Wenn Warnung vorhanden vor Beginn des Programms zur Warn Routine springen
----->      {
----->        Warn(WarnNr);
----->      }
}


void loop()
{
  Blynk.run();
----->      WarnLEDtimer.run();
  // BIS HIER FERTIGE LOOP!



 /*
      // TESTROUTINE RAW MESSWERT TÖPFE
      if (MesseToepfe() != -1)
      {
      Serial.print("Feuchte RAW      ");
      for (byte i = 0; i <= AnzToepfe - 1; i++)
      {
        Serial.print(FeuchtigkeitRAW[i]);
        Serial.print(" ");
      }
      Serial.print("  Low: ");
      Serial.print(MoistLowHighRAW[0]);
      Serial.print("  High: ");
      Serial.print(MoistLowHighRAW[1]);
      Serial.print("\n");
      }
      else
      {
      Serial.print("Error\n");
      Error(1);
      }
      delay(2000);
*/

  /*
      // TESTROUTINE MAPPED MESSWERT TÖPFE
       // MesseToepfe();                            // AUSKOMMENTIEREN wenn Nur Mapping getestet werden soll, enthält MapPots
        MapPots();                                // AUSKOMMENTIEREN wenn Messwert zum Testen gemappt werden soll
        Serial.print("Feuchte GEMAPPED ");
        for (byte i = 0; i <= AnzToepfe - 1; i++)
        {
          Serial.print(FeuchtigkeitMAP[i]);
          Serial.print(" ");
        }
        Serial.print("  Low: ");
        Serial.print(MoistLowHighMAP[0]);
        Serial.print("  High: ");
        Serial.print(MoistLowHighMAP[1]);
        Serial.print("\n");
        delay(2000);

    /*
        // TESTROUTINE MESSWERT TOPF MIT EINGABE
        if (topf == 0)
        {
          // Testeingabe Serieller Monitor
          Serial.println("Topfnummer eingeben:");
          while (Serial.available() == 0);
          topf = Serial.parseInt();
        }
        Serial.print(ReadPot(topf));
        Serial.print("\n");
  */
}
1 Like

Magic code tags?

The Line dies run the Warning LED Timer once set.
Its doing nothing now since the timer is sez in the warning routine which isn’t called

So what do you want to tell me?
I still don’t understand your sentence

Ahhh… Ok uf I press code 3 times it gets highlighted you do mean that?

Thanks, didn’t know

Makes it easier to read :slight_smile:

@Gorkde are you using the correct basic sketch for your hardware?

This is the example provided by Blynk for Arduinos with ESP shield, specifically the Uno with just one hardware serial port. It does recommend using hard serial but I’m not sure that is still available from the latest Blynk examples provided in the Arduino IDE:

/**************************************************************
 
 * This example shows how to use ESP8266 Shield via  to connect your project to Blynk.
 *
 * Note: Ensure a stable serial connection to ESP8266!
 *       Firmware version 1.0.0 (AT v0.22) is needed.
 *       You can change ESP baud rate. Connect to AT console and call:
 *           AT+UART_DEF=9600,8,1,0,0
 *       In general, Soft Serial may be unstable.
 *       It is highly recommended to switch to Hard Serial.
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 * Feel free to apply it to any other example. It's simple!
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";


// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, "ssid", "pass");
}

void loop()
{
  Blynk.run();
}

You really need to get this running ALL the time, not most of the time, before moving on to an actual project. I know you plan to move to standalone but if you want to know what your problems are with ESP as a shield you should take a step back.

Things to note in the sketch. The version of the AT firmware is IMPORTANT.

Baud rates are IMPORTANT and it is recommended to stick with 9600 for testing purposes.

If I was able to get this working I would then add SimpleTimer to Blink an LED and then move on to do a real project.

1 Like

With basic sketch it worked for over half an hour without disconnect but sometimes it disconnects one time after another even with this.

I dit try to update the ESP-14 but couldn’t I believe it had 0.20 Firmware and the ESP-12F has 0.40 Firmware. I didn’t see you need an old Firmware until now. I did assume my FW is too old.

That could be the reason maybe but since I’m running out of time I think I’ll switch now, maybe I’ll try later since I’ll keep my test Board and build another on another breadboard anyway.

But why do we need old firmware to get it working?
Hasn’t the Blynk library not been updated for that long?

Sounds like the Uno with ESP wasn’t running that well then.

How did you power the ESP as the Uno has enough power to flash an ESP but not enough for the ESP to operate in running mode?

I was never sure about the AT firmware, sometimes I thought Blynk meant you must have at least version 0.22 but I believe the references to it meant exactly version 0.22.

I did power it by an external 3.3V voltage regulator which was connected to an additional power source.

Costas I’m working on the new hardware (ESP standalone) and discoverd a new problem…

First I did my setup with a Wemos D1 but got alternating temerature readings. I soon discovered it was the ADC reading different values even with fixed voltage at the analog pin. It has a range of around 10 (of 1024) where it dififfers.

Now I thought the board must be messy and took an ESP-12F but that’s even worse, that has a range of around 50 where it differs!

The huge differencies are seldom and look like the Chip is doing something at an interval which interferes with the ADC.

BTW. not using WiFi for now in my sketch…

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.println(analogRead(0));
  delay(100);
}

Any Idea?
You’re using the Wemos, what about your readings?

The WeMos can only read 3.2V on the analogue pin, the regular ESP’s are limited to 1.0V.

You need to set up a voltage divider for the WeMos / ESP to accept 3.3V.

For the ESP a resistor pair of 220K and 68K should be fine.

I did, thats not the problem. At the moment it’s around 0.2V at ADC but jumping around…

Is the 0.2V with a WeMos or a regular ESP and what device are you connecting to the analogue port?

For reference the ESP has a builtin voltage API in the SDK that can be accessed without use of the analogue port. To use the API you need to ensure you don’t have anything connected to the analogue port.

Use ADC_MODE(ADC_VCC); as a defined global and ESP.getVcc() gives voltage as an integer in mV.

We found the AO port readings do bounce a little and rather than mess about with capacitors and the like we now use the API call. It’s also another circuit we realised we didn’t need when we found the API.

I did try that and it was stable but I need to read sensor data so I need the analog Pin right? I read the Voltage functions are only for internal reference?

Now … When I put ADC to GND i get 0-7 readings no matter what I do.
As soon as I disable Wifi it reads correctly.

But I cant disable Wifi when trying to use Blynk…

So what do I do?

Another remark about my original problem with the AT Firmware - Blynk connection…

Someone in the Espressif Forum replied because I asked about “Busy p…:”

Re: use AT+CIPCLOSE=0 cannot close the connection
Unread postby dax » Thu Jun 09, 2016 8:11 am

Gorkde wrote:
I got this "busy p..." message as well and it seems to mess up the Arduino or Blynk buffers therefore me getting an buffer overflow after some seconds. 

What is the reason for the message and is there a way to avoid it?

Maybe the data you send exceed the number of character you set?

So maybe the invisible Chars Blynk sends as heartbeat aren’t correctly counted sometimes??
Possible bug in the Blynk Lib?

You don’t specifically need an analogue port to read sensor data. Almost all sensors are available in digital form so personally that is the way I would go.

When we were using the AO port with our ESP’s and WeMos the readings were acceptable.

Are you using a regular ESP or a WeMos and what sensors are you trying to read?

You can actually disable WiFi and still use Blynk, it just comes down to the timing, but you shouldn’t have to do this. Provide more details and we will see if we can fix a fix for you.

Thanks but I do need analog since my homemade sensors are not available in digital form :wink:

But I found 2 ways

a) Disable and enable WiFi if this works with Blynk

b) Calculating a middle of many readings (done but takes half a second to get to a stable result)

c) I noticed the correct reading is always the lowest. So I could check 50 then use the lowest of them.

But I got another Problem I’m not even getting my Wemos to connect.
As soon as I try it does a WDT reset for some reason.

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example runs directly on ESP8266 chip.
 *
 * You need to install this for ESP8266 development:
 *   https://github.com/esp8266/Arduino
 *
 * Please be sure to select the right ESP8266 module
 * in the Tools -> Board menu!
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "***";

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, "***", "***");
}

void loop()
{
  Blynk.run();
}