Over a million developers have joined DZone.

Remotely Control an ESP8266 With Kaa IoT Platform

DZone 's Guide to

Remotely Control an ESP8266 With Kaa IoT Platform

Kaa is an open source IoT middleware platform. See it in use to remotely control an ESP8266 blinky app through an Android device.

· IoT Zone ·
Free Resource

Kaa is a multi-purpose middleware platform for the Internet of Things that allows building complete end-to-end IoT solutions, connected applications, and smart products. The Kaa platform provides an open, feature-rich toolkit for IoT product development and thus dramatically reduces associated cost, risks, and time-to-market. For a quick start, Kaa offers a set of out-of-the-box, enterprise-grade IoT features that can be easily plugged in and used to implement a large number of IoT use cases.

There are a number of architectural specifics that make IoT development with Kaa fast and easy. First, Kaa is hardware-agnostic and thus compatible with virtually any type of connected device, sensor, and gateway. It also provides a clear structure of IoT features and extensions for different types of IoT applications. They can be used almost as plug-and-play modules with minimal additional code on the developer’s part. Combined with unlimited options for connectivity protocols and integration with analytics, these capabilities make Kaa an apt metaphor for creative IoT development.

How Does It Work?

Kaa enables data management for connected objects and your back-end infrastructure by providing the server and endpoint SDK components. The SDKs get embedded into your connected device and implement real-time bi-directional data exchange with the server. Kaa SDKs are capable of being integrated with virtually any type of connected device or microchip.

The Kaa server provides all the back-end functionality needed to operate even large-scale and mission-critical IoT solutions. It handles all the communication across connected objects, including data consistency and security, device interoperability, and failure-proof connectivity.

The Kaa server features well-established interfaces for integration with data management and analytics systems, as well as with your product-specific services. It acts as a foundation for your back-end system that you are free to expand and customize to meet the specific requirements of your product.

Why Kaa?

  • Feature-rich IoT middleware platform

  • 10 Kb RAM footprint (with C SDK)

  • Built-in transport security

  • Efficient data serialization

  • Horizontally scalable and fault tolerant

  • 100% open-source (Apache license 2.0)

  • Rapid application development using C / C++ / Java SDKs

  • Integration with popular hardware platforms

Image title

If you would like to become more familiar with this platform, please refer to the following link:

What Is Kaa Sandbox?

Kaa Sandbox is a pre-configured virtual environment designed for the users who want to use their private instance of Kaa platform for educational, development, and proof-of-concept purposes. The Sandbox also includes a selection of demo applications that illustrate various aspects of the platform functionality.

See the Getting Started documentation section.

I want to share my second big experience with this great platform for the Internet of Things.

I would like to briefly explain my experience with Remote control of an Espressif ESP8266 with Android using Kaa.

We need these requirements to remotely control our ESP8266 with the Kaa IoT Platform:

  1. Kaa Sandbox v0.9.0

  2. Host OS: Ubuntu 14.04 LTS Desktop 64-bit

  3. Device(s):

  • ESP8266 ESP-12E NodeMCU 

  • Bread Board

  • LEDs

  • Male-to-male jumper wires

Connecting ESP8266

To flash the ESP8266 chip, you need to connect it to your PC. That may differ depending on the module you use. This guide covers instructions for the ESP8266-01 and NodeMCU modules.

For a complete guide, see the documentation. For this experiment, going through the steps until the sixth stage is enough.

Note: Please attach the wires to pins D3 and D4 and the other side of the male jumper wires to the positive side of the LEDs.

Image title

Creating Kaa Applications

After you have successfully installed the dependencies, you can proceed to application development. See the application code example.

After the above steps, follow the steps below:

  1. Download the "GPIO control ESP8266" source from Sandbox.

  2. Unpackage "GPIO control ESP8266".

  3. Go to the terminal:

  4. $ cd <Path to libs/kaa>
    $ untar <gpio-esp-client>
    $ cd <source code GPIO control ESP8266 folder>
    $ chmod u+x ./build.sh
    $ ./build.sh deploy

  5. Start and compile the application. It also requests the Wi-Fi SSID and PASSWORD.

  6. Flashing: Once the application is built, a kaa_demo ELF executable file will be stored in the build directory. The flashing process will take some time. When the firmware starts, you are able to start with step 6.

    Make sure that Kaa Sandbox is up and running.

  7. Android application installation and running:

    Download the .apk to your Android device by clicking the "Binary" button on the left. Make sure that the device permits installing apps from "Unknown sources". Open the downloaded APK and follow the on-screen instructions.

    Start the application on the Android device and press the "+" button on the bottom-right of the screen. Enter the endpoint access token (the default value is "esp8266" for ESP8266). No other data is needed because the trustful user verifier is used for demonstration purposes.

    Then, click on the device and try to toggle the switches.

  8. Lastly, you are able to turn ON/OFF LED.

Image title

Enjoy your first experience with the great Kaa IoT platform.

iot application ,kaa ,iot ,iot middleware

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}