Buffer overflow when starting my app

Hey Pete,

Sadly, you can remove the Solved… It happens again. Every pin I use has no other secondary uses like TX or INT…

How are you powering your relays?

Pete.

Hello

I am using the 5V + GND ports from Mega board.

They a need separate power supply, that shares the same GND connection as the Mega.
This may not be the cause of your problem, but do some tests without the relays connected.

Also, is this actually a Mega + EPSP-01, or a Robotdyn or equivalent combo board?
Was the AT version:1.7.4.0 firmware already installed on the ESP-01?

Pete.

Hey Pete,

This is a Robotdyn version.
I added an Arduino Uno only to power the relay’s with the 5v and use the GND from the Robotdyn.

Edit: currently it’s working again… I’ll keep you up to date.

Edit2: and it’s gone again. Sigh

I flashed the AT using this tutorial:

Still having issues with the bord connecting and disconnecting.

Hmmm, you’ll see that I tend to describe these as the “worst of both worlds”, and for good reason.
The Mega itself is a poor starting point for an IOT solution. Coupled with an ESP in the way that these guys do it makes it even worse.
My guess is that its your firmware, but it really isn’t worth the effort of playing around with them, they will always be a poor compromise in my opinion.

If you really do need to run 32 relays from a single MCU then I’d daisy-chain 4 MCP23017 boards together and control them with a NodeMCU or Wemos D1 Mini, like this…

However, I seriously doubt that having a topography where all 32 relays are situated in one location is a practical option for most IoT projects. I prefer to have one or two relays connected to a single MCU and located next to the equipment that is being controlled, and linked together via WiFi, but it does depend on your application.

Pete.

Hello Pete,

So you recommend using 2 esp32 with 2 relay boards?

I’ll be searching in my current setup later today. It’s strange that it works for 5-10minutes and then it goes crazy.

Als it worked fine from saturdaynight 5PM till sunday 2PM and then did crazy stuff

Is that what I said?

It would help if you provided some background to the project you are building.

Pete.

Hey Pete,

So I want to use relays to turn on my lights and shutters. There is no 230v on the switches, because everything works with 24v switches that goe to my electric box. There I can add extra cable’s so the relay’s can simulate as an extra switch.

I have to use 32 relays for all my shutters (22) and 10 for lights. I would need an other 16 to do all my lights (but that isn’t my first concern).

I first used an ESP32 with a 4 Channel relay to test everything and that worked fine. That’s why I upgraded to a bigger board (Robotdyn) with more relays, thinking it would work fine…

My first though would be to use a Shelly 2.5 device for each of your shutters. These can operate on 24v and are small enough to fit in most switch boxed. This would allow you to retain the existing switches and add IoT control too.
The switches incorporate an ESP8266, and can easily be re-programmed to run your own code, so can be “Blynkified” if you wish.

If you do add relay control at the supply distribution side then retaining existing physical switching will be a challenge and even if this is possible then you need to write your code carefully so that things continue to work when there is no WiFi/Internet available, or when the Blynk server is down. Using Blynk.begin isn’t a good starting point, as this is a blocking command and will stop all code execution in case of a lack of connectivity.

Pete.

Hey Pete, thanks for all the information.

Currently the setup is running. I discovered that their is an issue with the virtual pins or with the timers
I’m still looking in too it in detail. At a certain point the device loses it’s connection with Blynk and it buffer overflows again if there are timers or virtual pins in the app.

Well, there are no timers or virtual pin handlers in the ‘empty’ code that you were using, yet that still caused you problems.

Pete.

Pete,

I’m using the code I provided in the first post. So the virtual pins are in place.

I add a TimerWidget with the app and set in pin V2 by example.

So are you saying that the ‘empty’ code no longer causes buffer overflow issues? If so, what has changed?

Pete.

Hey Pete,

I started a new project (other auth token) with no widgets in the app with the same code as in the first post and it worked. So I decided to remove the timers and virtual pins from my orginal project and it worked.

Sounds to me like you have some underlying issues that re showing themselves as various random and seemingly unrelated symptoms.
I still think that the AT firmware you flashed to the ESP chip may be the issue.

Do you have any other boards that you could use for testing?

Pete.

Which AT firmware do you recommend?

Do you know what firmware shipped with the board? Did you try that one out before overwriting it with the current version?

Pete.

Yeah, that one didn’t function… I flashed the latest esp non os sdk thinf

Hello Pete

For good communication and help, this topic can be closed.

The Robotdyn Mega 2560 + Wifi R3 is currently working stable for 48 hours without any Buffer overflows. Still don’t know the correct cause of the buffer overflow error.

Thanks for the help!