Nabto-ESP8266 Arduino Library
This is an example AppMyProduct device application on the ESP8266 Arduino platform simulating a heatpump. Currently supports the Heat Control Ionic starter app.
What is needed to run the example
We also need a device name and key, both of which can be created at portal.appmyproduct.com
Step 1: Download the ESP8266 Board Package
Follow the steps laid out here to install the ESP8266 Board Package into the Arduino IDE OR read it right here:
Open up the Arduino IDE.
Preferences and then copy this
Additional Boards Manager URLs input field. Click
Here we search for
ESP8266 and click
The ESP8266 Board Package is now installed
Step 2: Install the uNabto SDK library
There are two ways of getting the uNabto SDK library:
git clone --recursive https://github.com/nabto/unabto-esp8266-sdk
then change directory to the
unabto-esp8266-sdk folder and run
copy-unabto.cmd # Windows copy-unabto.sh # Linux
to copy the files from the unabto submodule into the appropriate folders. Afterwards you can create a zip library with
make-lib.cmd # Windows make-lib.sh # Linux
Download the latest
unabto-esp8266-sdk-X.X.X.zip zip library from the releases (not the Source code (zip)).
No matter which way, we can now add the library to the Arduino IDE via
Include Library ->
Add .ZIP Library... and then browse to and add the
unabto-esp8266-sdk-X.X.X.zip that was just created/downloaded.
Run the example
We can now open the HeatPump.ino example by going to
Here we need to enter the SSID and password of the wireless network we want to attach to. Furthermore we need to input the device name and key we created at portal.appmyproduct.com.
When the example is compiled you set the device into flash mode by pressing the following button combination on the Adafruit HUZZAH ESP8266 Breakout board:
- Hold down the GPIO0 button, the red LED will light up
- While holding down GPIO0, click the RESET button
- Release RESET, then release GPIO0
- When you release the RESET button, the red LED should light up dimly
Now the sketch can be uploaded to the device. When finished it automatically connects to the specified wifi network and runs uNabto.
In your serial monitor you should see the following printout:
Connecting to WiFi........done Init Nabto... Device id: 'n7j4qebq.hyr7o.appmyproduct.com' Program Release 123.456 Application event framework using SYNC model SECURE ATTACH: 1, DATA: 1 NONCE_SIZE: 32, CLEAR_TEXT: 0 Nabto was successfully initialized Nabto v123.456 running SECURE ATTACH: 1, DATA: 1 NONCE_SIZE: 32, CLEAR_TEXT: 0 State change from IDLE to WAIT_DNS Resolving dns: esp8266test1.demo.nab.to State change from WAIT_DNS to WAIT_BS State change from WAIT_BS to WAIT_GSP ######## U_INVITE with LARGE nonce sent, version: - URL: - State change from WAIT_GSP to ATTACHED
Now, connect to your device using the Heat Control Ionic starter app and see the LED change its brightness according to the target heat.