Table of Contents
ThingsBoard is an open-source IoT platform for device management, data collection, processing, and visualisation. Its self-hosted nature makes it ideal for Indian organisations concerned about data sovereignty and cloud costs. Run it on your own server and maintain complete control over your IoT data.
What is ThingsBoard
ThingsBoard is a full-featured IoT platform written in Java that supports:
- Multi-protocol support: MQTT, CoAP, HTTP, LwM2M, SNMP, and OPC-UA
- Device management: Provision, configure, and monitor thousands of devices
- Rule engine: Process incoming data with visual flow-based rules
- Dashboards: Build stunning real-time dashboards with 30+ widget types
- Multi-tenancy: Host multiple customers on a single installation
Community vs Professional Edition
ThingsBoard comes in two editions:
- Community Edition (CE): Fully open-source under Apache 2.0 licence. Supports unlimited devices, basic rule engine, and dashboards. Perfect for learning and small deployments.
- Professional Edition (PE): Adds white-labelling, advanced rule engine nodes, integrations (Kafka, AWS, Azure), CSV/XLS export, and scheduler. Starts at $10/month for cloud, or you can self-host with a licence key.
For most Indian makers and small businesses, the Community Edition provides everything you need.
Installing ThingsBoard on Ubuntu
Install ThingsBoard CE on an Ubuntu server (minimum 2 GB RAM, 10 GB disk):
# Install Java 17
sudo apt update
sudo apt install -y openjdk-17-jdk
# Add ThingsBoard repository
wget https://dist.thingsboard.io/thingsboard-3.6.4-linux-amd64.deb
sudo dpkg -i thingsboard-3.6.4-linux-amd64.deb
# Configure PostgreSQL
sudo apt install -y postgresql
sudo -u postgres psql -c "CREATE DATABASE thingsboard;"
sudo -u postgres psql -c "CREATE USER thingsboard WITH PASSWORD 'your_password';"
sudo -u postgres psql -c "GRANT ALL ON DATABASE thingsboard TO thingsboard;"
# Edit config
sudo nano /etc/thingsboard/conf/thingsboard.conf
# Set: export DATABASE_TS_TYPE=sql
# Initialise database
sudo /usr/share/thingsboard/bin/install/install.sh
# Start service
sudo systemctl start thingsboard
sudo systemctl enable thingsboard
# Access at http://your-server-ip:8080
# Default login: [email protected] / sysadmin
Adding Devices and Dashboards
Once ThingsBoard is running, add your first device:
- Login to the web UI at port 8080
- Go to Devices → Add new device
- Name it
ESP32-Sensor-01and copy the Access Token - Go to Dashboards → Create new dashboard
- Add widgets: line chart for temperature, gauge for humidity, map for GPS
Recommended Components
Connecting ESP32 via MQTT
Connect your ESP32 to ThingsBoard using MQTT:
#include
#include
#include
const char* ssid = "YOUR_WIFI";
const char* password = "YOUR_PASSWORD";
const char* mqtt_server = "YOUR_THINGSBOARD_IP";
const char* access_token = "YOUR_DEVICE_TOKEN";
#define DHT_PIN 4
DHT dht(DHT_PIN, DHT22);
WiFiClient espClient;
PubSubClient client(espClient);
void reconnect() {
while (!client.connected()) {
if (client.connect("ESP32Client", access_token, NULL)) {
Serial.println("Connected to ThingsBoard!");
} else {
delay(5000);
}
}
}
void sendTelemetry() {
float temp = dht.readTemperature();
float hum = dht.readHumidity();
if (isnan(temp) || isnan(hum)) return;
char payload[100];
snprintf(payload, sizeof(payload),
"{"temperature":%.1f,"humidity":%.1f}", temp, hum);
client.publish("v1/devices/me/telemetry", payload);
Serial.printf("Sent: %sn", payload);
}
void setup() {
Serial.begin(115200);
dht.begin();
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) delay(500);
client.setServer(mqtt_server, 1883);
reconnect();
}
void loop() {
if (!client.connected()) reconnect();
client.loop();
sendTelemetry();
delay(30000);
}
Rule Engine for Data Processing
ThingsBoard’s rule engine processes incoming telemetry data. Common use cases:
- Alert rules: Send email when temperature exceeds 45 degrees Celsius
- Data transformation: Convert Celsius to Fahrenheit, calculate dew point
- Data aggregation: Compute hourly averages
- Device control: Turn on cooling fan when temperature rises
Building Real-Time Dashboards
ThingsBoard dashboards support over 30 widget types:
- Charts: Line, bar, scatter, and pie charts for time-series data
- Gauges: Radial and linear gauges for real-time values
- Maps: OpenStreetMap and Google Maps widgets for GPS tracking
- Tables: Data grids with sorting and filtering
- Control widgets: Buttons, sliders, and switches for device control
Recommended Product
BME280 Environmental Sensor (Temperature, Humidity, Barometric Pressure)
Frequently Asked Questions
Can I run ThingsBoard on Raspberry Pi?
While possible, it is not recommended due to Java’s memory requirements. A minimum of 2 GB RAM is needed. A small cloud VPS from Indian providers like DigitalOcean or Hetzner (starting at ₹350/month) is a better choice.
How many devices can ThingsBoard Community Edition handle?
The Community Edition has no artificial device limit. On a 4 GB RAM server, you can comfortably handle 1,000-5,000 devices with appropriate tuning.
Is ThingsBoard suitable for smart city projects in India?
Yes. ThingsBoard PE is used in several Indian smart city deployments. Its multi-tenancy feature lets you serve multiple departments from a single installation.
How does ThingsBoard compare to AWS IoT Core?
ThingsBoard is self-hosted (no cloud vendor lock-in), has built-in dashboards, and costs nothing for the CE version. AWS IoT Core offers better scalability, managed infrastructure, and deeper integration with AWS services. Many Indian companies use both.
{“@context”: “https://schema.org”, “@type”: “FAQPage”, “mainEntity”: [{“@type”: “Question”, “name”: “Can I run ThingsBoard on Raspberry Pi?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “While possible, it is not recommended due to Java’s memory requirements. A minimum of 2 GB RAM is needed. A small cloud VPS from Indian providers like DigitalOcean or Hetzner (starting at u20b9350/month) is a better choice.”}}, {“@type”: “Question”, “name”: “How many devices can ThingsBoard Community Edition handle?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “The Community Edition has no artificial device limit. On a 4 GB RAM server, you can comfortably handle 1,000-5,000 devices with appropriate tuning.”}}, {“@type”: “Question”, “name”: “Is ThingsBoard suitable for smart city projects in India?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Yes. ThingsBoard PE is used in several Indian smart city deployments. Its multi-tenancy feature lets you serve multiple departments from a single installation.”}}, {“@type”: “Question”, “name”: “How does ThingsBoard compare to AWS IoT Core?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “ThingsBoard is self-hosted (no cloud vendor lock-in), has built-in dashboards, and costs nothing for the CE version. AWS IoT Core offers better scalability, managed infrastructure, and deeper integration with AWS services. Many Indian companies use both.”}}]}
Ready to Build Your IoT Project?
Browse our complete collection of ESP32 boards, sensors, and IoT components. Fast shipping across India with technical support.
Add comment