Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error decoding CaynneLPP message:Error: Invalid CayennLpp buffer size #99

Closed
jfernandz opened this issue Jun 23, 2020 · 2 comments
Closed

Comments

@jfernandz
Copy link

jfernandz commented Jun 23, 2020

I've posted this question in StackOverflow with more details. I could reproduce in here if necessary, but essentially I'm trying to provisioning my IoTAgent with this HTTP POST request (the {{whatever}} are stored in Postman environment)

{
  "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}}"
        }
      }
    }
  ]
}

And it's apparently doing it because I'm able to retrieve the device info when I do the GET request to http://localhost:4061/iot/devices but I'm having the following error messages in the docker logs:

fiware-iot-agent | {"timestamp":"2020-06-23T12:55:18.324Z","level":"info","message":"New message in topic"}
fiware-iot-agent | {"timestamp":"2020-06-23T12:55:18.325Z","level":"info","message":"IOTA provisioned devices:"}
fiware-iot-agent | {"timestamp":"2020-06-23T12:55:18.326Z","level":"info","message":"Decoding CaynneLPP message:+XQ="}
fiware-iot-agent | {"timestamp":"2020-06-23T12:55:18.326Z","level":"error","message":"Error decoding CaynneLPP message:Error: Invalid CayennLpp buffer size"}
fiware-iot-agent | {"timestamp":"2020-06-23T12:55:18.326Z","level":"error","message":"Could not cast message to NGSI"}

Could you point me to the right way? What I'm doing wrong?

@avbentem
Copy link

See my response in one of the other places you posted this: https://www.thethingsnetwork.org/forum/t/cayennelpp-and-fiware-iot-agent-for-lorawan/38052

@jfernandz
Copy link
Author

So ... according to @avbentem is a encoding problem, I must encode my payload using CayenneLPP library instead of arduino-lmic function.

Thank you again @avbentem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants