Post topics, source code that relate to the Arduino Platform

User avatar
By PyroxHU
#13135 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!
User avatar
By uhrheber
#13161 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.
User avatar
By ricg
#14235 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
}
}