MCU goes offline

I have the same problem. U fixed it ?

Start a new thread describing in detail what your problem is and what you have done to try and fix it.

You will need to list the precise hardware and software including library versions etc.

The more detail you provide the more likely someone will give you the fix.

2 Likes

Vietnamese? I fixed it. Just put a function to check the connection status then reset your program or your device. I’ll send you after work.

#include <SimpleTimer.h>
SimpleTimer timer;

int disconnects;
void(* resetFunc) (void) = 0;
void checkBlynk(){
  bool isconnected = Blynk.connected();
  if (isconnected == false){
    disconnects++;     
  }
  if(disconnects > 5){
     resetFunc();
     }
  }

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(115200);
  delay(10);
  pinMode(led13,OUTPUT);  
 
  Blynk.begin(auth, wifi, "xxxxxxxx", "xxxxxxxx");
  timer.setInterval(8000L, checkBlynk);
}

void loop()
{
  Blynk.run();
  timer.run();
}
1 Like

Yes. I’m Vietnamese. Thanks !
void(* resetFunc) . This will reset device ?

@luutrihieu You have already been asked to supply some details… The reset function mentioned is for Arduino boards… Are you using an Arduino or ESP?

I using ESP-07. What function for esp to reset board ?

Thats a good Google question :wink:

1 Like