Arduino mega + esp

It’s always Tx to Rx.
The Arduino and ESP need to be talking to each other at the same baud rate and if you’re using SoftwareSerial then preferably 9600.
You change the baud rate of the ESP using AT commands.

Pete.

1 Like

I tried using a separate power supply for esp earlier but it didnt work, Ill check my connections

Thanks sir, I’m using 9600 band on the code for serial, I didn’t know I also had to change the one in the esp, whats the default band of the esp?

How do I use the AT commands to change the band in the esp?

Google, or the search feature of this forum will give you all the answers you need.

Pete.

1 Like

I successfully changed the esp bandrate to 9600 and apploaded the sketch to arduino mega, but the serial monitor in arduino says

connecting to Mbeva
esp not responding

But I can see the esp under connected devices in my phone, yet the Blynk app says “it wasn’t online yet”

What can I do?

What exactly do you mean by this?

Pete.

esp%20not%20responding

Open the attached picture, The esp is not connecting but I can see it under connected devices in my phone(hotspot connection)

You’re saying that you can see it in the list of Wi-Fi SSIDs on your phone?
What name does it have, and what happens if you try to connect to it?
Screenshots would be good.

Have you ever uploaded a sketch to your ESP-01 ?

Pete.

I’ve never uploaded a sketch to the esp, I only sent AT commands to it. When I search it using my phone I can’t see it, but when I use arduino ide and program it to connect to my phone it does(The attached pic is the evidence)

Okay, that makes sense now.

People often have problems with Blynk when using a mobile hotspot, as some mobile data providers block the Blynk protocol.
Try connecting the Uno/ESP directly to a regular Wi-Fi network, or try connecting to a mobile hotspot that uses a different data provider, or swap the SIM card from a friend into your phone.

Pete.

Post your sketch

Sorry, i read wrong

it’s all ok. i had a lot of troubles with this type of connection, and most of the times it was the ground issue.

have you flashed your esp with the correct firmware?

No, How do I do that?

@TIYANI please edit the post where you posted your sketch and use triple backticks at the beginning and end of your code rather than the characters that you have used.
Triple backticks look like this:
```

Pete.

Thanks I couldn’t tell if they were apostrophes or back ticks

//THE WORKING CODE
#define BLYNK_PRINT Serial


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

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "eCSiYtVdVgVC1*****pwcPMG5kT9Z";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ke***ch";
char pass[] = "Keat***1";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(0, 1); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
}

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

I found a esp_flasher.exe to deal with the esp firmware but the files seems to be corrupted, can you give me a link to another one that I can use

http://help.blynk.cc/en/articles/605485-esp8266-with-at-firmware

It’s a pity you didn’t edit your existing post as I asked, rather than re-posting the code again. I’ll delete your post that has the incorrectly formatted code.

Personally, I wouldn’t start trying to Flash the ESP-01 with an updated firmware until you’ve tried a regular Wi-Fi network.

Pete.