Telemetry upload bug if telemetry list is not ordered by timestamp or if elements of list have different number of key/value pairs
还没有人认领这个 Issue。
评估
调研方向
首先,通过 TBGatewayMqttClient.gw_send_telemetry 重现三个 telemetry 示例,并比较上传的结果。跟踪 telemetry 上传路径,以确定列表顺序和不同的值长度如何影响时间戳和条目;当每个值都能根据输入顺序或形状无关地与其对应的时间戳一起上传时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I'm using tb-mqtt-client version 1.10.10
I have a use-case where I'm uploading a list of telemetry readings. Depending on the order of the list, sometimes not all telemetry is being uploaded and sometimes the timestamp with which it is being uploaded is incorrect...
I first though that the list needed to be sorted by the timestamp attribute but then I had cases where even if it was sorted by timestamp it would work fine. It seems to be a combination of the list not being sorted with each element of the list not having the same number of key/value pairs.
I can't figure out or understand this behavior so any help would be appreciated.
This is the code snippet I'm using for testing this problem:
from tb_device_mqtt import TBPublishInfo
from tb_gateway_mqtt import TBGatewayMqttClient
telemetry =[...]
client = TBGatewayMqttClient("my.url.com", port=1883, username="token")
client.connect()
result = client.gw_send_telemetry('test device', telemetry)
success = result.get() == TBPublishInfo.TB_ERR_SUCCESS
client.disconnect()
print(success)
Following are some examples of the problem where the only thing I'm changing is the order of the telemetry list:
Example 1 - works fine
telemetry =[
{
'ts': 1736330010000,
'values': {
'test_1': 1,
'test_1_1': 1,
}
},
{
'ts': 1736330030000,
'values': {
'test_3': 3,
'test_3_1': 3,
}
},
{
'ts': 1736330020000,
'values': {
'test_2': 2,
'test_2_1': 2
}
},
]
Example 2 - does not upload test_2 and test_2_1 telemetry
telemetry =[
{
'ts': 1736330010000,
'values': {
'test_1': 1,
'test_1_1': 1
}
},
{
'ts': 1736330020000,
'values': {
'test_2': 2,
'test_2_1': 2
}
},
{
'ts': 1736330030000,
'values': {
'test_3': 3
}
},
]
Example 3 - test_1 and test_1_1 are being uploaded with the wrong timestamp. They are being uploaded with the same timestamp as test_3
telemetry =[
{
'ts': 1736330010000,
'values': {
'test_1': 1,
'test_1_1': 1,
}
},
{
'ts': 1736330030000,
'values': {
'test_3': 3,
}
},
{
'ts': 1736330020000,
'values': {
'test_2': 2,
'test_2_1': 2
}
},
]
- 主要语言
- Python
- 星标
- 130
- 派生
- 86
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
thingsboard/thingsboard-python-client-sdk 的其他 Issue
-
Add software OTA 未关闭enhancement
难度 3/5 1-2 天 新手友好度 48/100
-
enhancement
难度 3/5 1-2 天 新手友好度 38/100
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
thingsboard/thingsboard-python-client-sdk#40 · 3 个 reaction ·
-
Roadmap 未关闭
难度 5/5 一周以上 新手友好度 25/100
thingsboard/thingsboard-python-client-sdk#19 · 1 条评论 ·
查看 thingsboard/thingsboard-python-client-sdk 的全部 Issue
相似的 Issue
-
bug ci good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
documentation
难度 2/5 半天 新手友好度 62/100
inmanta/inmanta-core#10835 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
-
sponsored
难度 2/5 1-3 小时 新手友好度 65/100