简体   繁体   中英

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:

{
  "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:

{{node}} -> the device ID node_0

{{TTN_app_id}} -> my app id which I've chosen dendrometer

{{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_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_app_skey}} -> The Application Session Key also shown in the following picture (the last one) 在此处输入图像描述

The point is... once I've provisioned IoTAgent using that request, the docker-compose logs -f iot-agent shows the following errors:

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

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.

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.

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. So I'm going to try replace that encoding method.

Thank you all anyway and specially to @arjan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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