我试图使用 TTN 凭据配置 IoTAgent-LoRaWAN,我正在关注官方文档,这是我的 POST 请求:
{
"devices": [
{
"device_id": "{{node}}",
"entity_name": "LORA-N-0",
"entity_type": "LoraDevice",
"timezone": "Europe/Madrid",
"attributes": [
{
"object_id": "potVal",
"name": "Pot_Value",
"type": "Number"
}
],
"internal_attributes": {
"lorawan": {
"application_server": {
"host": "eu.thethings.network",
"username": "{{TTN_app_id}}",
"password": "{{TTN_app_pw}}",
"provider": "TTN"
},
"dev_eui": "{{TTN_dev_eui}}",
"app_eui": "{{TTN_app_eui}}",
"application_id": "{{TTN_app_id}}",
"application_key": "{{TTN_app_skey}}"
}
}
}
]
}
显然,我正在使用 Postman 来管理集合中的所有这些 HTTP 请求,并且我设置了一些环境变量:
{{node}}
-> 设备 IDnode_0
{{TTN_app_id}}
-> 我选择的应用程序 IDdendrometer
{{TTN_app_pw}}
-> 图中显示的应用程序访问密钥(可以在与应用程序概述相同的视图中找到;https://console.thethingsnetwork.org/applications/<application_id>
)
{{TTN_dev_eui}}
并且{{TTN_app_eui}}
还显示在下图中(关于设备;我认为这些不是敏感信息,因为 TTN 没有隐藏它们,那是因为我正在发布图片)
{{TTN_app_skey}}
-> Application Session Key 也如下图所示(最后一张)
关键是......一旦我使用该请求配置了 IoTAgent,就会docker-compose logs -f iot-agent
显示以下错误:
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.689Z","level":"info","message":"New message in topic"}
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.690Z","level":"info","message":"IOTA provisioned devices:"}
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.691Z","level":"info","message":"Decoding CaynneLPP message:+XQ="}
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.691Z","level":"error","message":"Error decoding CaynneLPP message:Error: Invalid CayennLpp buffer size"}
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.691Z","level":"error","message":"Could not cast message to NGSI"}
所以我认为有些东西不能正常工作。那是我的docker-compose.yml
,顺便说一句http://ix.io/2pWd
但是我不认为问题是由 docker 引起的,所有容器显然都按预期工作,因为我可以请求它们的版本并且我没有在日志中看到错误消息。
另外......我觉得文档不完整,我想要更多信息,关于如何使用 OrionCB (?) 订阅这些配置的设备或删除它们(文档中没有显示,尽管只是对适当的 DELETE 请求网址。)
无论如何......我做错了什么?谢谢你们。
编辑:我觉得 IoTAgent 本身有问题,以下错误消息中有错字:
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.691Z","level":"info","message":"Decoding CaynneLPP message:+XQ="}
fiware-iot-agent | {"timestamp":"2020-06-23T11:45:53.691Z","level":"error","message":"Error decoding CaynneLPP message:Error: Invalid CayennLpp buffer size"}
因为它不是 CaynneLPP 而是 CayenneLPP。我还在其 GitHub 存储库中打开了一个问题,但我预计他们不会很快回答。我真的觉得这个项目已经被放弃了。