What is ThingsBoard IoT Gateway?
ThingsBoard IoT Gateway is an open-source solution that bridges industrial devices and legacy hardware into the ThingsBoard IoT platform. It translates device-native protocols — Modbus, OPC-UA, BACnet, CAN bus, BLE, and more — into the ThingsBoard data model, enabling unified device management, real-time telemetry, and remote control without modifying device firmware.
If your hardware doesn’t support MQTT, HTTP, or CoAP natively, the IoT Gateway handles the translation transparently.
Architecture
Section titled “Architecture”The gateway is built around four loosely-coupled components that work together to reliably move data from devices to the cloud.
Connector
Section titled “Connector”A Connector establishes communication with an external system or device using a specific protocol — for example, connecting to an MQTT broker, an OPC-UA server, or directly to Modbus/BLE/CAN hardware. Once connected, it either polls the device on a schedule or subscribes to updates, depending on protocol capabilities (MQTT uses subscriptions; Modbus and CAN use polling). The connector is also able to push updates back to devices, either directly or via an external system.
You can define your own connector using the customization guide.
Converter
Section titled “Converter”Converters are responsible for translating data between a protocol-specific format and the ThingsBoard format. They are invoked by connectors and are often specific to the protocol the connector supports.
- Uplink converter: transforms raw device payloads into the ThingsBoard data model (telemetry, attributes, RPC responses).
- Downlink converter: translates ThingsBoard commands back into protocol-native messages for device control.
You can define your own converter using the customization guide.
Event Storage
Section titled “Event Storage”The Event Storage temporarily stores telemetry and other events produced by connectors until they are delivered to ThingsBoard. All incoming events are persisted locally before being forwarded to the cloud, guaranteeing at-least-once delivery even when connectivity is interrupted.
Two storage backends are available:
- In-memory: Low-latency, no disk I/O. Messages are lost if the gateway process restarts.
- File-based: Survives process restarts. Backed by the local file system.
ThingsBoard Client
Section titled “ThingsBoard Client”The ThingsBoard Client is a dedicated thread that drains the Event Storage and pushes batched events to the ThingsBoard platform over MQTT. It monitors connectivity, handles reconnection transparently, and supports event batching for performance.
Gateway Service
Section titled “Gateway Service”The Gateway Service is the bootstrap layer that starts all connectors, initializes storage, and launches the ThingsBoard Client. It also collects and periodically reports runtime statistics (connected devices, message throughput) back to ThingsBoard, and persists the list of connected devices so that configuration subscriptions survive a gateway restart.
Features
Section titled “Features”ThingsBoard IoT Gateway is a protocol bridge. It ships with a rich set of built-in connectors covering the most common industrial and IoT protocols, plus a Python extension API for any proprietary protocol your project requires.
- MQTT Connector: Connect devices through existing MQTT brokers using custom payload formats and topic structures.
- OPC-UA Connector: Integrate industrial equipment and SCADA systems using the OPC-UA standard.
- Modbus Connector: Collect data from PLCs, sensors, and meters via Modbus TCP/RTU.
- BACnet Connector: Bridge building automation and control networks into ThingsBoard.
- BLE Connector: Collect data from Bluetooth Low Energy sensors and beacons.
- CAN Connector: Read and decode CAN bus frames from automotive and industrial equipment.
- SNMP Connector: Monitor network devices and infrastructure using SNMP traps and polling.
- HTTP Connector: Pull data from devices that expose HTTP(S) endpoints.
- REST Connector: Expose local HTTP endpoints to receive data pushed by devices or third-party systems.
- ODBC Connector: Collect data from ODBC-compatible databases.
- FTP Connector: Collect data from FTP servers.
- Socket Connector: Collect data from devices connected via TCP/UDP.
- XMPP Connector: Collect data from devices connected through the XMPP protocol.
- OCPP Connector: Communicate between EV Charge Points and a Central System.
- KNX Connector: Collect data from devices connected through KNX.
- Custom Connector: Implement your own connector for any proprietary or unsupported protocol using the Python extension API.
- Persistence: Local event storage ensures telemetry is never lost during network outages or cloud unavailability.
- Flexible mapping: Incoming data and messages are mapped to a unified ThingsBoard format regardless of the source protocol or payload structure.
- Automatic Reconnect: The gateway automatically reconnects to the ThingsBoard cluster and resumes data delivery after disruptions.
- Remote Management: Configure connectors, update firmware, and monitor gateway health directly from the ThingsBoard UI — no SSH required.