Thingsboard Client Sdk

Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)

Internet of Things (IoT)C++MIT

Abstract

Thingsboard Client Sdk is an open-source Internet of Things (IoT) project. Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.). This library provides access to the ThingsBoard platform over the MQTT or HTTP(S) protocols. It is built using C++, MQTT, Arduino, ESP32, ESP8266. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building an Internet of Things (IoT) mini project or final-year project.

1. Introduction

This library provides access to the ThingsBoard platform over the MQTT or HTTP(S) protocols.

Example usage for Espressif can be found in the examples/0014-espressif_esp32_send_data folder, all other code portions can be implemented the same way only initialization of the needed dependencies is slightly different. Meaning internal call to ThingsBoard works the same on both Espressif and Arduino.

ThingsBoardArduinoSDK does not directly depend on any specific MQTT Client or HTTP Client implementation, instead any implementation of the IMQTT_Client or IHTTP Client can be used. Because there are no further dependencies on Arduino, besides the client that communicates it allows us to use this library with Arduino, when using the Arduino_MQTT_Client or with Espressif IDF when using the Espressif_MQTT_Client.

2. Objective

Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)

This project demonstrates how C++, MQTT, Arduino can be applied to a real-world Internet of Things (IoT) problem.

4. Technology Stack

C++MQTTArduinoESP32ESP8266
  • MQTT PubSub Client — for interacting with MQTT, when using the Arduino_MQTT_Client instance as an argument to ThingsBoard. Only installed if this library is used over Arduino IDE or PlatformIO with the Arduino framework.
  • MbedTLS Library — needed to create hashes for the OTA update for non Espressif boards.
  • Arduino Timer - needed to create non-blocking callback timers for non Espressif boards.
  • WiFiEsp Client — needed when using a Arduino Uno with a ESP8266.
  • StreamUtils — needed when sending arbitrary amount of payload even if the buffer size is too small to hold that complete payload is wanted, aforementioned feature is automatically enabled if the library is installed.

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Arduino IDE / PlatformIO or a C++ compiler (g++)
  • Target board (e.g. Arduino, ESP32) where applicable
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/thingsboard/thingsboard-client-sdk.git
cd thingsboard-client-sdk
// If not set the value is 0 per default,
// set to 1 if the MaxResponse template argument should be automatically deduced instead
#define THINGSBOARD_ENABLE_DYNAMIC 1
#include <ThingsBoard.h>

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Add a mobile dashboard using Blynk or Firebase
  • Store readings in a cloud database for history charts
  • Add alerts via SMS / Telegram when thresholds are crossed

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Which microcontroller / board and sensors are used and why?
  2. How does the device send data (Wi-Fi, MQTT, HTTP, Bluetooth)?
  3. Where is the sensor data stored and visualised?
  4. How is power consumption managed?
  5. How would you secure the device and its communication?

9. Source Code & License

This project is developed by thingsboard and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on an Internet of Things (IoT) project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Internet of Things (IoT) Internship