loading

If you want to program an ESP8266 (Wifi SoC) you will normally use a USB to serial adapter like this one. In case you do not have one but you have an Arduino Due laying around you can rig the Arduino as a bridge to program and test the ESP8266. Please be aware it does not make sense to buy an Arduino Due just for this purpose because it is usually more expensive than the FTDI chip (USB to serial).

Arduino Due is in particular good for this purpose because it does not need any level shifters. Arduino Due works at 3.3V which is compatible with the ESP8266. Here you have the steps how to do this:

Step 1: Get Your Materials

This is easy. As the title of this project says, you need an Arduino Due, the ESP8266 chip and some wires.

Step 2: Wiring

The wiring is fairly simple. If you use a switch you can prepare the wiring for both programing and serial monitoring. The wiring is fairly simple. Vcc on ESP8266 goes to 3.3V on Arduino Due. GND from ESP8266 obviously goes to GND on Arduino Due. CH_PD from ESP8266 goes to 3.3V. RX from ESP8266 goes to TX1 on Arduino and the TX from ESP8266 goes to RX1 on Arduino. GPIO0 is connected to GND for programing or disconnected if it's just running the software.

Step 3: Program Arduino Due to Act As a Bridge

This is a very simple step. You need to know at what speed your ESP8266 works. In case you do not know it you can just try. In most of the cases the speed would be either 9600 or 115200. Set Serial1 on Arduino at that speed. Basically the program reads from Arduino main serial and transfer the data back and forth with Serial1 on Arduino Due.

Step 4: Test the Bridge

Once you programmed the Arduino Due you can test the connection with ESP8266. Just open the Serial Monitor and make sure the speed matches the speed you set for Serial (not Serial 1) which is the connection between the computer and Arduino and not between Arduino and ESP8266. ESP8266 is pre-programmed to support a series of AT commands. You can try them.

Step 5: Program the ESP8266

You can use any IDE to program the ESP withe Arduino bridge you just created. In case you want to use Arduino to program the ESP8266 you need to use this release of Arduino. Once installed and made sure you set the port to the one connected to Arduino you need to set ESP8266 as target and the programmer to esptool.

<p>Hi,</p><p>I try to give AT commands to my ESP8266 through Arduino due,But its not responding,the connections are correct,i gave AT cmd via arduino ide serial monitor but esp8266 not showing anything,</p><p>Can you please help me,</p><p>Thanks for Advance</p>
<p>Can you plz look at this</p><p><a href="https://www.instructables.com/community/security-system-not-responding-after-combinin-ultr/" rel="nofollow">https://www.instructables.com/community/security-s...</a></p><p>small help thanks</p>
<p>Alright I have officially tried everything and the conclusion that I am running into is that this is no longer a viable way to program the esp8266 and on top of that I dont think there is support for the esp8266 01. I could be wrong I hope I am but It just is not working. I have worked on this all day but I cant get it. I tried the 1.6.1 ide but I think the problem is the esp8266 core that you used is not gone, I cant find any older versions anymore. It really stinks tho this would have been a great way to program my esp8266. |: if anyone can help it would be appreciated. </p>
<p>Have you seen this: <iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/P_ecAFpUADU" width="500"></iframe></p><p>I hope you are OK by now, but the video is very nice guys! Tony</p>
<p>Just got this working with Arduino IDE 1.6.11 but had to set the PC side speed to 57600 and the ESP side at 115200, the Due does the buffering.Tried it with 115200 both ways and it looked like it uploads but never runs. Had some problems synchronizing the upload and held the due in reset until the UPLOADING starts when re-programming the Due. Took a few goes to program the ESP but it works repeatably now. </p>
<p>can u help me? i tried all the rates but due dont sees the serial1 as available</p>
<p>I'm using arduino 1.6.12 and just cant get it working. The firmware uploads into arduino due but serial monitor shows nothing. can someone helpe me?</p>
<p>Thanks for the article. </p>
<p>I was wondering if maybe you could update this tutorial I am trying to do this very thing and It wont work because esptool is no longer an option for a programmer.</p>
<p>try use Arduino IDE 1.6.1</p><p>I have same error to program Atty86. </p>
<p>How did you add the board support for the arduino 1.6.1 I have always used the boards manager</p>
<p>Thanks for this article!</p><p>Arduino 1.6.4 keeps no &quot;programmer&quot; &quot;esptool&quot; any longer. All other settings under &quot;programmer&quot; don't work with the DUE!</p><p>Always get </p><p>&quot;warning: espcomm_sync failed&quot;<br>&quot;error: espcomm_open failed&quot;</p><p>Any help?</p>
<p>Has anyone figured this out yet?? I am running into this problem now as well</p>
<p>I get this error also :(</p>
<p>Any news? I really need this for my project...</p><p>Rainer from Germany</p>
<p>Some information I missed:</p><p>1. The code works with the Arduino IDE 1.6.1 (now obsolete) specially created for ESP8266. I have not tested this with 1.6.4. </p><p>2. This works exclusively with Arduino Due. Other Arduino boards supporting multiple UART work only at 5V and the ones working at lower voltages (3.3) do not support multiple UART (Serial1 not working). </p>
<p>Couldn't I use an arduino uno (for example) and use voltage dividers or something like the IC CD4050 to make it work?</p>
<p>You can take a look at <a href="http://yaab-arduino.blogspot.com/2015/12/flashing-esp8266-firmware-arduino.html" rel="nofollow">this</a>.</p>
<p>This code doesn't compile. To wit:</p><p>Arduino: 1.6.4 (Windows 8.1), Board: &quot;Arduino Duemilanove or Diecimila, ATmega328&quot;</p><p>sketch_due_serial1.ino: In function 'void setup()':</p><p>sketch_due_serial1:3: error: 'Serial1' was not declared in this scope</p><p>sketch_due_serial1.ino: In function 'void loop()':</p><p>sketch_due_serial1:8: error: 'serial1' was not declared in this scope</p><p>sketch_due_serial1:9: error: 'Serial1' was not declared in this scope</p><p>sketch_due_serial1:14: error: 'Serial1' was not declared in this scope</p><p>'Serial1' was not declared in this scope</p>
<p>The Problem Is Arduino Due and Duemilanove is not The Same Board.... U need To Install Arduino Due Board from the Board Manager and Use Arduino Due Programming Port :D Cheers.</p>
<p>Nice quick giude too check my ESP8266's... </p>
<p>Nice. Why not just post the Due code as text, though?</p>
<p>This is a really cool idea! I love all sorts of arduino projects! Thanks for sharing.</p>

About This Instructable

62,445views

70favorites

License:

More by anistor:Illuminance Monitor with ESP8266 - IoT Temperature Monitor with ESP8266 - IoT Basic Security with ESP8266 - IoT 
Add instructable to: