Installing the esp8266 SDK

This is a continuation of my notes on the esp8266 microcontroller, you can find a complete list of my esp8266 posts here

Installing the esp8266 SDK has got a lot easier recently, thanks to the great work of Paul Sokolovsky. I’m using my own fork of his repository. But you’d also be wise to check out the original.

The instructions shown here are for Linux. Currently the esp8266 doesn’t work reliably under Windows, and I’d recommend running the tools in either a Ubuntu virtual machine on Windows or on a real Linux box. The instructions are also for recent versions of Ubuntu (14.04) or Debian. They can easily be adapted for other distributions however.

The instructions below is build the excellent open SDK put together by Paul Sokolovsky. First open a console, then use the following command to install the required dependencies:

sudo apt-get update
sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python sed

You will be prompted for your password, and ask to confirm the installation of the tools. Go for it! Next, it's time to download and build the SDK itself. The following command will take quite some time (up to an hour!) to complete. Before running the installation make sure you have a few Gigabytes of free space. Then enter the following commands, one at a time:

cd $HOME
git clone https://github.com/new299/esp-open-sdk.git
cd $HOME/esp-open-sdk
make STANDALONE=y

Once installed you should make sure the tools are on your path. You can do this by adding them to your .bashrc. Add the following two lines with your favorite text editor e.g.

nano $HOME/.bashrc

:

PATH=$PATH:$HOME/esp-open-sdk/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin
PATH=$PATH:$HOME/esp-open-sdk/Espressif/esptool-py

In order to update your path you will need to start a new terminal. So quit your terminal and restart it.

You can now use the tools as normal. In order to test the SDK you can check out an example project and compile it:

git clone https://github.com/new299/esp-example.git
cd esp-example
make

To flash the code to an esp you can use:

make flash

Please note, the examples above assume the SDK has been installed in your home directory, if you changed the commands above to install the SDK elsewhere, you'll need to make appropriate changes here too.