Generic ESP8266 modules
These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info: ESP8266 Module Family.
Usually these modules have no bootstapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features.
In order to use these modules, make sure to observe the following:
- Provide sufficient power to the module. For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator along with filtering capacitors is preferred.
- Connect bootstapping resistors to GPIO0, GPIO2, GPIO15 according to the schematics below.
- Put ESP8266 into bootloader mode before uploading code.
There are many different USB to Serial adapters / boards. To be able to put ESP8266 into bootloader mode using serial handshaking lines, you need the adapter which breaks out RTS and DTR outputs. CTS and DSR are not useful for upload (they are inputs). Make sure the adapter can work with 3.3V IO voltage: it should have a jumper or a switch to select between 5V and 3.3V, or be marked as 3.3V only.
Adapters based around the following ICs should work:
PL2303-based adapters are known not to work on Mac OS X. See https://github.com/igrr/esptool-ck/issues/9 for more info.
|TX or GPIO2*||RX|
- GPIO15 is also named MTDO
- Reset is also named RSBT or REST (adding PullUp improves the stability of the module)
- GPIO2 is alternative TX for the boot loader mode
- Directly connecting a pin to VCC or GND is not a substitute for a PullUp or PullDown resistor, doing this can break upload management and the serial console, instability has also been noted in some cases.
|TX or GPIO2||RX|
- if no RTS is used a manual power toggle is needed
The ESP module checks at every boot the Pins 0, 2 and 15. based on them its boots in different modes:
|0V||3.3V||3.3V||Boot sketch (SPI flash)|
|3.3V||x||x||SDIO mode (not used for Arduino)|
at startup the ESP prints out the current boot mode example:
rst cause:2, boot mode:(3,6)
- GPIO2 is used as TX output and the internal Pullup is enabled on boot.
the first value respects the pin setup of the Pins 0, 2 and 15.
- number = ((GPIO15 << 2) | (GPIO0 << 1) | GPIO2);