Getting message while connecting to wi-fi as ESP not responding

Arduino UNO + ESP8266(ESP-01)
Smartphone OS: Android (ver 12)
Blynk server region:blr1
Blynk Library version: 1.3.2

#define BLYNK_TEMPLATE_ID           "xxxxxxxxxxxxxx"
#define BLYNK_TEMPLATE_NAME         "Lights"
#define BLYNK_AUTH_TOKEN            "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
char auth[]="xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char ssid[] = "xxxxxx";
char pass[] = "xxxxxxx";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(0,1);

#define ESP8266_BAUD 115200

ESP8266 wifi(&Serial);

#define relay1 13

BLYNK_WRITE(V13)
{
  int relaystatus1 = param.asInt();
  if (relaystatus1 == 1)
  {
    digitalWrite(relay1, HIGH);
    Serial.println(relaystatus1);
  }
  else
  {
    digitalWrite(relay1, LOW);
    Serial.println(relaystatus1);
  }
}

void setup()
{
  Serial.begin(115200);
  delay(10);
  Serial.begin(ESP8266_BAUD);
  delay(10);
  Blynk.begin(auth, wifi, ssid, pass,"blynk-cloud.com", 8080);
  Serial.println("Connected");
}
void loop()
{
  Blynk.run();
}

I don’t know where you obtained this sketch, but it’s a mess.

Some of the issues are…

You’re defining a SoftwareSerial port called EspSerial, but you’re using the Uno’s hardware serial pins to do this.

The baud rate for the SoftwareSerial port used to communicate with the ESP-01 can’t use a baud rare faster than 9600 because that’s the maximum that the Uno is capable of using when emulating a serial port - because of the Uno’s poor processor speed.
This baud rate also needs to match that of the ESP-01.

You are initialising the same Serial1 port (the hardware serial port of the Uno) twice.

blynk-cloud.com is the url for the old Legacy servers, which were decommissioned over a year ago.

I’d suggest you start by reading this topic…

Pete.

Thank you pete

This simple project was earlier working with legacy application. But now it was not working. so,I had gone thru all the posts and prepared this sketch. I was not able to ping blynk-cloud.com, that’s when i had doubt finally post here. As you suggested will go thru the post and correct myself

Hi Pete
After going through the post here is my updated sketch. But still getting this message
[1538] ESP is not responding.

#define BLYNK_TEMPLATE_ID "TM*********"
#define BLYNK_TEMPLATE_NAME "Lights"
#define BLYNK_AUTH_TOKEN  "**********************************"

#define BLYNK_PRINT Serial 

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "***********";
char pass[] = "***********";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2,3); // RX, TX

#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Initialise the debug (hardware) serial port
  Serial.begin(115200);

  // Initialise the SoftwareSerial port…
  EspSerial.begin(ESP8266_BAUD);
  delay(10);


Serial.write(auth);
  Blynk.begin(auth, wifi, ssid, pass);
}

void loop()
{
  Blynk.run();
}

What is this supposed to do?

How have you connected your ESP-01 to your Uno?

How have you configured your ESP-01’s baud rate to 9600 baud?

Pete.

Serial.write(auth) -its nothing I was just testing
yes as suggested pin 2 from uno to Tx of ESP-01 and pin 3 from uno to RX of ESP-01.
How to configure ESP-01 baud rate. I am using new ESP-01

It depends on the hardware you have available, and the AT firmware version of the ESP-01.

If you have a dedicated ESP-01 to USB FTDI adapter then it makes life simpler, but a regular FTDI can be used too.

Is there any reason why you’ve chosen an Uno + ESP-01 feather than a NodeMCU or ESP32?

Pete.

I did Ultrasonic Sensor module 6 years back, when i purchased, that time I am not aware of availability of NodeMCU. I just purchased Arduiono Uno and ESP8266 and trying to build a module to control the lights. Also I am not using FTDI, please advice what i have to do to complete the module, I will follow the same.

The tutorial that I linked to provides as much information as I’m prepared to commit to when it comes to configuring the ESP-01 module. This is simply because there are many different versions of the ESP-01 and ESP-01S AT firmware, and that’s assuming that the AT firmware hasn’t been overwritten by uploading a sketch to the ESP-01.
Also, there are many different versions of ESP-01 to USB adapter. Some are not fit for purpose, and others are quite good. There are also many varieties of standard FTDI adapters, but there is no standard pinout or standard way of switching to 3.3v output.

There are many tutorials on the internet about how to change the default baud rate on the ESP-01/S, so I’d study those.

Having said that, you’d be better spending money on a NodeMCU than on the hardware needed to change the default baud rate on your ESP-01.

Pete.

If I upload sketch to Arduino, does it changes in ESP-01 also. If ESP-01 is not going to work then I will go for NodeMCU.

No. But if you upload a sketch to the ESP-01 it will overwrite the factory AT firmware.

The ESP-01 will work, once you configure it correctly, but it takes more skill, knowledge and equipment than it does to use a NodeMCU to achieve the same results as the Uno + ESP-01 combo.

Pete.

I have not uploaded anything to ESP-01/ESP8266. If I use NodeMCU, do I need to upload the sketch separately for NodeMCU. Also is NodeMCU is better option compared to ESP8266 . Before I could start using NodeMCU, I need some information.

Your question seems to imply that you think you’ll be using a NodeMCU along with your Uno.
This isn’t the case, the Uno and ESP-01 will be redundant.

This forum and the internet are full of information about using NodeMCUs, but maybe this is a good starting point…

Pete.

Hi Pete

As you suggested now i am using NodeMCU, its simple compared to Arduino UNO and esp8266. Now device is showing online in Dashboard, now no light is on in NodeMCU. only relay led is on indicating off. From blynk app if button is tured On/Off, nothing is working. From dashboard if clicked on Off, in blynk app also it turns off. But giveing message as Device is offline. Below is my sketch, please advise any changes is required.





#define BLYNK_TEMPLATE_ID "xxxxxxxxxxxxxxxx"
#define BLYNK_TEMPLATE_NAME "Quickstart Template"
#define BLYNK_AUTH_TOKEN "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

#define switch1    1
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[]=BLYNK_AUTH_TOKEN;
char ssid[]="xxxxxx";
char pass[]="xxxxxxxxxxxxxxx";


void setup() {
Serial.begin(9600);
delay(100);
 pinMode(switch1 , OUTPUT);
Blynk.begin(auth,ssid,pass);

}

void loop() {
  Blynk.run();

}

BLYNK_WRITE(V0)
{
  
  if(param.asInt()){
  digitalWrite(switch1, LOW);
   
  }
  else {
    digitalWrite(switch1, HIGH);
   
  }
}


You’ve told your sketch that your relay is connected to GPIO1, which is the pin labelled Tx, and is therefore not a good pin to use, as the Tx pin is use by the serial port and will interfere with debugging.

I’m guessing that you’re getting confused with the “D” numbers printed on the NodeMCU board, and you’ve connected your relay to the pin labeled D1, which is actually GPIO5…

That’s because you have no code in your sketch to turn the ModeMCU’s onboard LED on or off. The onboard LED is connected to GPIO2 (D4).

I don’t understand the rest of your comments, but you’d be better looking at your serial monitor to understand what’s happening with connections and disconnections.

More info on the NodeMCU and which pins to use here…

Pete.