Skip to main content
Technical Preview

Overview

A client-mode connector for the TDengine REST API served by taosAdapter (default port 6041). It streams MQTT telemetry into TDengine and runs SQL from MQTT: Default BASE_ADDRESS is http://YOUR_TDENGINE_HOST:6041. Replace YOUR_DATABASE in the endpoints with your database name; the database must already exist (create it once with CREATE DATABASE IF NOT EXISTS … through the SQL event). Topics use data/tdengine/<object>/<verb>.
Check code in SQL responses. By default taosAdapter answers HTTP 200 even when a SQL statement or the login fails (httpCodeServerError = false). Success is "code": 0; anything else carries the error in desc, for example {"code":855,"desc":"Authentication failure"}. Schemaless writes do return 500 with a JSON error on failure.

Auth

taosAdapter uses HTTP Basic authentication. The connector sets WITH USERNAME and WITH PASSWORD GET SECRET "TDENGINE_PASSWORD", so store the database password as a Hub secret and never commit it. TDengine also accepts Authorization: Taosd <token> (token from GET /rest/login/<user>/<password>) and, on TDengine Cloud, a ?token= query parameter. Change the default root / taosdata credentials on any real deployment.

Basic Syntax

Example MQTT payloads

Create a super table and insert a row (topic data/tdengine/sql/exec). The payload is raw SQL text:
Stream telemetry as line protocol (topic data/tdengine/influx/write):
Stream telemetry as OpenTSDB JSON (topic data/tdengine/opentsdb/write):
Query rows (topic data/tdengine/query/rows):
The response topic receives {"code":0,"column_meta":[…],"data":[{"site":"porto","temperature":21.5}],"rows":1}.
value is a reserved word in TDengine SQL. Name metric columns something like temperature or val when you create tables by hand. Schemaless OpenTSDB writes store the reading in a _value column.

Testing

The factory smoke ran against a local TDengine OSS 3.3.8.4 (taosd plus taosAdapter): GET /-/ping returned 200, CREATE STABLE and INSERT through /rest/sql/coreflux returned 200 with code 0, InfluxDB line and OpenTSDB JSON writes returned 204, and all three rows came back through /rest/sql/coreflux?row_with_meta=true (200, code 0).
Last modified on October 21, 2026