Thingsboard CE shared Attribute send to lora device

I want to send from thingsboard CE shared attribute to lora device. does anyone know how to do that? I tried thingsboard using rules and mqtt. But did not work. Can anyone help me further?

This is not implemented / supported.

Thanks for the quick information.

I setup an http integration both in Loraserver and in TB and I send the downlink commands to the nodes using REST API in TB.
I’m using Thingsboard PE, so I don’t know if this way is also supported by TB-CE.
Gianluigi

Have you made a guide to this somewhere? Or would you like to explain/show how it was done?

I try to describe the main steps:

  • In TB create the payload that you want to send to the LoraServer downlink queue;
    For this I used a transformation node;
    The resulting payload is something like this:
    CreateDownPayload
    Note that it contains the downlink msg payload to be send to the endnode converted to base64 (“data” in the below picture)
  • In order to send it to LoraServer, connect the output of this transformation node to the input of a rest api call rule node configured like this:

    Of course use your LoraServer IP address and your JWT token.
    I don’t know if this is the best way, but till now it works …

[gigi130358] Thank you for your support. But i can not try it so, in CE Version external connection not possible.
I try it with your information to connect over Rule chain.
Georg

I also tried the same. It shows “internal server error”. Could you please tell me by which method you generated the JWT Token for accessing LoRa server from Thingsboard?

Thank you in advance.

The last post in https://github.com/brocaar/loraserver/issues/197 could help you to generate the JWT Token.
Gianluigi

Hello @gigi130358,

I am trying to follow your approach. I’ve updated External-rest API call node. How did you add downlink msg payload in Transformation-script? I tried to put it in the RPC method params of the control widget of the dashboard. I get the following error at external-rest API node (debug events).

org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{“error”:“f_port must be \u003e 0”,“code”:3,“message”:“f_port must be \u003e 0”,“details”:}]

Did you use any control widget in your implementation? Can you share the transformation script? Did you do anything at the function Encode(fPort, obj, variables) of Device-Profile CODEC in the Chirpstack?

Thank you.

I’m sorry but I have been retired for a couple of years so I am unable to retrieve the information you requested

I did exactly you showed in the screenshot. I’m getting org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{"error":"devEUI: encoding/hex: invalid byte: U+0052 'R'","code":3,"message":"devEUI: encoding/hex: invalid byte: U+0052 'R'","details":[]}] at the rest API call node. Did you experienced such problems?

Here are some info
rule chain

create cmd payload:
var cmd = hexToBase64//(“81FFFFFFFF00184523000003844524000003844533000003844534000003848C”);
(“81FFFFFFFF001845230000012C45240000012C45330000012C45340000012CF4”); // 5 min

var deviceQueueItem = {
confirmed: true,
data:cmd ,
devEUI: metadata.deviceName,
fCnt: 0,
fPort: 223,
jsonObject:""
}
msg = {
deviceQueueItem: deviceQueueItem
}
return {msg: msg, metadata: metadata, msgType: msgType};

function hexToBase64(hexstring) {
return btoa(hexstring.match(/\w{2}/g).map(function(a) {
return String.fromCharCode(parseInt(a, 16));
}).join(""));
}