{"id":547,"date":"2014-10-15T15:43:24","date_gmt":"2014-10-15T13:43:24","guid":{"rendered":"http:\/\/www.verelec.nl\/?page_id=547"},"modified":"2016-04-14T20:47:27","modified_gmt":"2016-04-14T18:47:27","slug":"installing-the-esp8266-sdk-under-ubuntu-14-04-and-eclipse","status":"publish","type":"page","link":"https:\/\/www.verelec.nl\/?page_id=547","title":{"rendered":"Installing the ESP8266 SDK under Ubuntu 14.04  and Windows and Eclipse"},"content":{"rendered":"<p><strong>Update 4-4-2016<\/strong><\/p>\n<p>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&#8217;s and the 4Mbytes version is supported. No need to make it more complicated than it is.<\/p>\n<p>Here is the link to Jantje&#8217;s plugin site :\u00a0<a href=\"http:\/\/www.baeyens.it\/eclipse\/\">http:\/\/www.baeyens.it\/eclipse\/<\/a><\/p>\n<p><strong>Update\u00a0 13-12-2014<\/strong><\/p>\n<p>For those wanting to develop for the ESP8266 under Windows &amp; Eclipse follow the instructions on <a title=\"Develop ESP8266 under Windows with Eclipse\" href=\"http:\/\/www.esp8266.com\/viewtopic.php?f=9&amp;t=820&amp;sid=783b2f3021078ab65722108fdfadd5d8\" target=\"_blank\">this<\/a> link. Works like a charm.<\/p>\n<p><strong>Update 30-10-2014<\/strong><\/p>\n<p>Thanks to Zarya, some small bugs \/ modifications are fixed. The installation should be straight forward now:<\/p>\n<p><strong>Building the toolchain<\/strong><\/p>\n<p>I followed this excellent link: <a href=\"https:\/\/github.com\/esp8266\/esp8266-wiki\/wiki\/Toolchain\">Building the toolchain<\/a><\/p>\n<p>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 &#8220;root&#8221;. 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.<\/p>\n<p>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:<\/p>\n<pre><code>\r\ndownload the zip file\r\nunpack it (I unpacked it in the \/opt\/Espressif folder)\r\ngo to the folder\r\ntype \"make clean &lt;RETURN&gt;\"\r\ntype \"make &lt;RETURN&gt;\"\r\nboth without the quotation marks\r\n<\/code><\/pre>\n<p><strong>Building the AT example<\/strong><\/p>\n<p>This is the code that allows you to use the ESP8266 module as an interface to WiFi through serial AT commands.<\/p>\n<p>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.<\/p>\n<p>now got to the ~\/esp_sources\/at folder and type make&lt;RETURN&gt; there are now 2 bin files in the subfolder &#8220;firmware&#8221;.<\/p>\n<p><strong>Installing Eclipse<\/strong><\/p>\n<p>As I also compile Arduino projects in Eclipse I prefere Jantje&#8217;s eclipse plugin for Arduino. I used the latest overnight build from <a href=\"http:\/\/www.baeyens.it\/eclipse\/download.php\">here<\/a>.<\/p>\n<p>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 :).<\/p>\n<p>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.<\/p>\n<p>We are almost done.<\/p>\n<p><strong>Import the AT example project in eclipse<\/strong><\/p>\n<p>First we create a project. for example AT_example<\/p>\n<p>steps:<\/p>\n<ul>\n<li>file-&gt;new-&gt;project<\/li>\n<li>open C\/C+=<\/li>\n<li>select makefile Project with existing code<\/li>\n<li>select next<\/li>\n<li>for projectname enter &#8220;AT_example&#8221;<\/li>\n<li>for existing code location browse to where you stored the AT example in esp_sources folder (in m,y case it would be &#8220;\/home\/nico\/esp_sources\/at&#8221;<\/li>\n<li>for &#8220;toolchain for indexer settings&#8221; select &#8220;none&#8221;.<\/li>\n<li>click finish and you are done.<\/li>\n<\/ul>\n<p><strong>Build the AT example<\/strong><\/p>\n<p>In Eclipse project explorer you will see your created project. You can for example select through the menu\u00a0 &#8220;project-&gt;clean&#8221; to reset all file flags. The you could now compile the project &#8220;project-&gt;build project&#8221; and the binaries will be built.<\/p>\n<p><strong>Done!!!!!!<\/strong><\/p>\n<p><strong>update 27-10-2014 Update for SDK 0.9.2<\/strong><\/p>\n<p>Of course once you understand how it works&#8230;. the SDK changes. The installation is still the same but a small problem arises in the final build of AT (haven&#8217;t tried the IoT_demo yet). The compilation goes well, but the final link fails as it is missing 2 libraries. These are\u00a0 libupgrade.a and libupgrade_ssl.a. The libraries are installed but the makefile does not reference them.<\/p>\n<p>The easiest way to fix this is to edit this line in the make file and change<\/p>\n<pre><code>LIBS\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0= c gcc hal phy net80211 lwip wpa main <\/code><\/pre>\n<p>into<\/p>\n<pre><code>LIBS\t\t= c gcc hal phy net80211 lwip wpa main upgrade upgrade_ssl<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Installing with SDK 0.9.1<\/strong><\/p>\n<p>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 &#8220;Jantjes ArduinoEclipse plugin&#8221;, &#8220;Doxygen&#8221; and\u00a0 &#8220;CVS&#8221; as I use these tools as well in the Windows7 enviroment. At the same time I can alsu build\/update\/modify the demo programs.<\/p>\n<p><strong>My machine:<\/strong><\/p>\n<ul>\n<li>64 Bit dual core laptop with Windows7 and Unbuntu 14.04.<\/li>\n<li>Total disk capacity 1.5 TB (Ubuntu has 150Gb assigned to it as this is more than enough<\/li>\n<li>4Gb RAM memory<\/li>\n<\/ul>\n<p><strong>Prerequisites<\/strong><\/p>\n<p>Unbuntu installed. I am starting with a fresh installation and documenting the steps as I go.<\/p>\n<p><strong>Building the toolchain<\/strong><\/p>\n<p>I followed this excellent link: <a href=\"https:\/\/github.com\/esp8266\/esp8266-wiki\/wiki\/Toolchain\">Building the toolchain<\/a><\/p>\n<p>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 &#8220;root&#8221;. 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.<\/p>\n<p>There is a small error in the instructions:<\/p>\n<h2>as local user:<\/h2>\n<pre><code>\/opt\/Espressif\r\ngit clone -b lx106 git:\/\/github.com\/jcmvbkbc\/crosstool-NG.git \r\ncd crosstool-NG\r\n.\/bootstrap &amp;&amp; .\/configure --prefix=`pwd` &amp;&amp; make &amp;&amp; make install\r\n.\/ct-ng xtensa-lx106-elf\r\n.\/ct-ng build\r\n<\/code><\/pre>\n<p><em><strong>should be:<\/strong><\/em><\/p>\n<pre><code>cd \/opt\/Espressif\r\ngit clone -b lx106 git:\/\/github.com\/jcmvbkbc\/crosstool-NG.git \r\ncd crosstool-NG\r\n.\/bootstrap &amp;&amp; .\/configure --prefix=`pwd` &amp;&amp; make &amp;&amp; make install\r\n.\/ct-ng xtensa-lx106-elf\r\n.\/ct-ng build\r\n<\/code><\/pre>\n<p>From here on just continue the steps.<\/p>\n<p>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:<\/p>\n<pre><code>\r\ndownload the zip file\r\nunpack it (I unpacked it in the \/opt\/Espressif folder)\r\ngo to the folder\r\ntype \"make clean &lt;RETURN&gt;\"\r\ntype \"make &lt;RETURN&gt;\"\r\nboth without the quotation marks\r\n<\/code><\/pre>\n<p><strong>Building the AT example<\/strong><\/p>\n<p>This is the code that allows you to use the ESP8266 module as an interface to WiFi through serial AT commands.<\/p>\n<p>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.<\/p>\n<p>now got to the ~\/esp_sources\/at folder and type make&lt;RETURN&gt; there are now 2 bin files in the subfolder &#8220;firmware&#8221;.<\/p>\n<p><strong>Installing Eclipse<\/strong><\/p>\n<p>As I also compile Arduino projects in Eclipse I prefere Jantje&#8217;s eclipse plugin for Arduino. I used the latest overnight build from <a href=\"http:\/\/www.baeyens.it\/eclipse\/download.php\">here<\/a>.<\/p>\n<p>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 :).<\/p>\n<p>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.<\/p>\n<p>We are almost done.<\/p>\n<p><strong>Import the AT example project in eclipse<\/strong><\/p>\n<p>First we create a project. for example AT_example<\/p>\n<p>steps:<\/p>\n<ul>\n<li>file-&gt;new-&gt;project<\/li>\n<li>open C\/C+=<\/li>\n<li>select makefile Project with existing code<\/li>\n<li>select next<\/li>\n<li>for projectname enter &#8220;AT_example&#8221;<\/li>\n<li>for existing code location browse to where you stored the AT example in esp_sources folder (in m,y case it would be &#8220;\/home\/nico\/esp_sources\/at&#8221;<\/li>\n<li>for &#8220;toolchain for indexer settings&#8221; select &#8220;none&#8221;.<\/li>\n<li>click finish and you are done.<\/li>\n<\/ul>\n<p><strong>Build the AT example<\/strong><\/p>\n<p>In Eclipse project explorer you will see your created project. You can for example select through the menu\u00a0 &#8220;project-&gt;clean&#8221; to reset all file flags. The you could now compile the project &#8220;project-&gt;build project&#8221; and the binaries will be built.<\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/www.verelec.nl\/?page_id=547\">Lees verder <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/pages\/547"}],"collection":[{"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.verelec.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=547"}],"version-history":[{"count":9,"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/pages\/547\/revisions"}],"predecessor-version":[{"id":685,"href":"https:\/\/www.verelec.nl\/index.php?rest_route=\/wp\/v2\/pages\/547\/revisions\/685"}],"wp:attachment":[{"href":"https:\/\/www.verelec.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}