Go Down

Topic: ESP8266 on Arduino Mega problems (Read 62 times) previous topic - next topic

Bavilo

Hi everyone!

I am have serious problems with getting my ESP8266 module (ESP-01) working with my Arduino Mega.
I have looked at dozens of tutorials but I don't really understand how to set things up.

The ESP is connected to my Mega like this.

External 3.3V to ESP
GND to ESP
ESP TX to Arduino RX (Serial2)
ESP RX to level shift to Arduino TX (Serial2)

The bridge for the chip enable is there as well. The modul lights up, I can even find the Soft AP it creates.

Now here is what I wish to do.

I want to connect the ESP to my WIFI network. Once it is connected, I want to use an Android device to send serial data to the ESP's IP. The Arduino will then need to read this data through the ESP.

For instance, I want to send a string to the ESP like this:
Code: [Select]
"I,7,25,30,52,67,38,78.9,91.3!"

I have implemented this using an HC-06 bluetooth modul and everything is working fine, but I would like to switch to WIFI now.

The problem is, I can not get the ESP to react to any AT commands. Also I keep seeing people flashing some firmware on the ESP, is this necessary?

I'm simply not aware of the steps that need to be taken in order to send and receive basic raw serial data.


Thanks in advance!

pert

The problem is, I can not get the ESP to react to any AT commands.
Please post the code that you used to test this. The best code would be something that simply echos any thing received/send in the Serial Monitor. It is also useful for testing to get a USB-serial breakout board such as the FTDI FT232RL for testing so that you can communicate directly from your PC to the ESP8266, removing the extra complication of the Arduino. Then once you are sure the ESP8266 is working correctly you can connect the Arduino.

I keep seeing people flashing some firmware on the ESP, is this necessary?
Likely not, every ESP8266 module I've worked with came with the AT firmware installed. However it may have an old version or a modified version from what you expect, even so the basic commands should remain the same regardless.

If you send AT+GMR it will print out the firmware version(assuming the AT firmware is installed).

One thing you have to get right is the baud rate to communicate to the ESP8266. This is usually 115200 by default but you can change it via AT commands. It's possible it has a different baud rate than 115200 set.

Bavilo

Please post the code that you used to test this. The best code would be something that simply echos any thing received/send in the Serial Monitor. It is also useful for testing to get a USB-serial breakout board such as the FTDI FT232RL for testing so that you can communicate directly from your PC to the ESP8266, removing the extra complication of the Arduino. Then once you are sure the ESP8266 is working correctly you can connect the Arduino.
Likely not, every ESP8266 module I've worked with came with the AT firmware installed. However it may have an old version or a modified version from what you expect, even so the basic commands should remain the same regardless.

If you send AT+GMR it will print out the firmware version(assuming the AT firmware is installed).

One thing you have to get right is the baud rate to communicate to the ESP8266. This is usually 115200 by default but you can change it via AT commands. It's possible it has a different baud rate than 115200 set.
Ok I have tried everything now...This is truly the poorliest documented device on this planet. I really have now clue how to get it to work.

I see people using no level shift at all, I see people pulling the enable pin HIGH, I see people pulling the reset pin HIGH, some don't. Can someone just tell me how to get this thing running please?

Here is the code I am using to test it:

Code: [Select]
void setup() {
  Serial.begin(9600);
  Serial2.begin(9600); 
}
 
void loop() {
  if(Serial2.available()) {   
    char ser = Serial2.read();   
    Serial.print(ser);
  }
  if(Serial.available()) {   
    char ser = Serial.read();
    Serial2.print(ser);
  }
}


I have tried every baud rate, this thing won't respond. At some point I saw a "ready" in the console, once...and then never again.

What I have noticed it that when the RX and TX lines are hooked up to the Arduino, the blue LED on the ESP won't flash anymore, not even on ESP power up.

Some one PLEASE help me.

Bavilo

I got it working...

I forgot to connect GND from my external powersupply to Arduino GND.

AT commands are now working.

Code: [Select]
AT+GMR

AT version:0.60.0.0(Jan 29 2016 15:10:17)
SDK version:1.5.2(7eee54f4)
Ai-Thinker Technology Co. Ltd.
May  5 2016 17:30:30

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy