简体   繁体   English

通过MQTT进行累积JSON /测量和错误主题

[英]Cumulocity JSON via MQTT / measurement and error topic

I'm trying to send measurement values to my Cumulocity Tenant via JSON MQTT. 我正在尝试通过JSON MQTT将测量值发送到我的Cumulocity租户。 For my test connection I use MQTTBox. 对于我的测试连接,我使用MQTTBox。

I have already successfully sent data / create new deivces via MQTT. 我已经通过MQTT成功发送了数据/创建了新设备。

100,MQTT-Simulation-1,c8y_MQTTdevice
211,80

I have now tried to change my format to JSON MQTT. 我现在尝试将格式更改为JSON MQTT。 According to the Cumulocity IoT Guide ( http://www.cumulocity.com/guides/mqtt/json/ ) I have defined my MQTT topic endpoint. 根据《 Cumulocity IoT指南》( http://www.cumulocity.com/guides/mqtt/json/ ),我已经定义了MQTT主题终结点。

<api>/<resource>/<action>/<id>
measurement/measurements/create/231
  • Topic to publish: measurement/measurements/create/231 要发布的主题:measurement / measurements / create / 231
  • Payload Type: String / JSON / XML / Characters 有效负载类型:字符串/ JSON / XML /字符
  • Payload: {"c8y_Temperature": {"T": {"unit": "°C","value": 35.742410434759904}}} 有效负载:{“ c8y_Temperature”:{“ T”:{“单位”:“°C”,“值”:35.742410434759904}}}

As described in the guide, the payload of SmartRest can be used? 如指南中所述,可以使用SmartRest的有效负载吗? The examples in the Guide looks different as described, no ID can be found here in the topic to publish. 《指南》中的示例看起来与所描述的有所不同,在此处要发布的主题中找不到ID。

A subscription to the topic error is also not possible. 也无法订阅主题错误 Only to the topic smartrest error s/e . 仅针对主题smartrest错误s / e

通过MQTT进行的JSON仅在我的主要租户的下一版本中才可用-累积支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM