TTN-v3 does not executes the downlink payload even after reaching the LNS

Dear Team,

I am having a device communicating in the TTN-v3 LNS server. When i pass the payload using “frm_payload” its executes fine and i am getting the output.

When i pass my input using “decoded_payload” its not getting executed.

My input:

{
    "end_device_ids" : {
        "device_id" : "valve-controller-001",
        "application_ids" : {
            "application_id" : "smart-valves-demo"
        }
    },
    "downlinks": [{
        "f_port": 13,
        "decoded_payload" : {
            "Sync_RTC": 1
        },
    "priority": "NORMAL",
    "confirmed": true
    }]
}

My encoder script:

function encodeDownlink(input, f_port) {
  var bytes = [];
   bytes[0] = input.Sync_RTC;
 return bytes;
 }

My downlink reaches the LNS where as its not getting executed.

  1. At the time of downlink sent via https:
    “data”: {
    @type”: “type.googleapis.com/ttn.lorawan.v3.ApplicationDownlink”,
    “f_port”: 13,
    “decoded_payload”: {
    “Sync_RTC”: 1
    },
    “confirmed”: true,
    “priority”: “NORMAL”,
    “correlation_ids”: [
    “as:downlink:01F1MF4PMNG80TMSK76JQCXD8B”,
    “rpc:/ttn.lorawan.v3.AppAs/DownlinkQueuePush:c59e869d-b31b-4263-927d-34b40b641450”
    ]
    },

  2. During execution:
    “data”: {
    @type”: “type.googleapis.com/ttn.lorawan.v3.DownlinkMessage”,
    “raw_payload”: “oJ7ECyaAOwANMNL5UA==”,
    “payload”: {
    “m_hdr”: {
    “m_type”: “CONFIRMED_DOWN”
    },
    “mic”: “MNL5UA==”,
    “mac_payload”: {
    “f_hdr”: {
    “dev_addr”: “260BC49E”,
    “f_ctrl”: {
    “adr”: true
    },
    “f_cnt”: 59
    },
    “f_port”: 13,
    “full_f_cnt”: 59
    }
    },

The payload value is missing. Can you help me on this?

Thank you in advance

Please do not post pictures of text.

Okay i have modified the post accordingly.

Can you help me on the above issue?

You’ve not formatted the JSON …

I can look at the actual issue later on, this morning I’m only in moderation mode.

Dear descartes

I have checked my JSON, using a JSON formatter and i have sent the downlink still the same occurs.

Here is my downlink:

    {
       "end_device_ids":{
          "device_id":"valve-controller-001",
          "application_ids":{
             "application_id":"smart-valves-demo"
          }
       },
       "downlinks":[
          {
             "f_port":13,
             "decoded_payload":{
                "Sync_RTC":1
             },
             "priority":"NORMAL",
             "confirmed":true
          }
       ]
    } 

My downlink is reaching the TTN-V3, but its not getting executed.

How can i make it work?

Still not formatted the JSON …

PS, I looked at the issue and I can see differences between reality & your code, which is a hint about a solution, but format the posts properly please.

Dear descartes,

I have formatted the last post but i couldn’t format the 1st post.

Please do share me the solution for it, as we are in urgent situation.

Thank you

If you look at the documentation for the v3, you may find that your functions parameter would benefit from being bought up to date, and the return data structure probably needs updating.

I have used the same example provided in the documentation for the input and for the return data structure.

But, they output comes as different.

The expected output is [2] as per the example but i am getting some other value “CF” as output.

Any idea ?