ESP HomeKit SDK – Ubuntu On Virtualbox

As I’m working on the ESP HomeKit project’s I needed a machine that was running Linux. Because my MacBook Pro did not support the needed software to compile the necessary binary files. So had come up with a solution. Oracle VM VirtualBox is a free package that provides me with the needed solution. It can run multiple operating systems simultaneously. Oracle VM VirtualBox enables you to run more than one OSes at a time. This way, you can run software written for one OS on another, such as Windows software on Linux or a Mac, without having to reboot to use it. Since you can configure what kinds of virtual hardware should be presented to each such OS. Now it’s time to install the ESP HomeKit SDK.


Seting up ESP HomeKit SDK on Ubuntu

Create an empty directory and change into it.Open the Terminal app. Click the Finder icon in your dock. Click Go. Click Utilities. Double-click Terminal. To make a new directory, run this command:

mkdir esp

Change into the directory by typing:

cd esp



Clone recursively

Clones the repository and also clones all submodules. If the submodules themselves contain additional submodules, Git will also clone those.

git clone --recursive




Install esp-open-sdk, build it with make toolchain esptool libhal STANDALONE=n, then edit your PATH and add the generated toolchain bin directory. The path will be something like /path/to/esp-open-sdk/xtensa-lx106-elf/bin.



Requirements and Dependencies

To build the standalone SDK and toolchain, you need a GNU/POSIX system (Linux, BSD, MacOSX, Windows with Cygwin) with the standard GNU development tools installed: bash, gcc, binutils, flex, bison, etc. Please make sure that the machine you use to build the toolchain has at least 1G free RAM+swap (or more, which will speed up the build).



sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \
flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
sed git unzip bash help2man wget bzip2
sudo apt-get install libtool-bin




Be sure to clone recursively:

git clone --recursive

The project can be built in two modes:

Where the toolchain and tools are kept separate from the vendor IoT SDK which contains binary blobs. This makes licensing more clear, and helps facilitate upgrades to vendor SDK releases.

A completely standalone ESP8266 SDK with the vendor SDK files merged into the toolchain. This mode makes it easier to build software (no additinal -I and -L flags are needed), but redistributability of this build is unclear and upgrades to newer vendor IoT SDK releases are complicated. This mode is default for local builds.

Change into the directory by typing:

cd esp-open-sdk

To build the self-contained, standalone toolchain+SDK type:

make toolchain esptool libhal STANDALONE=n

Update 05-02-2020: If you receive this error:

configure: error: could not find bash >= 3.1
make[1]: *** [../Makefile:143: _ct-ng] Error 1
make[1]: Leaving directory '/home/studioPieters/esp8266/esp-open-sdk-git/src/esp-open-sdk/crosstool-NG'
make: *** [Makefile:139: crosstool-NG/ct-ng] Error 2

then open the file with ATOM located in the crosstool-NG folder. Then change this line:

|$EGREP '^GNU bash, version (3.[1-9]|4)')


|$EGREP '^GNU bash, version (3.[1-9]|4|5)')

and rerun the command again.

It can take some time to install please be patient

A Python-based, open source, platform independent, utility to communicate with the ROM bootloader in Espressif ESP8266 & ESP32 chips.


Installation / dependencies
You will need either Python 2.7 or Python 3.4 or newer installed on your system.


Installing pip for Python 2

Python 2 is not installed by default in Ubuntu 18.04. To install Python 2 and pip for Python 2. Update the package index by running the following command:

sudo apt update

Install pip for Python 2 with:

sudo apt install python-pip

The command above will install Python2, Pip and all the dependencies required for building Python modules. Verify the installation by printing the pip version number:

pip --version

The version number may vary, but it will look something like this:

pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

The latest stable release can be installed from pypi via pip:

pip install esptool

With some Python installations this may not work and you’ll receive an error, try python -m pip install esptool or pip2 install esptool.

After installing, you will have installed into the default Python executables directory and you should be able to run it with the command




A community developed open source FreeRTOS-based framework for ESP8266 WiFi-enabled microcontrollers. Intended for use in both commercial and open source projects. Originally based on, but substantially different from, the Espressif IOT RTOS SDK.
Return to the ESP directory by typing:

cd esp

Change into the directory by typing:

git clone --recursive

Now we only have to setup the enviroment variables:

export PATH=~/esp/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
export SDK_PATH=~/esp/esp-open-rtos




Build example:

make -C examples/led all

Scroll to Top