Eclipse Neon Build Environment for Peter Scargills ESP Code- Windows Only

One of the things I have been playing with recently are ESP8266’s.

When I first started to use these little wifi units, I was using some software called ESPEasy. Its a great piece of software that installs onto an ESP module using either the node flasher software (which I will cover further down) or using the arduino IDE. Once configured, it is then possible to use the built in over-the-air capability to keep the software up to date. The software has a number of different types of sensors built in with a large array of plugins also available.

In conjunction with ESPEasy I was also using Openhab as the main brain of the system. All in all it seems like a very capable system if you have time to learn all about the XML files etc that are required to be edited to get it up and running. But for me, having a young family and studying for a master’s degree, it was something that I didn’t really have time to get my head around.

So I started to look about and see what other alternatives I could find. This led me to Peter Scargills work. He uses a combination of node-red and MQTT to control his own software he has written for the ESP8266’s.

To use it, you could rely on Pete’s prebuilt ROMs and update it as and when he compiles a new version. But if you’re like me and want to be able to roll your own, it can be difficult to get the build environment up and running if you don’t know what you’re doing. Hopefully this guide will get you all setup and ready to go.

This guide is based on using a computer that is running windows 10 x64. It also uses the latest version of Eclipse, the espressif SDK and the latest Java JDK.

First, download Eclipse Neon from this link Eclipse Neon Link. Once downloaded, run the installer. The following screen willbe displayed.

Eclipse Installer

Select Eclipse IDE for C/C++ Developers as shown above. Then click install and accept the terms and conditions. Once installed, close the installer without launching eclipse.

As noted in the comments by Nigel Kendrick, python 2.7 is also required (I already had this installed so didn’t notice the requirement). The latest version can be found here. Please download and install.

Now navigate to CHERTS Thread over on the ESP forums as we need to get some of his files to allow the environment to be set up correctly. Download files number 1 (I personally downloaded the 2.1.0 beta version, but the older 2.0.9 version should also be fine), 4 and 5. Also download the latest Java JRE from this Link and the latest espressif SDK (currently 2.0.0) from this Link.

Install the espressif devkit from CHERTS, the mingw install (ensuring you unselect the gui interface) and the java JRE.

Extract the espressif devkit addon. Right click on the .bat file and select edit. For me at least, the file doesn’t run in windows 10 so we need to remove some checks from the file first. Remove the following text from the batch file and the save it.

net session >nul 2>&1
if not %ERRORLEVEL% EQU 0 (
echo Error: To install packages need admin rights.
echo.
echo Run the script as an administrator.
echo.
echo To run as administrator, click on the file install.cmd the right mouse
echo button and select ‘Run as administrator’
echo.
echo Press Enter to exit.
pause >nul
goto :eof
)
echo Press Ctrl-C to cancel, Enter to continue
pause >nul
cd /d %~dp0

Right click on the .bat file again and click run as administrator. Allow the .bat file to install all of the required addons. Press enter when asked and the window will close.

Extract the espressif SDK and then cut the ESP8266_NONOS_SDK to C:/Espressif. Rename the ESP8266_SDK to ESP8266_SDK_BAK and rename ESP8266_NONOS_SDK to ESP8266_SDK.

Now open the control panel. This can be achieved in Windows 10 by right clicking on the start button and selecting control panel. Select “System and Security” and then “System”. In the left hand section, select “Advanced System Settings”. On the window that appears, select “Enviroment Values”. On the window that appears, ensure that “path” is selected in the variable column and then press the top edit button. Add the following locations to the variables

c:\MinGW\bin

c:\MinGW\MSYS\1.0\local\bin

c:\MinGW\MSYS\1.0\bin

Its now time to download Peter Scargills esp code. There are two ways you can do this. Either download the complete repository which would be a snapshot of the repository at that point in time, or you can create your own bitbucket account, take a fork of Peter’s repository and then keep it up to date by merging his commits into your fork. I personally have a fork that I keep up to date with his commits. The software I use to do this is GitKracken. Seems to work better than Atlassians SourceTree.

So assuming you have Pete’s code somewhere accessable, you also need to download one more file before we can begin. His code references esptool2.exe, which we need to place in c:\esptools for the software to compile. The link to the precompiled version can be found on this page.

Now launch eclipse.

Click “file” and then “open projects from file system or archive”. Click the directory button and navigate to the folder containing Pete’s code. Then click finish.

I usually right click on the main hackitt_mqtt_dev folder in the project explorer in the code and then click clean project. Then right click and build project. Everything should then compile correctly.

So now just follow Pete’s instructions found here to load the code

Update: Added requirement for Python 2.7 as noted in the comments

Advertisements

One thought on “Eclipse Neon Build Environment for Peter Scargills ESP Code- Windows Only

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s