Hi there, I am a newbie here.
I am turning LED on and OFF using ESP8266( esp01) wifi module connected with Arduino UNO.
I am getting CMD error after sending multiple requests to the server.
After CMD error it disconnects and without being reset,it cant be connected again!
How do I solve it?
I am using Blynk library 0.5.4
Arduino IDE version 1.8.7
Using the Blynk Server and Blynk android app
Here is the code
#define BLYNK_PRINT Serial
#define BLYNK_DEBUG
int counter = 0;
#include <ESP8266_Lib.h>
//#include<ESP8266WiFi.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Hakunamatata";
char pass[] = "274987079";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
BlynkTimer timer;
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
void doTheWork()
{
Blynk.run();
}
void setup()
{
// Debug console
Serial.begin(9600);
timer.setInterval(500L,doTheWork);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
if(Blynk.connected())
{
timer.run();
}
else if(!Blynk.connected())
{
//I am resetting here, because without this error wont go and cant connect again
Blynk.begin(auth, wifi, ssid, pass);
}
}
Here is the Serial Monitor debugging log
1028023] >[14|00] [00|06]
[1028023] >dw[00]6[00]1
[1028034] >[14|00]![00|06]
[1028040] >dw[00]6[00]0
[1028075] >[14|00]"[00|06]
[1028096] >dw[00]6[00]1
[1037012] <[06|00]V[00|00]
[1042038] Cmd error