# Sintaxis in function for downloading a MQTT downlink message to a device in TTN

**URL:** <https://discourse.nodered.org/t/sintaxis-in-function-for-downloading-a-mqtt-downlink-message-to-a-device-in-ttn/68759>\
**Category:** General\
**Created:** [9 October 2022 11:50 UTC](https://discourse.nodered.org/t/sintaxis-in-function-for-downloading-a-mqtt-downlink-message-to-a-device-in-ttn/68759 "2022-10-09T11:50:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 October 2022 12:58 UTC](https://discourse.nodered.org/t/sintaxis-in-function-for-downloading-a-mqtt-downlink-message-to-a-device-in-ttn/68759/2 "2022-10-09T12:58:05Z")

</div>

I don't use any of that equipment nor do I use LoRa - however, [looking at other posts](https://discourse.nodered.org/t/extracting-data-from-a-ttn-payload-for-insertion-into-mariadb/51381/8) I suspect your message structure is not right.

Try this instead...

```auto
msg.payload = {
    "end_device_ids":{
        "device_id": "eui-70b3d57ed005629d",
        "application_ids": {
            "application_id": "rfm6601-test-1"
        },
        "dev_eui": "70B3D57ED005629D",
        "join_eui": "323531322F002E00",
        "dev_addr": "260B7D71"
    },
    "downlinks": [{
            "f_port": 15,
            "frm_payload": msg.payload.toString("base64"),
            "priority": "NORMAL"
    }]
}
return msg;

```

(this ↑ is pure guess work - if it does not work, point me to documentation and I'll try to help further)

---

_[View the full topic](https://discourse.nodered.org/t/sintaxis-in-function-for-downloading-a-mqtt-downlink-message-to-a-device-in-ttn/68759)._
