The ThingsBoard IoT Gateway is an open-source, Python-based application that enables seamless integration of legacy and third-party devices with the ThingsBoard IoT platform. It serves as a protocol adapter that collects data from external sources and publishes it to ThingsBoard via a unified format.
π What is ThingsBoard IoT Gateway?
π‘ New to ThingsBoard? Learn what ThingsBoard is
Curious how the ThingsBoard IoT Gateway works in action?
β‘οΈ Follow our Getting Started Guide to:
- π Run the gateway in minutes using pre-configured demo servers
- π Simulate device data collection and processing workflows
- π§ͺ Explore telemetry, attributes, and RPCs without real devices
- π₯οΈ Test integration with ThingsBoard Community or Professional Edition
π‘ Ideal for evaluation, proof-of-concept, and learning how the gateway processes and routes data.
ThingsBoard IoT Gateway supports a wide range of industrial and IoT protocols out of the box. Each connector enables collecting data from external systems, transforming it into a unified format, and forwarding it to ThingsBoard.
- Modbus β Integrate with Modbus TCP/RTU devices like PLCs and energy meters.
- OPC-UA β Connect to industrial automation systems using the OPC-UA protocol.
- CAN β Communicate with devices over the Controller Area Network (e.g., automotive, industrial equipment).
- ODBC β Retrieve telemetry from SQL-compliant databases.
- MQTT β Subscribe to external MQTT brokers and ingest messages.
- REST API β Push data to REST endpoints created by gateway.
- Request Connector β Periodically pull data from HTTP(S) APIs and ingest response payloads.
- FTP β Read files from FTP/SFTP servers for batch data ingestion.
- Socket β Request data via raw TCP/UDP socket connections.
- SNMP β Poll SNMP devices to collect MIB data from routers, switches, sensors.
- XMPP β Receive telemetry from XMPP-based chat/device networks.
- OCPP β Integrate EV charging stations using Open Charge Point Protocol.
- BACnet β Gather building automation data (HVAC, lighting, fire systems).
- KNX β Interface with KNX-based building automation systems.
- BLE β Scan and connect to BLE-enabled devices (e.g., beacons, wearables).
- Custom Connectors β Build your own protocol handlers using Python to support any proprietary system or emerging protocol.
β¨ All connectors support flexible configuration, data transformation, and integration with the ThingsBoard platform's device model.
In addition to multi-protocol support, the ThingsBoard IoT Gateway includes robust features for reliability, remote management, and automation:
- Data persistence β Buffers telemetry locally to prevent data loss during network or system outages.
- Automatic reconnection β Automatically restores connection to the ThingsBoard cluster after temporary failures.
- Data mapping engine β Transforms raw input from devices into ThingsBoardβs unified data format using customizable converters.
- Remote configuration β Update and manage gateway configuration directly from the ThingsBoard web UI.
- Remote logging β View and stream logs remotely for troubleshooting and monitoring.
- Gateway service RPC methods β Interact with the gateway using platform-initiated RPC commands.
- Remote shell access β Run shell commands on the gateway host via the ThingsBoard platform.
- Device rename/removal detection β Automatically synchronizes device renames and deletions to keep the platform device list up to date.
The IoT Gateway is implemented in Python, allowing powerful extension and customization. It follows a modular architecture resembling microservices.
- Custom connectors let you interface with new devices or services.
- Custom converters allow transformation of incoming messages to a ThingsBoard-compatible format.
- The Gateway provides simple integration APIs, and encapsulates common Thingsboard related tasks: device provisioning, local data persistence and delivery, message converters and other.
Ideal for edge use cases where flexibility and protocol diversity are key.
Need help or want to share ideas?
- π¬ GitHub Discussions β Ask questions, propose features, or share use cases.
- β StackOverflow β Use the
thingsboard-gateway
tag.
π Found a bug? Please open an issue.
We welcome contributions! Feel free to fork the repo, open PRs, or help triage issues.
This project is licensed under the Apache 2.0 License.
π Don't forget to star the repository to show your β€οΈ and support!