Hello,
I have a problem with Arduino Mega2560 + ESP8266 with Blynk.
After connection between Arduino and ESP8266-01 with Blynk app, suddenly connection failed.
I want to debug what is the problem caused. I have a doubt problem on “blynk to auduino mega(with esp8266) connection”. It means that if response from the blynk or arduino have a problem then stop the any action on system.(Becuase I inserted “Softare Reset code” every 10minute, but this code not execute when problem occured.)
- What is best approach to debug blynk.(I want to know exactly why loop() is not executed).
- What is the best guessing problem in my project.
I tried reading blynk source and searching this forum topic. Unfortunately, this forum not many post Arduino Mega2560 + ESP8266 combination and does not exists post relate in my problem.
I found “Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h” file below codes.
void begin(const char* auth,**
ESP8266& esp8266,**
const char* ssid,**
const char* pass,**
const char* domain = BLYNK_DEFAULT_DOMAIN,**
uint16_t port = BLYNK_DEFAULT_PORT)**
{
config(esp8266, auth, domain, port);**
connectWiFi(ssid, pass);**
while(this->connect() != true) {}
}
"while(this->connect() != true) {} => In my understanding, If connection is not work, arduino will stop. I don’t want stop my arduino. For that reason I modified blynk library like belows.
void begin(const char* auth,
ESP8266& esp8266,
const char* ssid,
const char* pass,
const char* domain = BLYNK_DEFAULT_DOMAIN,
uint16_t port = BLYNK_DEFAULT_PORT)
{
config(esp8266, auth, domain, port);
connectWiFi(ssid, pass);
// while(this->connect() != true) {} //Original
while(this->connect() != true) {
BLYNK_LOG1(BLYNK_F("[connectWifi Fail] It would try softwarereset"));
delay(1000);
wdt_enable(WDTO_60MS);
while(1) {};
}
}
I guess like this codes, Blynk codes if some problem caused, not execute any code in the loop.
I want to solve this problem. I want if some problem caused in blynk codes, then execute software reset.
Help me please.