ESP8266 under Windows

I recently got a Windows 8 tablet and sitting on the couch yesterday I realized it might be a good idea to install the Windows toolchain for making ESP8266 programs on it, along with Eclipse. Here’s the story on how to do it!

The instructions are largely based on this Russian blogpost by Mikhail Grigoriev. A video of the development kit in action can be found on YouTube: [su_youtube url=”https://www.youtube.com/watch?v=eWGjADdjH98″]

Step 1: Download and install Mikhail Grigoriev’s Unofficial Development Kit for Espressif ESP8266.

Step 2: Download and install a recent JRE or JDK if you don’t have one installed already. I believe version 7 is the minimum, but go ahead and get 8 since it works perfect too. Get it directly from Oracle.

Step 3: Download and install Eclipse IDE for C/C++ Developers. I’m using Luna SR2, but if a more recent version would be available I’m sure it would work similar. Unpack the archive to the root of your C drive.

Step 4: Download and install MinGW. Get mingw-get-setup.exe from the official SourceForge project. During the installation uncheck the “… also install support for the graphical user interface” option as we won’t be needing it.

Step 5: Mikhail Grigoriev made some awesome scripts to automate the installation of additional modules in MinGW which are needed for compiling. You can download his package here, extract it somewhere and then run install-mingw-package.bat.

Step 6: Start the Eclipse Luna from the directory C:\eclipse\eclipse.exe and in Eclipse, select File > Import > General > Existing Project into Workspace then enter C:\Espressif\examples as the root directory and import the sample projects.

Step 7: If you want autocompletion in Eclipse you’ll need to add the path C:\Espressif\ESP8266_SDK\include\ in your Eclipse settings under Paths and Symbols.

That’s all! Now you’re ready to build any of the sample projects included in this excellent development kit or make your own projects.

14 comments / Add your comment below

  1. Yusuf BAYLAV says:

    Hello, in order to play with easily with ESP8266, I bought a development board with 12 different dips, a few leds, a relay and a few more extra thing on. But could not get any result and getting errors while flashing. I believe that it’s root cause is that I could not correctly set the dips up. Could you please help? I attached the photo of the board and the error’s screenshot. Thanks in advance.

    1. stijnvandrunen says:

      Hi! This is an ESP01, not an ESP12 🙂 The dip switches 2 & 3 (marked DL_MCU & CH_PD_H) should be switched to high, all other can be low. You can also put GPIO0_H up for flashing but it is easier to press the GPIO0 button in the lower right corner of the board and while holding that pressed reset it (top button on the left). Then you can let go of GPIO0 and the chip is in flash mode. Hope this helps!

    1. Ole Schultz says:

      in a text editor open the file settings.mk in the C:EspressifexamplesESP8266
      Find this part and change the COM port number to yours and the baudrate to 115200
      As shown here
      # esptool path and port
      ESPTOOL ?= $(SDK_TOOLS)/esptool.exe
      ESPPORT ?= COM6

      # Baud rate for programmer
      ESPBAUD ?= 115200

  2. Rakesh Awanti says:

    Hi,
    I’m facing a problem with my ESP8266 dev board when I try flash it. This is the error I’m getting..

    15:22:48 **** Build of configuration Default for project hello_world ****
    mingw32-make.exe -f C:/Espressif/examples/hello_world/Makefile flash
    c:/Espressif/utils/esptool.exe -p COM3 -b 256000 write_flash -ff 40m -fm qio -fs 4m 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
    Traceback (most recent call last):
    File “esptool.py”, line 566, in
    File “esptool.py”, line 69, in __init__
    File “serialserialwin32.pyo”, line 38, in __init__
    File “serialserialutil.pyo”, line 282, in __init__
    File “serialserialwin32.pyo”, line 66, in open
    serial.serialutil.SerialException: could not open port ‘COM3’: WindowsError(2, ‘The system cannot find the file specified.’)
    C:/Espressif/examples/hello_world/Makefile:220: recipe for target ‘flash’ failed
    mingw32-make.exe: *** [flash] Error 255

    My ESP8266 is connected to COM8 and changed it in the Makefile, but I’m still getting a similar error,

    mingw32-make.exe -f C:/Espressif/examples/hello_world/Makefile flash
    c:/Espressif/utils/esptool.exe -p COM8 -b 256000 write_flash -ff 40m -fm qio -fs 4m 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
    Traceback (most recent call last):
    File “esptool.py”, line 566, in
    File “esptool.py”, line 69, in __init__
    File “serialserialwin32.pyo”, line 38, in __init__
    File “serialserialutil.pyo”, line 282, in __init__
    File “serialserialwin32.pyo”, line 66, in open
    serial.serialutil.SerialException: could not open port ‘COM8’: WindowsError(5, ‘Access is denied.’)
    C:/Espressif/examples/hello_world/Makefile:220: recipe for target ‘flash’ failed
    mingw32-make.exe: *** [flash] Error 255

    I could not locate the root cause of this problem. I’m hoping you could help me, thanks.

    1. stijnvandrunen says:

      Hi Rakesh,

      It seems that the esptool is called with -p COM3, which leads to this error. Maybe you changed the port in the wrong makefile? You could maybe do a find in files and search for COM3, then replace it with COM8 and you should be all set 🙂

  3. santa2015 says:

    any ideea why the *.bat file doesn’t execute even if I run it with Administrator rights on Windows (right click on the file -> Run As Admin) I get: “Error: To install packages need admin rights.”. I also get “Error: Program “mingw32-make.exe” not found in PATH” in Eclipse if I try to Flash a file

    1. Ravi GTD-Labs says:

      I too had the same problem – I lost patience and executed the ” mingw-get install ” with the required packages (you can see them from the b.bat file.) . It worked for me. Later realized that the bin for the MinGW should be in the path to execute mingw-get.

    2. gthomson says:

      I had the same problem with the admin privs installing on Win 8.1. He’s got it setup to execute an AT command (that probably needs Admin privs to run) and then if there’s an error running it, the .bat exits with the ‘no admin rights’ message.
      AT command has been deprecated in Win 8.1.
      So it probably throws an error regardless of whether or not you are running as admin because of that.
      I just REM’d out all that error checking portion, since I knew I was running as admin. Then it ran fine and installed.

  4. Sunday Ezeilo says:

    Hello,
    I’ve got the tools working (thanks to this developer). My question now is “how can I create my own new project, just like I do in other IDEs?”.
    Thanks in advance!

  5. Sunday Ezeilo says:

    Again, how can I compile to a binary file, and where can I locate it in the project directory?

    Thanks in advance!

  6. Sugandha sharma says:

    Hiello,
    I’m facing a problem with my ESP8266 dev board when I try flash it. This is the error I’m getting..
    18:58:32 **** Build of configuration Default for project hello_world ****
    mingw32-make.exe -f C:/Espressif/examples/ESP8266/hello_world/Makefile flash
    CC driver/uart.c
    CC user/user_main.c
    AR build/app_app.a
    LD build/app.out
    Run objcopy, please wait…
    objcopy done
    Run gen_appbin.exe
    No boot needed.
    Generate eagle.flash.bin and eagle.irom0text.bin successully in folder firmware
    eagle.flash.bin——–>0x00000
    eagle.irom0text.bin—->0x10000
    Done
    c:/Espressif/utils/ESP8266/esptool.exe -p COM3 -b 256000 write_flash -ff 40m -fm qio -fs 8m 0x00000 firmware/eagle.flash.bin 0x10000 firmware/eagle.irom0text.bin
    esptool.py v1.2-dev
    Traceback (most recent call last):
    File “esptool.py”, line 1270, in
    File “esptool.py”, line 1179, in main
    File “esptool.py”, line 71, in __init__
    File “serial__init__.pyo”, line 88, in serial_for_url
    File “serialserialwin32.pyo”, line 63, in open
    serial.serialutil.SerialException: could not open port ‘COM3’: WindowsError(2, ‘The system cannot find the file specified.’)
    ../common_nonos.mk:310: recipe for target ‘flash’ failed
    mingw32-make.exe: *** [flash] Error 255

    18:58:39 Build Finished (took 6s.479ms)

    I have changed the ESPPORT in makefile of Hello world project but still I’m getting this error. I’m unable to resolve it from last 10 days. Please help me out.

    Thankyou

Leave a Reply to Ole Schultz Cancel reply