You are here

Connect an ESP8266 with the Arduino SDK to the IBM Watson IoT Platform

Shanghai, ChinaFeb 22, 2016

There is a variety of types to choose from, all of which should work; here, I’m using a NodeMCU-style board, which is easy to prototype, because it has USB support built-in for programming and powering the ESP8266.

First you'll need an ESP8266

There is a variety of types to choose from, all of which should work; here, I’m using a NodeMCU-style board, which is easy to prototype, because it has USB support built-in for programming and powering the ESP8266.

Next, install the Arduino IDE

Get the Arduino IDE here. Using a recent version of the IDE – 1.6.4 or later – makes it easy to add the ESP8266 support to the IDE. With the Arduino IDE installed, use the Board Manager function to add support for the ESP8266, see here how to do that.

Add the MQTT PubSubClient library

The IBM Watson IoT Platform uses the MQTT protocol, so next add the MQTT PubSubClient library to the Arduino IDE. This needs to be a recent version of the library in order to work with the ESP8266. I’m using version 2.3 here.

Signup to Bluemix and the IBM Watson IoT Platform

Next you need to sign up on the IBM Watson IoT Platform, and create an “organization” and a “device”. This is described in detail on the IBM website and involves signing up to Bluemix and the Internet of Things Foundation; in the Bluemix Catalog add an Internet of Things Service. This will create your Organization and then in the IoT Dashboard you can add a Device. There are lots of configuration options, nearly all can be left blank, you just need a device type (I used “ESP8266″), and a device ID (I used “Test1″).

When the device has been created you’ll see the Device Credentials page and you'll need to save those details which are used to customise your Arduino sketch in the next step.

Jeroen Domburg, Software Manager and Technical Marketing Manager at Espressif Systems, was invited to the 2017 Tensilica Day Event, where he delivered a presentation entitled: "IoT on the Cheap: How Espressif Leverages Xtensa Cores".