-->
Page 1 of 1

Can not communicate with ESP

PostPosted: Tue Mar 31, 2015 2:24 pm
by PyroxHU
Hi!

I got my ESP8266-01 module, i wired up and load a simple empty sketch. When I try to send commands in Serial monitor, the blue led on the ESP blinks, but there is no response. What can i do?
Sry, I'm a newbie.

Thanks for the help!

Re: Can not communicate with ESP

PostPosted: Wed Apr 01, 2015 1:51 am
by uhrheber
The Arduino IDE is just an editor bundled with a compiler, libraries and a programmer, meant to produce bare metal code and download it to the ESP8266.
Means, you have to do everything by yourself.
It is not a replacement for the original AT firmware or nodeMCU.
If you want it to receive commands from the serial port and do something, you have to write code that receives and interprets the commands.
Also, this isn't the idea behind Arduino for ESP. You could use it to write your own AT firmware, but the idea is to not use a separate microcontroller (like an Arduino), but run all functionality on the ESP itself. Therefore you don't need a command interpreter.

Re: Can not communicate with ESP

PostPosted: Wed Apr 01, 2015 3:09 pm
by PyroxHU
Well, I could start it, but the i can't read the response. I have already tried the baud rates.

Re: Can not communicate with ESP

PostPosted: Sat Apr 11, 2015 10:21 pm
by ricg
Here is a simple sketch that allows you to input cmds to the esp via an arduino serial console and view the response from the esp.
A few things to be aware of:
1. use a voltage divider circuit between the Arduino TX and the ESP RX. The arduino's signal is 5v , but the ESP expects 3.3v. This is important b/c using 5v can eventually damage the esp.
2. depending on the firmware in your esp you may have to change the baud rate in the sketch below before it will work.
3. be careful to get the tx,rx connections correct.
4. i use a 1000uF electrolytic capacitor across pwr & gnd of the esp in order to smooth out the voltage. The arduino may not be able to supply enough amps when the esp transmits and the cap will help with this.
5. and finally check out this site for a lot of good info: http://www.electrodragon.com/w/ESP8266
---------------------------------------------
#include <SoftwareSerial.h>

/* This sketch allows entering AT cmds to control
the esp8266-05
*/

// Arduino RX=10,TX=11 connected to TX,RX on esp8266-05
SoftwareSerial mySerial(10, 11);

void setup()
{
Serial.begin(9600);
Serial.println("starting esp8266 comm sketch");

// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
}
char cmd[32];

void loop()
{ int i=0;

if (mySerial.available()) // input from the esp8266
Serial.write(mySerial.read()); // write to host

while (Serial.available()) {
cmd[i]=Serial.read(); // buffer cmd
i++;
delay(5);
}

if( i ) { // if host sent us cmd
cmd[i]=0;
mySerial.println(cmd); // send to esp8266
}
}