Remotely Control an ESP8266 With Kaa IoT Platform
Kaa is an enterprise-grade IoT platform that enables a broad range of cloud capabilities for your connected devices. It brings together everything from tiny sensors to sophisticated industrial machinery and makes them connect in a meaningful and effective way, thus making every aspect of your business smarter and more attractive to your customers. Built on the modern cloud-native technology stack, Kaa provides elastic scalability and mission-critical resilience for your IoT device ecosystems.
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
- Rapid application development using C / C++ / Java SDKs
- Integration with popular hardware platforms
If you would like to become more familiar with this platform, please refer to the following link:
https://www.kaaproject.org/
What Is Kaa Sandbox?
Kaa Sandbox is a pre-configured virtual environment designed for 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:
- Kaa Sandbox v0.9.0
- Host OS: Ubuntu 14.04 LTS Desktop 64-bit
- 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.
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:
- Download the “GPIO control ESP8266” source from Sandbox.
- Unpackage “GPIO control ESP8266”.
- Go to the terminal:
$ cd <Path to libs/kaa>$ untar <gpio-esp-client>$ cd <source code GPIO control ESP8266 folder>$ chmod u+x ./build.sh$ ./build.sh deploy
Start and Run the application:
- Start and compile the application. It also requests the Wi-Fi SSID and PASSWORD.
- 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.
- Note: Make sure that Kaa Sandbox is up and running.
- 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.
- Lastly, you are able to turn the ON/OFF LED.