Hw resets on multiple "Blynk.setProperty" commands

@wanek I think the problem is the ESP libraries. Are you still using Arduino ESP core 2.3.0?
My main system uses the master, not the 13 or 14 month old 2.3.0 core and it’s fine.

On a 2.3.0 system it shows 5 display widgets updated and then a login timeout, but not a reset.

The 3 to 4ms with the master branch increases to over 4000ms with 2.3.0 and certainly high enough to trigger the WDT under certain circumstances.

Would recommend everyone moves to at least 2.4.0-rc1 as there are lot of fixes from 2.3.0.

1 Like

I work as a HVAC designer, but mostly I’m drawing ventilation systems for on going construction projects :slight_smile:

Too much for the very old ESP 2.3.0 firmware but not the new firmware.

yes, i’m using the old 2.3 libs. up to now i didn’t updated, because i’ve heard rumors on the net that there were several issues with the new core. i thought to wait a bit until they are ironed out.

how can i upgrade to the latest core?

edit:
this is ok to use, or there are any newer?
https://github.com/esp8266/Arduino/releases/download/2.4.0-rc1/package_esp8266com_index.json

Upgrading to 2.4.0-rc1 is fairly straightforward and just involves changing the url in preferences.

2.4.0-rc1 has most of the bug fixes but the master obviously has more fixes and no firmware is totally bug free.

I recommend setting up new portable installations of the Arduino IDE so you might have 1.8.3 with 2.3.0 and 1.8.4 with 2.4.0-rc1. You can then easily switch between them if required.

We wanted to test the new deepSleep and 16M so we upgraded. deepSleep is better but we still haven’t got 16M working.

Yes that is fine but see my note about a separate portable installation.

1 Like

thanks for the info. so, just to be clear, for latest build should i use this link:
http://arduino.esp8266.com/stable/package_esp8266com_index.json ?

i’m not a github guru, so, i’m a bit confused…

Not the stable, use the url with 2.4.0-rc1 but in a separate portable installation of the IDE in case you don’t like 2.4.X.

I’m confident that the majority of ESP8266 users are much better off with the 2.4.X

ok, i will do that. thanks!

The guide for portable installations is at https://www.arduino.cc/en/Guide/PortableIDE

so, i’ve installed 2.4.0-rc1 (https://github.com/esp8266/Arduino/releases/download/2.4.0-rc1/package_esp8266com_index.json)

removed all yield and blynk.run from my code, and done some tests.
no more crashing, it works like a charm! :slight_smile:

thanks @Costas for your perseverance!

@wanek glad you got it fixed. Could you reintroduce your EEPROM routine and send millis() to a couple of display widgets (as Serial Monitor is not available to you) as the start and end of the Terminal function.

the eeprom routine was re-introduced long time ago, because i was sure not that’s the cause.

i will do the millis timestamp test in some minutes. will be back.

1 Like

code:

BLYNK_WRITE(V_TERMINAL)                  // update unit name
{
  terminal.print(millis());
  terminal.println("- begin terminal read");
  terminal.flush();

  unitName = param.asStr();

  terminal.print(millis());
  terminal.println("- end terminal read, begin eeprom write");
  terminal.flush();

  if (updateName()) {

    terminal.print(millis());
    terminal.println("- end eeprom write, begin terminal writeback");
    terminal.flush();

    terminal.print("unit name set to ");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
    terminal.flush();

    terminal.print(millis());
    terminal.println("- end terminal writeback, begin 9 X setproperty");
    terminal.flush();

    Blynk.setProperty(V_RELAY_1_STATE, "label", unitName + " RELAY 1");
    Blynk.setProperty(V_RELAY_2_STATE, "label", unitName + " RELAY 2");
    Blynk.setProperty(V_RELAY_3_STATE, "label", unitName + " RELAY 3");
    Blynk.setProperty(V_RELAY_4_STATE, "label", unitName + " RELAY 4");
    Blynk.setProperty(V_MOTION_LED,    "label", unitName + " LED");
    Blynk.setProperty(V_MOTION_STATE,  "label", unitName + " ALARM");
    Blynk.setProperty(V_MESSAGE,       "label", unitName + " NFO");
    Blynk.setProperty(V_RESTART_CAUSE, "label", unitName + " LR");
    Blynk.setProperty(V_SEND_RTC,      "label", unitName + " RTC");

    terminal.print(millis());
    terminal.println("- end 9 X setproperty");
    terminal.flush();
  }
  else {
    terminal.println("ERROR: length mismatch!");
    terminal.flush();
  }
}

screenshot:

Thanks, as I thought EEPROM processing is very “slow” :slight_smile:

yeah, i know too that it is relatively very slow, but not far as slow to make angry the watchdog :slight_smile: and reset the esp

1 Like

@Costas

this code works very well for me. Even if I call a small Blynk_Delay(1). My ESP code is running many Blynk.syncVirtual and Blynk.setProperty commands. I’ve had it running on different ESP8266 hardware and each running either V2.3.0 and V2.4.RC1 for weeks without any resets. Thought I’d share it (even though similar code has been posted before).

 void Blynk_Delay(int milli)
{
	int end_time = millis() + milli;
	while (millis() < end_time)
	{

		if (Blynk.connected())
		{
			Blynk.run();
		}

#ifdef USE_ESP8266
		ESP.wdtFeed(); // feed watchdog
		// timer.run();
		ArduinoOTA.handle();
		yield(); // let esp8266 hardware do stuff
#endif
	}
}
2 Likes

Nice @mars i’ll add your function to my toolbox and see how it goes in the coming weeks.

Hello everyone!

I ran into the same error as the original poster using the setProperty() Method. Adding yield() and Blynk.run() after each call works for me in combination with this article (I’,m using private server).

So thanks for the hint!

but did you update the esp core to 2.4?