[SOLVED] Resetting with Blynk.syncAll()

I’m not sure this is intended behavior, but I ran into the following situation. I have a reset button in one of my Mega projects attached to a vPin. I’ve started using Blynk,syncAll() today and apparently it keeps resetting my Mega. I’ve build a little test setup on another Mega and it’s still the same. Both on Ethernet and ESP, in case it matters, but I think not, with the following sketch:

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

#define EspSerial Serial1

ESP8266 wifi(EspSerial);

// mega via esp8266 shield, local pi
char auth[] = "blablabla";

void(* resetFunc) (void) = 0;

BLYNK_WRITE(V0)
{
  resetFunc();
}

BLYNK_CONNECTED()
{
  //Blynk.syncAll();
}

void setup()
{
  Serial.begin(9600);
  EspSerial.begin(115200);
  Blynk.begin(auth, wifi, "Wanda2.4", "Git@@rtjes", "thuis.lichtsignaal.nl", 8442);
}

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

When I uncomment the sync, it keeps resetting. For now I’ve deleted my reset function on the Arduino, but I tend to use that sometimes. Is there anything I can do about this or should I try and code around it?

Can you describe your project? How many widgets do you have?
Could you please send a screenshot of Serial Monitor with BLYNK_DEBUG enabled?
Preferably, with Ethernet Shield…

For this test I only have 1 widget, the button for the reset. I made this code to eliminate all factors, but my entire project is described here: Home Domotics

The code in that topic is more or less the same as what I’m currently running. The only addition is a BLYNK_CONNECTED to keep the bridge tokens for two remote ESP’s up to date. Apparently, the number of widgets doesn’t really matter, since I have got it both here and in my 600-lines-of-code Domotic project.

I’ll make a log for you this sunday (if I do it now, I’m in the dark, LOL).

-edit-

With the ESP as shield I get this:

I can’t put it all here, the forum software throws it away somehow, really weird :confused:

http://lichtsignaal.nl/rommel/blynklog.rtf hopefully this is readable.

No, please send screenshot…
And use Ethernet shield, to eliminate ESP8266 factor :wink:

Lol ok. I’m gonna make that for you on Sunday xD

As per request, log with debug, serial speed set to 115200 and with the Ethernet :smile:

It looks like your sketch is posting so many data: every few milliseconds!
It probably shouldn’t…
Anyway if you tell to reset every time pin V17 is written… And it is writtien every time you call “syncAll”… … :slight_smile:

Great, so it’s by design :smiley:

Ah well, I’ll try to figure something else out or get rid of it. But it’s a good lesson for us, do not use this construction lol. I’ll whip something up which will reset the Arduino using a physical pin instead, tnx :smile:

(It works flawlessl b.t.w., maybe because of local server? Even if it runs on an old style Pi).

-edit-

And I honestly don’t know where all that data comes from. I have everything running in timers.

How is that =)? Is on local server?

Yes, I use the timers as seen in my topic to do stuff. I think the “fastest” timer is about 10s

Maybe, you can change it like this:

BLYNK_WRITE(V0)
{ 
  if (param.asInt()) {
    resetFunc();
  }
}

and put a Button on V0, select PUSH mode!

I knew I was missing something. I’ll try that, tnx xD

As always you are correct, thank you very much dear sir!

1 Like