ESP8266 Support WIKI

User Tools

Site Tools


start-with-esp-12-arduino

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start-with-esp-12-arduino [2018/03/23 19:10]
jpascher [Setup an start test program blink]
start-with-esp-12-arduino [2018/08/26 17:47] (current)
rudy More explanation, format changes, and corrected some minor misspellings etc
Line 1: Line 1:
-====== ​Start with the ESP-12 and the Arduino tools ======+====== ​Starting ​with the ESP-12 and the Arduino tools ======
 ===== Hardware ===== ===== Hardware =====
-{{::​usb-to-esp8266-serial-wireless-wifi-module-developent-board-8266-wifi-module.jpg_640x640.jpg?​100}}{{:​esp8266_flash_prog_board_sch.png?​300|}}{{:​12-01.jpg?​200|}} +{{::​usb-to-esp8266-serial-wireless-wifi-module-developent-board-8266-wifi-module.jpg_640x640.jpg?​100}}{{:​verbindungen-8266.png?​300|}}{{:​12-01.jpg?​100|}}{{:​esp-8266-belegung.png?200|}} 
-  * [[esp8266-module-family#​esp-12|ESP-12E module]] ​depending on module type additional wiring with resistors ​may varyA few resistors ​have to be added to module ​12EOn modules on next generation 12S or newer resistors may be on board or if the withe breakout board (http://​thethingofinternets.com/?​p=4) is used two resistors are on the board.  + 
-  * 12E needs:  +  * A few resistors have to be added to the [[esp8266-module-family#​esp-12|ESP-12E module]] ​for proper operation. 
-  one 10k resistor ​from GPIO to GND,  +    * These resistors ​control the mode of operation at reset With these resistors ​installed, the module will operate in normal mode after reset. ​ The resistors can be overpowered ​to disable the module ​or reboot in a programming mode to upload new programming. 
-  one 10k from EN (or labeled CH_PD) ​to VCC,  +    * If you are using a next generation 12S or newer module, ​resistors may already ​be on the module. 
-  one 10k from GPIO0 to VCC,  +    * If you are using a chinese white breakout board, the resistors are already included
-  one 4k7 from RST to GPIO16. +    The ESP-12E required resistors are
-  * 3.3V power supply or supply ​from adapter +      * Pullup resistors connect to VCC (3.3V) and pulldown resistors connect to GND 
-  * USB-serial adapter ​( ESP8266 ESP Serial WiFi Adaptor Module CH340G Driver ) this one has swish for programming on board. ​USB zu (ESP8266 seriell Adapter ESP01 Programmierer ESP UART Arduino) also can be used is nearly ​the same sure others also will workjust make sure the have lever changer on board+      ​* 10k pulldown ​resistor ​on the GPIO pin 
-  * If programming ​swish is missing one has to add the two jumpers or the switch+      * 10k pullup resistor on the EN pin (may be labeled CH_PD) 
-  * Connect ​adapter  +      * 10k pullup resistor on the GPIO0 pin 
-  * RXD from adapter to TX on ESP12E ​and  +      10k pullup resistor on the GPIO2 pin 
-  * TXD from adapter to RX on ESP12E +  * ESP modules need either an external ​3.3V power supply or a 3.3V regulator on the breakout board 
-  * GND to GND and  +    * If you are using a chinese white breakout board the PC board wiring is incorrect, so don't solder a regulator onto the board without first reading http://​thethingofinternets.com/?​p=4 for an important note. The simplest solution is to use an external regulated 3.3V supply ​with these boards. 
-  * VCC 3.3V to VCC 3.3V of ESP12E if supply from the adapter is in use or an external 3.3V supply+    * Additional Capacitors between VCC and GROUND should also be added for more stability. 1nF plus 1000uF aluminium electrolytic capacitor proved to be best. 
-  * Additional Capacitors should also be added for more stability. 1nF plus 1000uF aluminium electrolytic capacitor proved to be best.  +  * To program the module, you will need a USB-to-serial adapter 
-  * To use programming switch and reset switch from the adapter one also has to connect this two wires from adapter to the ESP12E. +    * There are many USB to serial adapters - most adapters are identified by the name of the adapter chip 
-  ​+    * The most common USB to Serial chips are the CH340G or various chips from FTDI 
 +    * Make sure your serial adapter supports 3.3Vor use level shifter to allow 3.3V operation 
 +  * When programming, the GPIO0 pin has to be held low during reset to enable programming mode 
 +    * Some breakout boards include pushbuttons or jumpers 
 +      * For programing mode: While holding ​the FLASH button down, momentarily press "​RESET",​ then  release the FLASH button 
 +      * For normal mode: press RESET without also pressing FLASH 
 +    * Some USB to Serial adapters allow using two of the serial handshake signals to allow the programming software to reset the module and pulldown GPIO0 during reset so you don't need to use jumpers or push any buttons during programming. 
 +    * You can also manually wire your own jumpers and/or switches for reset and GPIO0 
 +  * Summary 
 +    * Wire up Reset and GPIO0 Programming switch 
 +      * If you are using a programming switch and reset switch from the adapter, connect these from the adapter to the ESP12E. 
 +    * RXD from adapter to TX on ESP12E 
 +    * TXD from adapter to RX on ESP12E 
 +    * GND from adapter ​to GND on ESP12E 
 +    * VCC 3.3V from adapter ​to VCC 3.3V of ESP-12E (or the external 3.3V supply ​powering ​the ESP-12E module)
  
 ===== Software ===== ===== Software =====
Line 25: Line 39:
   * [[https://​github.com/​esp8266/​Arduino|Arduino esp8266 platform]]   * [[https://​github.com/​esp8266/​Arduino|Arduino esp8266 platform]]
  
-===== Setup an start test program ​blink =====+===== Setup and test using the "blink" example ​=====
  
-  * Connect Hardware as shown in description Hardware on top here.  +  * Connect Hardware as shown above 
-  * Plugin Adapter to USB and check in Windows with Hardware ​manager that the added COM port ist working. And verify ​the COM"​XX"​ it is using+  ​* Check serial adapter 
-  * Install ​Arduino form "https://​www.arduino.cc/​en/​Main/​Donate" ​ +    ​* Plugin Adapter ​(without ESP connected) ​to USB and check in Windows ​(with device ​managerthat you can see the new COM port 
-  * Open in Arduino "​File"​ -> "​Preferences"​ window and add in an additional Board Manager URL: http://​arduino.esp8266.com/​versions/​2.3.0/​package_esp8266com_index.json  +    * If the device is not recognized, you will need to install a driver for your USB-to-serial adapter 
-  Type in "​esp8266" ​and select ​the correct chip in the popup window.  ​ +    * You can use Putty to test the COM port with RXD and TXD connected together. This will give you an echo on the terminal: everything you type is immediately visible in the terminal
-  * Open in Arduino "​Tools"​ -> Board:"xxxxxxx"​ Board manager window and find Board name: "​NodeMCU 1.0 (ESP-12E Module)"​ +  * Install ​the [[https://​www.arduino.cc/​en/​Main/​Donate|Arduino development tools]] 
-  Open in Arduino "​Tools"​ -> PORT:"​xxx"​ the port your Adapter is on.  +  * Open the Arduino "​File"​ -> "​Preferences"​ window and add in an additional Board Manager URL: http://​arduino.esp8266.com/​stable/​package_esp8266com_index.json 
-  * Open in Arduino ​"​File"​ -> "​Examples" ​and find -> "​Examples for NodeMCU 1.0 (ESP-12E Module)"​ ->  and then "​ESP8266"​ -> then"​BlinkWithoutDelay" ​Example+    If you need multiple entries ​in this list (for example if you have an entry for another platform), you can add multiple URLs by separating them with commas 
-  * Turn on the program ​swish on on the board or an the adapter.  +    * After you enter the URL, press OK to close the dialog ​and save the change 
-  * In Arduino push the upload (Blue error ->) and wait until 100% is reached. While uploading the blue LED on the board is flashing. +  * Open Arduino "​Tools"​ -> "Board:​xxxxxxx" -> "​Board ​Manager"​ 
-  * Turn on the program ​swish off on the board or on the adapter. ​ +    * Change the "​Type"​ in the upper left to "​Contributed"​ 
-  * Push reset on the Board or an the Adapter. Maybe a additional power of an on is also needed+    * Type "​esp8266"​ in the filter box 
-  * Now the on board Led should ​be flashing+    * Select ​"​NodeMCU 1.0 (ESP-12E Module)" ​and press the "​Install"​ button 
-  * Adapter can be removed now and programmed module can be used with external 3.3V supply. ​+    NOTE: you could alternatively install the latest Master version from Git as explained here: https://​github.com/​esp8266/​Arduino 
 +  * In "​Tools"​ -> PORT:"​xxx" ​select ​the correct COM port for your serial adapter 
 +  * Open "​File"​ -> "​Examples"​ -> "​Examples for NodeMCU 1.0 (ESP-12E Module)"​ -> "​ESP8266"​ -> "​BlinkWithoutDelay"​ 
 +  * Add the following Line on top of the example:\\ **#define LED_BUILTIN 2** 
 +    * This is needed because the example is written for a ESP-01 module and not for ESP-12. The blue LED is on internal PIN 2 not on PIN 1. 
 +    * There seems to be some confusion on Port numbering. On the board this pin is labeled TXD0
 +  * Turn on the program ​switch ​on the board or on the adapter ​and push reset
 +  * In Arduino push the upload ​button ​(Blue arrow ->) and wait until 100% is reached. While uploading the blue LED on the board is flashing. 
 +  * Turn the program ​switch ​off and  push reset - you might need to cycle the power off and on 
 +  * If everything worked correctly, ​the blue LED should be flashing fast - Congratulations! Unfortunately ​the blue Led is also flashing slower if something went wrong
 +  * You also can watch the serial output ​on the Terminal within Arduino: 
 +    * go to "​Tools"​ -> "​Serial Monitor"​ change to 74880 Baud do a reset again. 
 +    * Output message from the ESP-12E ​should ​appear just one time and not repeated like this:\\ {{:​terminal-log.png?​100|}} 
 +    * If repeated output happens the board is rebooting, and something is wrong with the program or wiring
 +  * Adapter can be removed now and programmed module can be used with an external 3.3V supply.
start-with-esp-12-arduino.1521832208.txt.gz · Last modified: 2018/03/23 19:10 by jpascher