I received my esp8266 a few days ago and couldn't establish a connection to my arduino yet. I don't have a usb-serial converter so I tried using the arduino (uno) via software serial and hardware serial (with and without grounding the reset pin). So I thought I'd just try to have the arduino communicate with the esp, using an lcd for the output. This is the code I used
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int count=0;
void setup()
{
Serial.begin(9600);
Serial.setTimeout(5000);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("init");
Serial.println("AT+RST");
}
}
void loop()
{
if (count%16==0) {lcd.setCursor(0,0);}
if(Serial.available()) {
lcd.print(Serial.read());
}
}
I have wired it like this:
esp TX - arduino RX (via level converter)
esp RX - arduino TX (via level converter)
VCC - 3.3v (external power source)
GND - GND
CH_PD - 3.3v
RST - 3.3v
GPIO0 - 3.3v
GPIO2 - 3.3v
the last for are with a 10k resistor.
When I power up the esp while the arduino is listening, the arduino receives gibberish with a "ready" at the end, as it should. However, when I restart the arduino while the esp is already runing, it sends "AT+RST" (at least if I open the serial port on the computer) but receives nothing.
Does that mean that the RX pin on my esp is malfunctioning or am I doing something wrong?