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}}
->デバイスID node_0
{{TTN_app_id}}
->選択したアプリID dendrometer
{{TTN_app_pw}}
->図に示されているアプリケーションアクセスキー(アプリケーションの概要と同じビューにあります; https://console.thethingsnetwork.org/applications/<application_id>
)
{{TTN_dev_eui}}
そして{{TTN_app_eui}}
また、次の図の(デバイスにについて、私はTTNは、私は絵を掲示していますので、だと、それを隠していないので、これらは機密情報ではないと思います)
{{TTN_app_skey}}
->次の図(最後の図)にも示されているアプリケーションセッションキー
重要なのは...そのリクエストを使用して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ではないと思います。バージョンをリクエストでき、ログにエラーメッセージが表示されないため、すべてのコンテナが期待どおりに機能しているようです。
Also ... I feel the docs like incomplete, I'd like more info, about how to subscribe those provisioned devices with OrionCB (?) or Delete them (that's not shown in the docs, although is just a DELETE request to the proper URL.)
Anyway ... What I'm doing wrong? Thank you all.
EDIT: I feel like there is something wrong in the IoTAgent itself, there is a typo in the following error messages:
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"}
Because it isn't CaynneLPP but CayenneLPP. I've also opened an issue in its GitHub repo but I don't expect they answer any time soon. I actually feel like this project has been abandoned.
明らかにエンコーディングの問題です。私はarduinio-lmicライブラリによって提案されたエンコーディング方法を使用していましたが、FIWAREはCayenneLPPデータモデルで動作します。だから私はそのエンコーディング方法を置き換えてみるつもりです。
とにかく、特に@arjanに感謝します
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加