简体   繁体   English

IoTAgent-LoRaWAN 显然没有按预期工作

[英]IoTAgent-LoRaWAN is apparently not working as expected

I was trying to provisioning the IoTAgent-LoRaWAN using the TTN credentials, I'm following the official docs and this is my POST request:我试图使用 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}}"
        }
      }
    }
  ]
}

Obviously I'm using Postman to manage all those HTTP requests in a collection and I've setup a few environment variables that are:显然,我正在使用 Postman 来管理集合中的所有 HTTP 请求,并且我设置了一些环境变量:

{{node}} -> the device ID node_0 {{node}} -> 设备 ID node_0

{{TTN_app_id}} -> my app id which I've chosen dendrometer {{TTN_app_id}} -> 我选择dendrometer的应用程序 ID

{{TTN_app_pw}} -> the application access key shown in the picture (It can be found in the same view than the Application Overview; https://console.thethingsnetwork.org/applications/<application_id> ) {{TTN_app_pw}} -> 图中显示的应用程序访问密钥(可以在与应用程序概述相同的视图中找到; https://console.thethingsnetwork.org/applications/<application_id> 在此处输入图像描述

{{TTN_dev_eui}} and {{TTN_app_eui}} also shown in the following picture (regarding to device; I think these are not sensitive info because TTN is not hiding them, that's because I'm posting the picture) {{TTN_dev_eui}}{{TTN_app_eui}}也显示在下图中(关于设备;我认为这些不是敏感信息,因为 TTN 没有隐藏它们,那是因为我正在发布图片)

{{TTN_app_skey}} -> The Application Session Key also shown in the following picture (the last one) {{TTN_app_skey}} -> 应用程序 Session 密钥也显示在下图中(最后一个) 在此处输入图像描述

The point is... once I've provisioned IoTAgent using that request, the docker-compose logs -f iot-agent shows the following errors:关键是……一旦我使用该请求配置了 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"}

So I think there is something not working properly.所以我认为有些东西不能正常工作。 That's my docker-compose.yml , btw http://ix.io/2pWd那是我的docker-compose.yml ,顺便说一句http://ix.io/2pWd

However I don't think the problem is caused by docker, all containers are working as expected apparently because I can request their versions and I don't see error messages in the logs.但是我不认为问题是由 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.)另外......我觉得文档不完整,我想要更多信息,关于如何使用 OrionCB 订阅这些配置的设备(?)或删除它们(文档中没有显示,尽管只是对适当的 DELETE 请求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:编辑:我觉得 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"}

Because it isn't CaynneLPP but CayenneLPP.因为它不是 CaynneLPP 而是 CayenneLPP。 I've also opened an issue in its GitHub repo but I don't expect they answer any time soon.我还在其 GitHub 存储库中打开了一个问题,但我预计他们不会很快回答。 I actually feel like this project has been abandoned.我真的觉得这个项目已经被放弃了。

It's apparently a problem with encoding, I was using the encoding method suggested by arduinio-lmic library but FIWARE does work under CayenneLPP data model.这显然是编码的问题,我使用的是arduinio-lmic库建议的编码方法,但 FIWARE 确实在 CayenneLPP 数据 model 下工作。 So I'm going to try replace that encoding method.所以我将尝试替换该编码方法。

Thank you all anyway and specially to @arjan无论如何,谢谢大家,特别是@arjan

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

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