Installing the ESP8266 SDK under Ubuntu 14.04 and Windows and Eclipse

Update 4-4-2016

Some of you may have heard of the Jantje Arduino plugin for Eclipse. He has released V3 recently and that supports the ESP8266. You can now download a version for either Windows, Linux and Mac Osx. If you are used to Eclipse you should have no problem using it. And it works like a charm. I use them for programming the nodeMCU’s and the 4Mbytes version is supported. No need to make it more complicated than it is.

Here is the link to Jantje’s plugin site : http://www.baeyens.it/eclipse/

Update  13-12-2014

For those wanting to develop for the ESP8266 under Windows & Eclipse follow the instructions on this link. Works like a charm.

Update 30-10-2014

Thanks to Zarya, some small bugs / modifications are fixed. The installation should be straight forward now:

Building the toolchain

I followed this excellent link: Building the toolchain

If you are unfamiliar with Ubuntu I would get some basic done before continuing. Understand at least how to open a terminal program and how to get root priviliges as some steps need to be performed as “root”. Most of the work consists of copying the instructions and pasting them in the terminal program (CTRL+SHIFT+V).The build process takes about 22 minutes on my laptop.

Installing the ESP tool did not work for me so I downloaded the files from GITHUB (the link is in the text) and built it myself:


download the zip file
unpack it (I unpacked it in the /opt/Espressif folder)
go to the folder
type "make clean <RETURN>"
type "make <RETURN>"
both without the quotation marks

Building the AT example

This is the code that allows you to use the ESP8266 module as an interface to WiFi through serial AT commands.

The make fails generating the bin files (flash files). The cause is that the make file points to /usr/bin/esptool and I installed in /opt/Espressif/esptool. For this case I will make a copy of esptool itself to /usr/bin.

now got to the ~/esp_sources/at folder and type make<RETURN> there are now 2 bin files in the subfolder “firmware”.

Installing Eclipse

As I also compile Arduino projects in Eclipse I prefere Jantje’s eclipse plugin for Arduino. I used the latest overnight build from here.

I just download it and unpack it in my home folder. But any folder in your environment will work. Eclipse also needs a JRE (Java Runtime Environment). As I did not have installed yet, I simply download the latest version, unpack it and store it in the eclipseArduino folder. Not the ideal way but it works fine :).

EclipseArduino may be started now. Eclipse will ask for a workspace where all eclipse projects will be stored. Just create one where you like. I always put it in Documents.

We are almost done.

Import the AT example project in eclipse

First we create a project. for example AT_example

steps:

  • file->new->project
  • open C/C+=
  • select makefile Project with existing code
  • select next
  • for projectname enter “AT_example”
  • for existing code location browse to where you stored the AT example in esp_sources folder (in m,y case it would be “/home/nico/esp_sources/at”
  • for “toolchain for indexer settings” select “none”.
  • click finish and you are done.

Build the AT example

In Eclipse project explorer you will see your created project. You can for example select through the menu  “project->clean” to reset all file flags. The you could now compile the project “project->build project” and the binaries will be built.

Done!!!!!!

update 27-10-2014 Update for SDK 0.9.2

Of course once you understand how it works…. the SDK changes. The installation is still the same but a small problem arises in the final build of AT (haven’t tried the IoT_demo yet). The compilation goes well, but the final link fails as it is missing 2 libraries. These are  libupgrade.a and libupgrade_ssl.a. The libraries are installed but the makefile does not reference them.

The easiest way to fix this is to edit this line in the make file and change

LIBS        = c gcc hal phy net80211 lwip wpa main 

into

LIBS		= c gcc hal phy net80211 lwip wpa main upgrade upgrade_ssl

 

Installing with SDK 0.9.1

Having played around enough to get the nag of it, today I will show you how I installed the SDK under Ubuntu and building/compiling programs with Eclipse Keppler. I prefer Eclipse as this also allows me to program the Atmel 8-bit family of processors in a decent environment and I like the supporting plugins like “Jantjes ArduinoEclipse plugin”, “Doxygen” and  “CVS” as I use these tools as well in the Windows7 enviroment. At the same time I can alsu build/update/modify the demo programs.

My machine:

  • 64 Bit dual core laptop with Windows7 and Unbuntu 14.04.
  • Total disk capacity 1.5 TB (Ubuntu has 150Gb assigned to it as this is more than enough
  • 4Gb RAM memory

Prerequisites

Unbuntu installed. I am starting with a fresh installation and documenting the steps as I go.

Building the toolchain

I followed this excellent link: Building the toolchain

If you are unfamiliar with Ubuntu I would get some basic done before continuing. Understand at least how to open a terminal program and how to get root priviliges as some steps need to be performed as “root”. Most of the work consists of copying the instructions and pasting them in the terminal program (CTRL+SHIFT+V).The build process takes about 22 minutes on my laptop.

There is a small error in the instructions:

as local user:

/opt/Espressif
git clone -b lx106 git://github.com/jcmvbkbc/crosstool-NG.git 
cd crosstool-NG
./bootstrap && ./configure --prefix=`pwd` && make && make install
./ct-ng xtensa-lx106-elf
./ct-ng build

should be:

cd /opt/Espressif
git clone -b lx106 git://github.com/jcmvbkbc/crosstool-NG.git 
cd crosstool-NG
./bootstrap && ./configure --prefix=`pwd` && make && make install
./ct-ng xtensa-lx106-elf
./ct-ng build

From here on just continue the steps.

Installing the ESP tool did not work for me so I downloaded the files from GITHUB (the link is in the text) and built it myself:


download the zip file
unpack it (I unpacked it in the /opt/Espressif folder)
go to the folder
type "make clean <RETURN>"
type "make <RETURN>"
both without the quotation marks

Building the AT example

This is the code that allows you to use the ESP8266 module as an interface to WiFi through serial AT commands.

The make fails generating the bin files (flash files). The cause is that the make file points to /usr/bin/esptool and I installed in /opt/Espressif/esptool. For this case I will make a copy of esptool itself to /usr/bin.

now got to the ~/esp_sources/at folder and type make<RETURN> there are now 2 bin files in the subfolder “firmware”.

Installing Eclipse

As I also compile Arduino projects in Eclipse I prefere Jantje’s eclipse plugin for Arduino. I used the latest overnight build from here.

I just download it and unpack it in my home folder. But any folder in your environment will work. Eclipse also needs a JRE (Java Runtime Environment). As I did not have installed yet, I simply download the latest version, unpack it and store it in the eclipseArduino folder. Not the ideal way but it works fine :).

EclipseArduino may be started now. Eclipse will ask for a workspace where all eclipse projects will be stored. Just create one where you like. I always put it in Documents.

We are almost done.

Import the AT example project in eclipse

First we create a project. for example AT_example

steps:

  • file->new->project
  • open C/C+=
  • select makefile Project with existing code
  • select next
  • for projectname enter “AT_example”
  • for existing code location browse to where you stored the AT example in esp_sources folder (in m,y case it would be “/home/nico/esp_sources/at”
  • for “toolchain for indexer settings” select “none”.
  • click finish and you are done.

Build the AT example

In Eclipse project explorer you will see your created project. You can for example select through the menu  “project->clean” to reset all file flags. The you could now compile the project “project->build project” and the binaries will be built.

The next time I will show how to modify/create your own AT commands. Enabling to expand AT. I have not figured out how to create a simple plugin that would allow the creation of a new project.

 

 

 

 

 

Één reactie op Installing the ESP8266 SDK under Ubuntu 14.04 and Windows and Eclipse

  1. Pingback: Installing ESP8266 under Ubuntu and using Eclipse to build projects | Nico Verduin's website

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *