Vraag

thingsML usage for LoRaWAN

  • 13 november 2020
  • 2 reacties
  • 49 keer bekeken

Hi all,

I’ve been trying to use the thingsML to send data from my device to the KPN things portal. So far, I haven’t been successful. I was wondering if someone can help me see the error in my work. My device is SodaqOne, and I am using RN2483 library functions for LoRa communication. I can send raw payloads to the portal and back. There are no problems there.

I forward the portal to an HTTP endpoint, a webhook, and I can see the SenML format JSON packet there. For example:

I send {0xf5, 0x19} from SodaqOne, I see the Confirmed data+mac on the portal as payload = f519, and then on the webhook, I can see the  raw data as below:

[
{
"bn": "urn:dev:DEVEUI:0059Axxxxxxxxxxx:",
"bt": 1605187216
},
{
"n": "payload",
"vs": "f519"
},
{
"n": "port",
"v": 1
}
]

Next, I tried to use the thingML library following this guide. What I try to do is to send a test data such as [{"i_":-24,"v":23.0}]. So I send the raw bytes of corresponding messages, and in the flow, I enable the “Decoded ThingsML for LoRa payload.”

Unfortunately, what I see on the webhook is still raw bytes:

[
{
"bn": "urn:dev:DEVEUI:0059Axxxxxxxxxxx:",
"bt": 1605201983
},
{
"n": "payload",
"vs": "5b7b22695f223a2d32342c2276223a32332e307d5d"
},
{
"n": "port",
"v": 1
}
]

For the sake of making it short, I will share my code if asked.


2 reacties

Reputatie 6
Badge +6

Hi @denizdanaie,

Thanks for posting your question! 
And excuse me for me late response. My knowledge about thingsML is very low, so I had to get some help from my colleagues. As far as we can see you are doing everything correctly, except for one thing. You are sending the payload in JSON, but ThingsML for LoRa is only supporting CBOR. You can use the ThingsML Playground to convert from JSON to CBOR. 

Hopefully this will help you!

Dear @Rick S.,

Thanks a lot for your answer. I was actually waiting for your answer to continue my project.

I have never worked with CBOR, so it might take a while, but I will try to use it and see if it works.

If not, I will post the new issues here so that I can get your help again!

Reageer