Your Arduino went offline

Ok, now found when disabling all serial communication I get Buffer overflow rarely.

As soon as I tahke Blynk.run() out of my sketch and just do virtualwrite it works flawlessly.
Even with LED on/off every 100ms!

Therefore it seems Blynk.run() is just transmitting data too fast for the ESP RX buffer (if I’m interpreting it right)

Is there any way to slow down Blynk.run() ?

You can switch all widgets to PUSH mode instead of “Frequency Reading” if you have some. Also what exactly code you are using now?

1 Like

Just working nearly flawlessly. Will also probably try reducing baud to 57600 tomorrow. Maybe that increases stability as well.

void blinkLedWidget()
{
  Blynk.virtualWrite(V18, 0);
  delay(500);
  Blynk.virtualWrite(V18, 255);
  delay(500);
}

void loop()
{
  //Blynk.run();
  //timer.run();
  blinkLedWidget();
}

Ok, reducing baud to 57600 seems to work even with blynk.run without disconnects

yeah, for some time…

Had those diconnects again an did further investigation.

It seems my ESP have an pretty old firmware that had a bug giving “busy p…” back before the OK.
I tried a Sketch to show the responses and had “busy p…” nearly all the time… I assume this is responsible for the overflow.

Then tried to update ESP Firmware but had no luck.

Will get other ESP soon and will try with them.

Feedback for other people…

added 470uF and 100nF directly at the ESP between + and GND and disabled all communication on serial Port.
Now 500ms blinking seelm to work (at least it did for 30 minutes without disconnect).

But as soon as I enable Blynk.run() it floods and disconnects.
Seems Blynk.run() is requesting data too quickly.

As said I assume thats also an issue with my module with old AT firmware and hope it works with other modules later.

Did ANYONE got ESP8266 with AT Firmware working flawlessly with blynk?

Did you look in our examples? You can’t do Blynk.virtualWrite in loop. This creates high load on microcontroller, especially ESP and makes it reboot. Recommended way is to use timer with required interval.

1 Like

The ESP isn’t rebooting and virtualwrite is rhe part that works.

What’s not working is the Blynk.Run() that crashes the connection instantly

Yes, As Blynk.run() makes all communication and handles virtualWrites

it wont work if it is COMMENTED OUT!

Sure it’s! By intention!
Please read what I wrote before omg!

If enabled the connection breaks!

Dimitriy I know. After looking into for so long I now understand what Blynk.run() does.

But as soon as I request data from ESP faster than every 500ms it overflows the buffer as I wrote before. And I suppose the Blynk.Run() does so!

Avoiding Blink.run() works for testing but I can’t in my final project since requesting data of 32 VP every lets say 800ms would take more than 20sec before the App is updated. That would be too long.

As said I suppose it’s a problem with my ESP module Firmware but I’m not sure.

Therefore it would be really essessential for me to know if some other people got any ESP8266 Module with AT Firmware working flawlessly.

Anybody?

@Gorkde I think you might be confused on what Blynk.run() does in relation to virtual pin updates.

I NEVER use anything other than PUSH frequencies but based on your example of 800ms it wouldn’t take 20seconds to update 32 pins.

Blynk has a maximum of 1000 updates per second so if all 32 pins were set at 800ms refresh they would all refresh in the blink of an eye, every 800ms.

Have you upgraded from 0.3.4 to 0.3.7 yet?

With your last code extract your hardware is asleep for almost all the time i.e. in loop you have the call to flash the LED with 500ms delays. You really MUST use the SimpleTimer for these intervals so your hardware doesn’t go to sleep and disconnect from the Blynk server. That said flood error is a different issue which suggests other bugs in your code.

From my experience Arduinos with ESP’s is a poor hardware system unless you just want to do very basic stuff.

1 Like

that is my point!

please try to at least understand the basics of how Blynk works so you can use it properly! omg!

then you have some problems you need to work through, but commenting out the ONLY thing that makes Blynk work is the wrong solution…

Thanks Costas.
(and dave, please shut up if you didn’t even read the thread or understand the problem)

So when I call blynk.run() it - if I understand it correctly - calls all the functions for pushing data right? This would mean an AT command for every pin Blynk.run requests (or are they pulled in one dataset?).
Since it calls them (I suppose) one after another without pause (I suppose) there would be more than 1 AT command in 500ms which would cause buffer overflow.

But even without any of these functions defined as soon as I call Blynk.run I get buffer overflow after some few seconds.

The 500ms delay combined with virtualwrite is just for testing purposes and works.

Will look for the update later when at home.

I had to use an Arduino since ESP8266 Standalone has way to few pins for my needs even considered I already use 4051 Analog Multiplexer for expanding inputs.

What would you suggest as optional (better) way for getting WIFI connection than the ESP?

1 Like

With a WeMos D1 Mini you have around 140 pins (128 virtual plus a selection of physical pins).

There is none of this AT rubbish to mess about with and you simply plug the device into your computer and it is ready to go.

If you want lots of analogue ports you can add multiplexers etc to the WeMos but I would much rather add to a WeMos than add an ESP to an Arduino.

1 Like

I have to concur with @Costas here. The Wemos is a way more stable platform. Even if you only want to use 1 or 2 pins it’s probably a better and more stable solution than an ESP “as is”. I’m really annoyed with the ESP-01 because it’s just not stable enough. Whatever firmware you run :slight_smile:

1 Like

I’ve got a Wemos D1 here but its not what I would like (and also could) use for my Project, even I already use Analog Multiplexers.

And considering its nothing more than an ESP with Arduino Firmware I could also just burn the Firmware on an ESP.

But since that’s no option I decided to combine the ESP with Arduino. The Stability of the ESP is not a problem with my later ones but they seem to mess up the buffer in Blynk or the Arduino.

So is there any other Option?
Also again the Question has anyone got Blynk and ESP got working together?

I did also update the App but since the problem already happens on hadware side It could only be a library problem.
My Lib that I installed is V037 and showing the Blynk_hardser and Softser libs as built in without any version number. Maybe there’s a problem?

On the other Hand, since the ESP is such a wide spread and cheap to get device, which is used more and more I can’t really understand why that’s seen as “not supported”. Wouldn’t it be a step ahead for Blynk if it would work with that device flawlessly?

For what I assume it should be pretty simple to incude a “check for bad response and trash it”-Routine which should get rid of the buffer overflow, which seems to habben in Blynk code (probably because of that mysterious “busy_p…” Response that probably fills up the buffer.

In general the ESP is perfectly stable for me and connects quick and flawlessly. The problem is mor about the ESP-Blynk AT communication which seems to mismatch. Should a reason to look into maybe.

Please explain why you couldn’t use a WeMos D1 or D1 mini for your project.

Is it the ESP-01 you are using?

If you look on the forum you will see untold misery from users with ESP’s as WiFi shields for Arduinos.

ESP’s are pretty stable even the ESP-01’s. The ESP’s are supported by Blynk but I agree with them that supporting them as a shield is not really worth the effort.

As you say the WeMos is just an ESP and any decent ESP is fine but in my book not fine when tied to an Arduino.

If you have lots of time and patience I’m sure you will get the ESP and Arduino working together. I don’t have the time or patience and regret the weeks I wasted hooking up ESP’s to Arduinos.

I could maybe make my project work with an ESP Standalone / Wemos if I have no other option. But has many drawbacks for me.

It has only one Analog pin with 1V range (just 3.3 because of Voltage divider) this would be a very low voltage range for my sensors. Also I would need a third Analog multiplexer which would require a 5th digital pin only for them.

So im left with 5 remaining pins which I would need to multiplex again …
Sure I could build an entire personal computer around my core but thats not what I was planning to.

Even the 2 Multiplexer I need now are wasting space I wasn’t planning to.

BUT…

What if I use this library as in the SimpleShield Demo?

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

Is the Blynk simple Shield the way to do it? Maybe that just solves my problem?
Can I use the normal RXTX ports with this?

Until now I’m using:

#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>

What are the differences? Is the above one Software serial?