ESP8266 is a new SOC(System On Chip) WiFi module from Espressif that works in similar way to modems, it’s controlled by AT commands through serial port.
Well, it’s actually more than that. You can write your own custom software that runs on this small, yet powerful device. It’s like arduino that has more power, WiFi buil’t in but only few pinouts(unless you use other versions which are pretty hard to run without proper soldering training)
There’s esp8266 wiki that describes how to prepare build environment but its Linux only, so I decided to write small tutorial on how to do that on Windows.
1. Download cygwin installer and run it [Exe]
2. Install Python 2.7 from https://www.python.org/
3. Install git [Optional, would be easier to do further steps, add git.exe to your PATH.
4. Create folder for your esp development
Keep your 8266 stuff in one place, including toolchain, compiler and projects, create folder C:\Projects\esp8266
5. Download compiled toolchain
Google drive: https://drive.google.com/folderview?id=0BzWyTGWIwcYQendHbWlsNUZpX0E&usp=drive_web#list\
Extract it to “C:\Projects\esp8266\xtensa-lx106-elf”, you need to have 7zip handling software to unpack this file.
Its made by mobyfab from esp8266.com
These are apperently x64 binaries so no hope for you if you are using 32 bit machine.
7. Download helper files from my repository https://github.com/toomasz/esp8266_stuff
and extract them to c:\Projects\esp8266\esp8266_stuff
8. Edit file C:\Projects\esp8266\esp8266_stuff\espmake.sh
and change variables so they reflect your buildsystem(you don’t have to do it if you used same folders as mine):
TOOLCHAIN=c:/Projects/esp8266/tools/xtensa-lx106-elf/bin SDK=c:/Projects/esp8266/Espressif/ESP8266_SDK INCDIR='-Iinclude' ESPTOOL=/bin/esptool
9. Download esptool.exe
and put it into C:/Cygwin/bin
10. Add C:\Projects\esp8266\esp8266_stuff and python to your PATH variable
I recommend using some tool for editing PATH variable, for example rapid environment editor.
11. Download missing libwinpthread-1.dll that in neccesary to run compiler.
Download it from: https://drive.google.com/file/d/0B-lM6D5uRWgBWnN1akVmOHZNSkU/view?usp=sharing
Sorry to exe link to my google account but I don’t remember where I downloaded this one and it seems like the only libwinpthread-1.dll one that works, dll-files.com one doesn’t work.
Put it to: c:\Projects\esp8266\esp8266_stuff\
12. Try to compile example project
Download AT Example from Espressif: AT Example
And put it to c:\Projects\esp8266\projects\at\
Replace ‘retarded’ Makefile with this one https://gist.github.com/fpoussin/73e3bf45846bec1e5a08/download#
Now close all programs on your computer(as a precaution regarding PATH variable).
And edit new makefile, add upgrade upgrade_ssl to libs:
# libraries used in this project, mainly provided by the SDK LIBS = c gcc hal phy net80211 lwip wpa main upgrade upgrade_ssl
Run cmd, Cd to C:\Projects\esp8266\projects\at and run espmake -B
If you see the following, you are good to go
espmake.bat uses same arguments as make, so you can call for example make -B to rebuild.