(Mega) Only receiving ERROR message from ESP
Posted: Tue Dec 09, 2014 8:22 am
I am trying to interface the Arduino Mega with an ESP8266. My connections are as follows:
I am using this code to send and receive messages--basically just the Software Serial example--with a debugging cable from the Arduino to the computer that I am using to send messages to mySerial.
On every valid command I try (even just plain "AT") I get ERROR. Some things to note:
Could anyone pinpoint what I am doing wrong here?
- RX -> Pin 1 (TX)
- TX -> Pin 0 (RX)
- GND -> GND
- VCC -> 3.3V
- Four middle pins -> 3.3V
I am using this code to send and receive messages--basically just the Software Serial example--with a debugging cable from the Arduino to the computer that I am using to send messages to mySerial.
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
On every valid command I try (even just plain "AT") I get ERROR. Some things to note:
- My module is definitely 9600 baud, the other bauds don't send comprehensible messages.
- When I don't enter a valid command, I get "wrong syntax", which is correct.
- The blue light blinks whenever I enter a command.
- I have gotten the startup message before by toggling the reset pin, but still get ERROR afterwards.
Could anyone pinpoint what I am doing wrong here?