【发布时间】:2018-01-21 20:02:07
【问题描述】:
我在文档和留言板中进行了搜索,但找不到以下内容。
我正在尝试使用 IOT 网关将数据从 mqtt 导入 thingsboard。
文档概述了如何配置 IOT 网关以导入 json 格式的数据。
{
"topicFilter": "sensors",
"converter": {
"type": "json",
"filterExpression": "",
"deviceNameJsonExpression": "${$.serialNumber}",
"attributes": [
{
"type": "string",
"key": "model",
"value": "${$.model}"
}
],
"timeseries": [
{
"type": "double",
"key": "temperature",
"value": "${$.temperature}"
}
]
}
}
来自 (https://thingsboard.io/docs/iot-gateway/getting-started/#step-81-basic-mapping-example)。
然后,该映射可以导入这样发布的数据:
mosquitto_pub -h localhost -p 1883 -t "sensors" -m '{"serialNumber":"SN-001", "model":"T1000", "temperature":36.6}'
我希望也可以导入原始数据,即没有 json 格式,因为我已经有许多带有原始数据有效负载的数据主题。所以,只是原始的 ascii 编码值。所以,像这样:
mosquitto_pub -h localhost -p 1883 -t "sensors/livingroom/temperature" -m '36.6'
物联网网关可以做到吗?如果可以,配置会是什么样子?
【问题讨论】:
标签: mqtt thingsboard