Connecting ESP8266 ($4 Wifi adapter) to Arduino


I posted…

  • test of SW UART on Arduino pin 6,7 to a 3.3V FTDI cable
  • bring up of the the ESP8266

This post is to combine these 2 and talk to the ESP8266 through the Arduino.   “Sounds simple enough” … famous last words.

Hardware Connection Diagram

If you have read my previous posts, the next diagram is taking pieces from each post and mashing them together.  Here is what I am attempting to get working.


Signal Speed Issue

When I tried sending single characters one at a time, everything worked.  If I tried to send a full command at one time (ie:AT+GMR), mostly only get the first character.  I tried many ideas then added a 100 msec delay between each of the characters being sent.  Here is the code that finally worked….

#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 6); // RX, TX
void setup()
 // Open serial communications and wait for port to open:
void loop() // run over and over
 while (mySerial.available()>0 )
 while (Serial.available()>0 ){

 Carriage Return and Line Feed issue again!

Now I was able to see the ESP8266 echo all my typing, but it would not respond to any commands.  Got caught by the need for CR and LF for each command that tripped me up in one of my earlier posts after updating the ESP8266 firmware.  The serial monitor window of the Arduino tool defaults to “no line ending”.  I changed it to “Both NL &CR” and things starting working.  Here is a screen shot with the setting circled….



Yahooo!!!!!!  I am able have my Arduino talk to my ESP8266.

Next Step

For tomorrow, I am hoping to get the next diagram up and running…



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s