How I can do reset in Blynk?

Hi dear
I have program when I get the Reading I want to press button in Blynk app to reset the Arduino as the manual connects Reset in Arduino to GND to reset the program.
I’m using Arduino uno with ESP8266.
Thanks for help

I’m not really sure that I understand what you want todo and why you want to do it.
Can you explain in more detail, and also explain why you want to reset your Arduino remotely?

Connecting one of the GPIO pins that is normally HIGH to the reset pin with a jumper wire is obviously very easy. As is pulling that pin LOW to cause the Arduino to do a hard reset.
However, if you want to do this because your Arduino has locked-up for some reason and you want to reset it, the Arduino is hardly likely to respond to the reset command.
If you’re wanting to reset the Arduino for some other reason then maybe there’s an alternative (and better solution).

If you are wanting to do a reset because your Arduino is locking-up then the solution is to identify the cause (probably bad code), or to use an external watchdog module to do the reset for you.

Pete.

resetFunc(); //call reset

This function resets the Arduino

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