I am trying to send AT commands to ESP8266. I re-flashed ESP8266 as suggested here arduino uno - How to reset ESP8266 wifi module - Arduino Stack Exchange
C:\Users\williams>esptool.py --port COM5 --baud 57600 write_flash 0 ai-thinker-
0.9.5.2.bin
esptool.py v1.3
Connecting....
Auto-detected Flash size: 8m
Running Cesanta flasher stub...
Flash params set to 0x0020
Wrote 520192 bytes at 0x0 in 93.9 seconds (44.3 kbit/s)...
Leaving...
Below is how my circuit looks like https://i.stack.imgur.com/hgqEl.png
#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);
}
}
On serial monitor I am trying to send AT commands after uploading above program. I am getting square box on executing each commands.
Can anyone suggest what wrong I am doing ? Thanks in advance
I have tried with different baud rates 9600, 74880 , 115200 also but no success. Can anyone help me what I am doing wrong.