Open-source project
thingsboard/thingsboard-gateway avatar
thingsboard/thingsboard-gateway

ThingsBoard Gateway: a Python protocol adapter with 17 connectors and a remote shell

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols.

2,206 stars1,010 forksPythonApache-2.0

At a glance

What is it?
thingsboard-gateway turns Modbus, OPC-UA, BACnet and other device traffic into ThingsBoard data. It targets ThingsBoard only, and several of its limits live in the online guides.
Who is it for?
Run it if ThingsBoard is already your platform and you need Modbus, OPC-UA, BACnet or MQTT devices connected, with Python skills on hand for custom converters. Skip it if your data must go anywhere else.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • thingsboard/thingsboard-gateway2,206 ★ · +11
Star history
Repository2026-10-082026-11-23
thingsboard/thingsboard-gateway2.2k2.2k

11 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The gateway publishes to ThingsBoard and to nothing else the repository names

Everything in this repository points one way: data from field devices goes up to a ThingsBoard server. The README describes the gateway as a protocol adapter that collects data from external sources and publishes it to ThingsBoard in a unified format. No other destination, such as a generic MQTT broker or a time-series database, is named as an output.

That makes the decision simple. If your platform is ThingsBoard, Community or Professional Edition, the gateway is the supplied way to bring Modbus, OPC-UA or BACnet equipment into it. If your platform is something else, the repository gives you no reason to run it, though the Apache-2.0 license and the custom connector hooks mean you could write your own sink at your own cost.

The code is Python. setup.py declares `python_requires=">=3.10"` and the package name `thingsboard-gateway`, version read from `thingsboard_gateway.version`. Contributions, discussions and bugs go to GitHub, with a StackOverflow tag `thingsboard-gateway` and a Discord server for questions.

Seventeen connector types, and the interesting split is who initiates the connection

The README sorts its connectors into groups. Industrial and SCADA: Modbus (TCP and RTU, with PLCs and energy meters as the examples), OPC-UA, S7 for Siemens S7 PLCs, CAN and ODBC for SQL-compliant databases. Networking: MQTT, REST API, Request, FTP, Socket, SNMP and XMPP. Energy: OCPP for EV charging stations. Buildings: BACnet, KNX and BLE. That is seventeen, plus custom connectors.

The verbs in the descriptions matter more than the list. The MQTT connector subscribes to external brokers. The Request connector periodically pulls from HTTP(S) APIs. The FTP connector reads files from FTP or SFTP servers for batch ingestion. SNMP polls devices for MIB data. The REST connector works the other way: it pushes data to REST endpoints created by the gateway, meaning external systems call into the gateway, so that port has to be reachable from them.

A fleet that mixes those directions will need a network plan for each. The README does not give default ports or firewall guidance for any connector. Each links to a page under thingsboard.io/docs/iot-gateway/config/.

Converters turn raw payloads into ThingsBoard's device model, and you write them in Python

The data mapping engine is the part that decides what a Modbus register or an MQTT message becomes. The README says it transforms raw input from devices into ThingsBoard's unified data format using customizable converters. Telemetry, attributes and RPCs are the three kinds of data the Getting Started section mentions.

There are two extension points, and the README keeps them separate. Custom connectors interface with new devices or services. Custom converters transform incoming messages into a form ThingsBoard accepts. A proprietary serial protocol needs a connector. A known protocol with an odd payload layout needs only a converter. The README promises the Gateway encapsulates common ThingsBoard tasks for both: device provisioning, local data persistence and delivery, and message converters.

Both extension points are Python classes, so the author needs to be a Python developer who has read the custom connector guide at thingsboard.io/docs/iot-gateway/custom/. The README gives no skeleton code, no class names and no interface signature, and the guide is the only place to find them.

Local buffering covers outages, but the repository states no size or retention limit

Two reliability features are named. Data persistence buffers telemetry locally to prevent data loss during network or system outages, and automatic reconnection restores the connection to the ThingsBoard cluster after temporary failures. The package list in setup.py includes thingsboard_gateway.storage and thingsboard_gateway.storage.memory, which shows that the in-memory storage has its own package.

What the README does not say is how much the buffer holds or how long a reading survives. There is no figure for capacity, no statement of what is dropped first when the buffer fills and no description of what happens on a restart with unsent data. The setup.py snippet is cut off before the full package list, so other storage backends may exist, but nothing here names one.

The practical step is to measure the outage you need to survive. If a plant link can be down for a shift, check the storage settings in the official guide against the reading rate of your busiest connector before trusting the buffer with that gap.

Remote shell access runs commands on the gateway host, driven from the ThingsBoard web UI

The management features go further than most edge software documents. Remote configuration updates gateway configuration from the ThingsBoard web UI. Remote logging views and streams logs. Gateway service RPC methods let the platform send commands to the gateway. Remote shell access runs shell commands on the gateway host via the ThingsBoard platform.

That last item is a decision for the person who owns the host. Anyone allowed to use it on the platform side can execute commands on the machine that is wired to your PLCs and building controllers. The README links a guide called how to enable remote shell, so it is enabled by following steps, but it does not say what privileges the commands run with. Check that guide before turning it on for a gateway that sits next to a production line.

The repository includes packages for this layer: thingsboard_gateway.gateway.shell, thingsboard_gateway.gateway.statistics, thingsboard_gateway.gateway.report_strategy and thingsboard_gateway.gateway.grpc_service, the last of which goes with grpcio and protobuf in requirements.txt.

The dependency list pins tb-mqtt-client to 1.13.14 and ships packaging scripts for Docker and deb

requirements.txt is short and mixed. Most entries are unpinned: setuptools, packaging, jsonpath-rw, regex, pip, PyYAML, simplejson, orjson, pybase64, python-dateutil, grpcio, mmh3, protobuf, cachetools, service-identity, psutil, cryptography and PySocks. A few have floors: `urllib3>=2.3.0`, `requests>=2.32.3` and `tb-paho-mqtt-client>=2.1.2`. One is exact: `tb-mqtt-client==1.13.14`. The gateway therefore tracks one specific ThingsBoard client release, while most other libraries float to whatever pip resolves.

A separate requirements-full.txt sits at the top level. Its contents are not shown in the repository text available, so this article cannot say what it adds. The README does not mention it.

Distribution is handled by scripts: build_latest_docker.sh, docker_build_multiarch.sh, generate_deb_package.sh and make_packages.sh, with a docker/ directory and the spec files thingsboard-gateway.spec and thingsboard-gateway-offline.spec. The README itself has no install command. It sends readers to the Getting Started guide, which it says runs the gateway in minutes against pre-configured demo servers.

Release 3.8.6 landed on 29 October 2026, six weeks after 3.8.5

The repository is not archived. The latest releases are 3.8.6 on 29 October 2026, 3.8.5 on 17 September and 3.8.4 on 5 August. The last push to master was on 23 October 2026, so the newest tag comes after it. That is roughly one release a month, which is the cadence a team would plan upgrades against.

The license is Apache-2.0, and the setup.py header carries a 2026 ThingsBoard copyright. The README's own license section is truncated in the available text, but the metadata and setup.py agree.

The README is also a marketing page. Its Getting Started section promises demo servers and simulated devices for evaluation, and says the gateway is ideal for edge use cases where flexibility and protocol diversity are key. It does not list supported hardware, an operating system matrix or a throughput figure, so a deployment on a small ARM board needs checking against the Docker and package scripts before anything is ordered.

Editorial conclusion

Run it if ThingsBoard is already your platform and you need Modbus, OPC-UA, BACnet or MQTT devices connected, with Python skills on hand for custom converters. Skip it if your data must go anywhere else. Before deploying, check the local buffer settings against your longest outage and decide whether remote shell access should be enabled at all.

Frequently asked questions

What does ThingsBoard do, and where does the gateway fit?

ThingsBoard is the IoT platform the gateway publishes to. The gateway collects data from legacy and third-party devices and sends it to ThingsBoard in a unified format.

What is the purpose of an IoT gateway like ThingsBoard Gateway?

It is a protocol adapter that collects data from external sources such as Modbus, OPC-UA, MQTT and BACnet devices and publishes it to ThingsBoard. It also buffers telemetry locally during outages.

How much does ThingsBoard Gateway cost?

The gateway is open source under Apache-2.0. The README gives no ThingsBoard prices, and mentions only that the gateway works with ThingsBoard Community or Professional Edition.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. thingsboard/thingsboard-gateway on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/thingsboard-thingsboard-gateway.svg)](https://hysenlabs.com/projects/thingsboard-thingsboard-gateway)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/thingsboard-thingsboard-gateway.svg)](https://hysenlabs.com/projects/thingsboard-thingsboard-gateway)

Was this useful?