-1

我正在尝试为累积数据扩展字符串模板。例如 ex-03-测量。

我改变如下

//================================================= =================== 10,103,POST,/measurement/measurements,application/json,,%%,NOW UNSIGNED NUMBER NUMBER NUMBER NUMBER,"{""时间"" :""%%"",""source"":{""id"":""%%""},""type"":""c8y_RHTMeasurement"",""c8y_RHTMeasurement"":{"" RH"":{""value"":%%,""unit"":""%""},""Temperature"":{""value"":%%,""unit"":" "C""},""Temperature1"":{""值"":%%,""unit"":""C""},""Temperature2"":{""值"":%%,""单位"":""C""}}}" //========================= =========================================

我使用如下代码

//================================================= ================== agent.send("103," + agent.ID() + "," + to_string(rh) + "," + to_string(温度) + "," + to_string(温度)+"," + to_string(温度)); //================================================= ===================

我总是得到回应是

有没有人知道如何扩展cumulocity服务器上的数据?

Add software debug log

Mar 30 11:17:28 DEBUG: HTTP recv: 
Mar 30 11:17:28 INFO: reporter: listening...
==============Mar 30 11:17:29 DEBUG: HTTP post: 15,24555
103,78561,86.000000,83.000000,83.000000,83.000000

Mar 30 11:17:29 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Mar 30 11:17:29 DEBUG: Drop Msg 45
==============Mar 30 11:17:30 DEBUG: HTTP post: 15,24555
103,78561,15.000000,77.000000,77.000000,77.000000

Mar 30 11:17:30 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Mar 30 11:17:30 DEBUG: Drop Msg 45
==============Mar 30 11:17:31 DEBUG: HTTP post: 15,24555
103,78561,35.000000,93.000000,93.000000,93.000000

Mar 30 11:17:31 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Mar 30 11:17:31 DEBUG: Drop Msg 45
==============Mar 30 11:17:32 DEBUG: HTTP post: 15,24555
103,78561,92.000000,86.000000,86.000000,86.000000

Mar 30 11:17:32 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Mar 30 11:17:32 DEBUG: Drop Msg 45
==============Mar 30 11:17:33 DEBUG: HTTP post: 15,24555
103,78561,21.000000,49.000000,49.000000,49.000000

Mar 30 11:17:33 DEBUG: HTTP recv: 45,2,Wrong number of arguments

Mar 30 11:17:33 DEBUG: Drop Msg 45
==============Mar 30 11:17:34 DEBUG: HTTP post: 15,24555
103,78561,27.000000,62.000000,62.000000,62.000000

Mar 30 11:17:34 DEBUG: HTTP recv: 45,2,Wrong number of arguments
4

1 回答 1

0

最后我发现问题是我的程序 *srversion 不能和我之前尝试的一样。我学习了一种累积量的调试方法。

1.更改程序中的字符串模板。2.使用curl获取服务器收到的模板。$ curl -u https://.cumulocity.com/inventory/managedObjects/X-Id

然后检查模板是否与代码中的模板相同。

谢谢你的帮助。

于 2017-03-31T06:20:09.630 回答