Programming ESP-01 (ESP8266)

I was inspired by several DIY projects. The ESP8266 WiFi 802.11 b/g/n Module is a self contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor.
This post describes step-by-steps instructions on how to program ESP-01 board in the following chapters:

  1. HW Setup
  2. SW Setup (Arduino IDE)
  3. Uploading a programm to ESP8266


Check also my my ESP8266 projects where I used this ESP-01 programmer:

From all the ESP8266 board family I chose ESP01.
ESP01

HW setup

You have simple option to just connect you ESP01 with cables:
esp8266 with female wires

The other way is to buy or create a programming board

ESP pin out is quite simple. To make developing with the ESP-01 module easier, I created a basic development board. It provides double access to all individual pins, has button for flashing mode (GPIO00) and CH_PD is enabled by default. It offers a button for reset and also separate header for TTL-USB Converter.

Pin out and photos of new board in progress:
esp-01-pinsESP01-development_board-inpprogressESP01-development_board-inpprogress2

Final ESP01 development/programming board:
ESP01-development_board-finalESP01-development_board-final2

Other development board that inspired me: tim.jagenberg.info/2015/01/18/low-power-esp8266/

SW setup (Arduino IDE)

As I’m used to Arduino IDE, I installed ESP boards following the instractions in https://github.com/esp8266/Arduino:

    1. Install Arduino 1.6.5 from the Arduino website. NOTE: higher versions do NOT work. (as of Jan 2016)
    2. Start Arduino and open Preferences window.

arduino-ESP

    1. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.

arduino-ESP2

    1. Open Boards Manager from Tools > Board menu and install esp8266 platform (takes a while)
      arduino-ESP3
    2. Select your ESP8266 board from Tools > Board menu after installation.

arduino-ESP4

 

Uploading to the ESP8266

To upload your compiled program to the ESP8266:

  1. Disconnect power to the ESP
  2. Bring GPIO0 to ground (turn on switch button on the board) – ESP starts in uploading mode.
  3. Power up the ESP (press the restart button on the board)
  4. Release the pushbutton
  5. Click the play button in Arduino IDE (right arrow icon) to upload the program

When it works, you should see the tiny blue light on the ESP-01 module flashing and the following display on the Arduino IDE.
ESP-uploading

Done. Now I can easily upload any program to ESP8266 ESP-01 board. 😎
Check my my first IoT ESP8266 temperature humidity sensor project.

Complications

  1. My first attempt to connect to the ESP (without the board) was not successful. I have forgoten to connect CH_PD with VCC.
  2. ESP8826 was continuously restarting with the following messages:
    ets Jan  8 2013,rst cause:4, boot mode:(3,7)
    
    wdt reset
    load 0x40100000, len 816, room 16
    tail 0
    chksum 0x8d
    load 0x3ffe8000, len 788, room 8
    tail 12
    chksum 0xcf
    ho 0 tail 12 room 4
    load 0x3ffe8314, len 288, room 12
    tail 4
    chksum 0xcf
    csum 0xcf
    
    2nd boot version : 1.2
      SPI Speed      : 40MHz
      SPI Mode       : QIO
      SPI Flash Size : 4Mbit
    jump to run user1
    
    sdŽC˙
    Ai-Thinker Technology Co. Ltd.
    
    invalid 
    

    I have changed the power source to the better one and problems are gone. 😎

References:
learn.adafruit.com/esp8266-temperature-slash-humidity-webserver
https://github.com/esp8266/Arduino
tzapu.com/minimalist-battery-powered-esp8266-wifi-temperature-logger/
www.esp8266.com/wiki/doku.php?id=esp8266-module-family
lantaukwcounter.blogspot.sk/2015/05/programming-esp8266-with-arduino-ide.html


Related Posts

Battery Powered ESP8266 IoT – Temperature Sensor

ESP8266 battery DHT5

Since my latest ESP8266 temperature humidity IoT logger project is up and running I have decided to cut the last wire – power. There are more approaches how to make ESP8266 running on a battery,[…]

Continue reading ...

Battery Powered Wifi IoT – Temperature, Humidity & Soil Moisture Sensors

DSC_0177

I have just made a prototype of ESP8266 (ESP-01) IoT temperature & humidity SI7021 sensor and also 2x three pin soil moisture sensors with only 0.006mA (6µA) current drain during the sleep.

Continue reading ...

ESP8266 Temperature Humidity IoT Logger

ESP8266-temperature2

I learned how to program ESP8266 so I created my first temperature IoT ESP8266 project. I used DHT22 as a temperature and humidity sensor and also I did some testing of power consumption using LIGHT SLEEP[…]

Continue reading ...