I am trying to send AT
commands to ESP8266
. I re-flashed ESP8266
https://i.stack.imgur.com/z0hoc.jpg I followed this tutorial http://remotexy.com/en/help/esp8266-firmware-update/ and I hope it re-flashed successfully as there was no error.
When I uploaded this program http://www.pastebin.com/frhZY7tD I am trying to run AT command at 9600 baud rate on serial monitor then no response..
Below is how my circuit looks like
#include "SoftwareSerial.h"
SoftwareSerial esp8266(2, 3); // RX, TX
void setup()
{
Serial.begin(9600); // serial port used for debugging
esp8266.begin(9600); // your ESP's baud rate might be different
}
void loop()
{
if(esp8266.available()) // check if the ESP is sending a message
{
while(esp8266.available())
{
char c = esp8266.read(); // read the next character.
Serial.write(c); // writes data to the serial monitor
}
}
if(Serial.available())
{
delay(10); // wait to let all the input command in the serial buffer
// read the input command in a string
String cmd = "";
while(Serial.available())
{
cmd += (char)Serial.read();
}
// send to the esp8266
esp8266.println(cmd);
}
}
Trying to execute AT
command -
On clicking on send button then it shows empty response like below -
When I unplug power wire and plug it back then it prints some garbled message on serial monitor. I checked voltage on RX also, it was around 3.5V that seems also OK.
I am facing this issue after I flashed WiFi firmware to ESP8266
then back AT firmware. It seems that AT firmware was not flashed successfully so I tried to erase everything using below command.
esptool.py --port /dev/ttyUSB0 erase_flash
C:\Users\williams>esptool.py --port COM4 -b 9600 erase_flash
esptool.py v1.3
Connecting...................
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for pack
et header
Before execute above command, I made changes in my circuit like below :-
Update
I have re-flashed ESP8266 on 115200 baud rate, and uploaded empty program then it started to respond AT
commands. I connected as like above only change is TX to TX and RX to RX respectively. Alright!
AT
OK
AT
OK
AT+GMR
AT version:0.50.0.0(Sep 18 2015 20:55:38)
SDK version:1.4.0
compile time:Sep 18 2015 21:46:52
OK
Well, I want to send AT
commands from the Arduino serial monitor window to ESP8266
and print ESP8266
response to the command. When I upload above program then it stops to respond, same result as like empty screen this is weird. Isn't ?