BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

How I can do reset in Blynk?

Thanks
How I can use button A1
When I prees the button in Blynk app the program reset?

What is the Function of resetFunc(); to call?

Why do you want to use that pin?

It would be better if you use the virtual pins:

BLYNK_WRITE(V1)  // Reset
{
if (param.asInt()==1) {
delay(100);
resetFunc();
  } 
}

Add a button V1 (push mode) and test it.

Let me know if it works or not…

does it work with a nodemcu too?

For ESP’s you have to use ESP.restart() or ESP.reset().
I use always the first one and it works fine BUT you have to use several delays:

BLYNK_WRITE(V1) // Reset
{
if (param.asInt()==1) {
delay(3000);
ESP.restart();
delay(5000);
}
}

(Sorry, I can’t format the piece of code using my mobile)

1 Like

thank you Jose.
I will try tomorrow.

1 Like

Strange… I have had great results with just this in my one ESP code. Saves me running outside in the cold when things get flaky and I want to reboot the Wemos.

BLYNK_WRITE(V1) {
  ESP.restart();
}

Maybe the fact that it gets processed twice on button press and release helps “enforce” the action if the initial one didn’t work :stuck_out_tongue: No, that wasn’t intentional, just lazy coding at the time… and I just noticed it now :blush:

1 Like

Hi psors
Thanks for helping

When I do like this I get error
‘Const class BlynkParam’ has no member named ‘aslnt’

How I can solve this?

There is a syntax error in your coding, Ideally you would look at your code letter by letter and line by line… comparing it with known good examples to see the differences you made. Otherwise, you have to show us all the code in question if you want us to point out the actual issue… if we have time :stuck_out_tongue:

When I add this Function I get error

that doesn’t look like a capital letter I in .asInt() to me :thinking:

image

1 Like

Thanks I solve I
But again error

Since the ESP is just acting as a Serial to WiFi adapter, then you can NOT actually run any ESP specific commands… So you need to use an Arduino based reset method…

1 Like

resetFunc();
was not declared in this scope

What I can do??!

with or without delay, it does not work

ets Jan  8 2013,rst cause:2, boot mode:(1,6)
ets Jan  8 2013,rst cause:4, boot mode:(1,6)
wdt reset

stopped until I press reset on nodemcu board :thinking:

@Blynk_Coeur if I recall correctly, after uploading the sketch, you need to do a manual reset before the command reset will work properly… much like how OTA needs. But further Googling may be required to refresh that memory :stuck_out_tongue:

@Moosa We are just working piecemeal through your code… not a good way to troubleshoot remotely. You need to Google on your end and do lots of reading for further information on how to reset your UNO from code. Perhaps you need a different command or further setup? Then once you find the correct code and tested it manually via non-Blynk sketch, you can add it into a Blynk sketch as shown with a BLYNK_WRITE() function.

1 Like

thanks @Gunner :blush:

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
FirstStart 
0
MCU 1 Connected
------------------
first connection OK
Vsync

Thanks all
I solved by

void (* resetFunc) (void) =0; 


BLYNK_WRITE(V1) // Reset
{
if (param.asInt()==1) {
resetFunc();
delay(5000);
}
}

Thanks very much

1 Like

thanks everybody for all the help . and thanks Especially to Moosa for creating such a post, was looking for something like this.
can anyone tell me if it is possible to automate this function with out manually pressing the virtual button on the blynk app. that is like adding any timer that virtual pin goes high and low means on and off by itself for desired time interval… to be specific i want to reset esp every 5 hours…
I am Noob//

This is a older topic. Usually a better idea to start a new topic referencing this one instead of resurrecting it.

However…

Use a 5 hour (18,000,000ms or 1000x60x60x5 if my math hasn’t failed me :woozy_face:) Timeout Timer to call your reset function.

2 Likes

But… WHY are you having to reset? Surely there is a better solution?

2 Likes