本文介绍了在IoT网关Thingsboard中发布多个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在刚刚开始使用Thingsboard,遇到了这个东西, https://thingsboard.io/docs/iot-gateway/getting-started/.我已经实现了,但是我面临的问题是

I just now started using Thingsboard and I came across this one,https://thingsboard.io/docs/iot-gateway/getting-started/. I have implemented it but the problems that I'm facing are,

1.我只能传输一个键值对.如何传输多个键值传感器数据?

1.I can transmit only one Key-value pair. How can I transmit multiple key-value sensor data?

2.此外,如果还有其他方法可以访问Cassandra数据库,以便我可以将所有地雷数据检索到Thingsboard.

2.Also if there is any other way to access the Cassandra Database so that I can retrieve all mine data to Thingsboard.

请帮助.谢谢.

推荐答案

例如,湿度,温度,气体.

For example, humidity, temperature, gas.

在这种情况下,您使用一个访问令牌/单个mqtt会话并像这样在单个json中发送数据

In this case you use one access token/single mqtt session and send data in single json like this

{"humidity":42.2, "temperature":23.3, "gas":45}

如果您在单个设备上连接了多个传感器,请像这样发送它们

If you have multiple sensors attached to single device, send them like this

{"sensorA.humidity":42.2, "sensorB.temperature":23.3, "sensorC.gas":45}

可用的主题是静态的,并在此处列出: https://thingsboard.io/docs/reference/mqtt-api/#telemetry-upload-api

Available topics are static and listed here:https://thingsboard.io/docs/reference/mqtt-api/#telemetry-upload-api

这篇关于在IoT网关Thingsboard中发布多个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 06:57