Need Help about Arduino Uno with ESP8266 WIFI Module and Bynk

Someone help me out of this I continued working for three days but did not sleep well.
I am very depressed. My data with out the esp8266 module shows on the serial monitor but connecting with Blynk both in the app and on the serial monitor does not show.

CODE:


#define BLYNK_TEMPLATE_ID "TMPLPuOI0K84"
#define BLYNK_DEVICE_NAME "Solar Panel Monitoring SystemCopy"
#define BLYNK_AUTH_TOKEN "kkgd2KnVZJpQVxjrdbRZN9xxCx54836t"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#define ESP8266_BAUD 115200
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <DHT.h>;
#include <SoftwareSerial.h>

//Constants
#define DHTPIN 4     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE); 

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = " ";
char pass[] = " ";

// or Software Serial on Uno, Nano...
SoftwareSerial EspSerial(10, 11); // RX, TX

ESP8266 wifi(&EspSerial);
BlynkTimer timer;

void sendSensor() {
  // put your setup code here, to run once:
  
  float hum = dht.readHumidity();
  float temp = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(hum) || isnan(temp)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  Blynk.virtualWrite(V4, temp);
  Blynk.virtualWrite(V5, hum);

  Serial.print("    Temperature: ");
  Serial.print(temp);
  Serial.print("    Humidity: ");
  Serial.print(hum);
}

void setup() {
  // put your main code here, to run repeatedly:
  Serial.begin(115200);
  
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
  
  Blynk.begin(auth, wifi, ssid, pass);
  
  dht.begin();
  timer.setInterval(1000L, sendSensor);
}

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

Please edit your post, and add triple backticks ``` before and after your whole sketch.

Done Brother

You are creating a SoftwareSerial port called EspSerial and initialising it at 115200 baud.
Unfortunately, the Arduino Uno or Nano that you’re using doesn’t have the processing power to emulate a serial port at this speed, so it’s working for a very short while, then failing.

You need to change the ESP8266_BAUD value to 9200, but at the same time you need to re-configure your ESP8266 to also communicate at 9200 baud. How you do this will depend on the hardware you are using and whether you have an FTDI adapter available to you.

More info on this issue here…

Pete.

Thank you, dear sir. I understand. Sir, if I buy the new ESP8266 module, I can change the baud rate from AT commands.

You don’t need to buy a new ESP8266, you can re-configure your existing one.

What you should buy, if you don’t already have one, is an FTDI adapter to allow you to easily reconfigure your ESP8266 module.

Pete.

I did not have FTDI adapter and here in some place is out of stock and the only ESP8266 module is available.

So, how do you intend to re-configure the ESP8266 module to work at 9600 baud?

Also, is there any valid reason why you’re using the Uno/Nano instead of a NodeMCU or ESP32 board?

Pete.

I work on multiple sensor which give me data on analog pin in this way I need multiple analog pins.
sir if I buy the new ESP8266 so I can change the baud rate on AT command.

Dear Sir, Now I changed my baud rate to 9600 using the AT command. I am now facing this issue. I have already bought the new ESP.

You should look at the ESP32 then.

You can change the baud rate of your existing ESP8266, or buy a new one and change that. Either way, you need a way to connect the ESP8266 to your computer to do that. An FTDI is the simplest way of doing that, but there are other ways. It rather depends on the hardware you have available to you.

The ESP not responding message is usually caused by either:

  1. mismatched baud rates
  2. Incorrect wiring (Rx and Tx not crossed over, or other wiring issues)
  3. ESP not running the AT firmware
  4. Insufficient power to the ESP8266

I’d buy an ESP32 if I were you.

Pete.

2 Likes

Hello sir now I bought TTL adapter can you please share the latest tool and flash bin files.

Are you saying that you’ve overwritten the factory AT firmware?
If not, then I’d suggest that you stick with the firmware that came with your board.

If you do need to update the BIN file then it will depend on your hardware.
If you search the Espressif website you’ll find what you need.

Pete.

I will never understand why people use Uno + ESP8266 + TTL adapter instead of an ESP32 which does all the job for less than $10 :thinking:

1 Like

Is ESP32 connect directly to Arduino Uno.

You can put Uno into the bin :joy:
With ESP32, you don’t need any Uno board

The Uno is 12 year old technology and belongs in the bin. An ESP32 on its own will do everything you need.

My advice seems to be falling on deaf ears though!

Pete.

1 Like

I need just WiFi to transfer my virtual pin data to the cloud and also display it on a serial monitor like WEMOSE.
If I buy NODEMCU, I can do it or not.

I also re-flashed the ESP8266 and changed the Baud rate on the AT command, but now I check my default baud rate like AT+UART_DEF?. It shows me an error and also when I connect to Arduino, it shows me on the serial monitor that ESP is not responding. I am stressed.