Dragino LT-22222-l downlink

Hi, at the moment I’m trying to publish a payload as a downlink to my Dragino LT-22222-l.
As mentioned I’m using an Dragino LT-22222-l as a relais for a water pump.
The problem I’m having at the moment is that I’m a little bit confused by the process of publishing downlinks via Node-Red through MQTT.
I made a flow as mentioned in the TTS documentary and its working “fine” as far as I can publish something to the Dragino.
But I’m having some trouble sending the payload I want. In the Manual from the relais they say I can change the status from the relais by sending “03 01 01”. This message is working if I’m publishing it via the messaging tab on the “TTN end device” tab.

This is my Node red Flow:

[
    {
        "id": "858e654ae4aa234b",
        "type": "tab",
        "label": "Test Flow",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "28c608ba60d7370c",
        "type": "inject",
        "z": "858e654ae4aa234b",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[48,120,48,51,48,49,48,49]",
        "payloadType": "bin",
        "x": 390,
        "y": 340,
        "wires": [
            [
                "4cbc50294e15182b"
            ]
        ]
    },
    {
        "id": "38efb5acf61103d1",
        "type": "mqtt out",
        "z": "858e654ae4aa234b",
        "name": "Relai downlink",
        "topic": "v3/{application id}@{tenant id}/devices/{device id}/down/push",
        "qos": "1",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "f2478b293863041b",
        "x": 860,
        "y": 340,
        "wires": []
    },
    {
        "id": "60dfb9b9d462d7cf",
        "type": "debug",
        "z": "858e654ae4aa234b",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 850,
        "y": 300,
        "wires": []
    },
    {
        "id": "4cbc50294e15182b",
        "type": "function",
        "z": "858e654ae4aa234b",
        "name": "",
        "func": "return {\n  \"payload\": {\n    \"downlinks\": [{\n      \"f_port\": 15,\n      \"frm_payload\": msg.payload.toString(\"base64\"),\n      \"priority\": \"NORMAL\"\n    }]\n  }\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 340,
        "wires": [
            [
                "60dfb9b9d462d7cf",
                "38efb5acf61103d1"
            ]
        ]
    },
    {
        "id": "f2478b293863041b",
        "type": "mqtt-broker",
        "name": "",
        "broker": "192.168.1.73",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": "",
        "credentials": {}
    }
]

Screenshot (45)

This flow is taking the payload (I assume in hexadecimal) and is converting it to (Base64) before publishing it in the right format to TTN.
But I don’t know which format I need to input the “030101” ( to activate the relais.
Is there anyone who can help me a little bit?

Im sorry if there are missing some information but I’m not sure which informations you exactly need.

Thank you very much in advance!

You need to know the f_port to send the downlink to.

I’m using the f_port 1 to send my downlinks.

In your flow you have f_port 15

In you inject node, change you payload type to a string and use the string “030101”

msg.payload = {
    "downlinks": [
        {
            "f_port": 1,
            "frm_payload": Buffer.from(msg.payload, 'hex').toString('base64'),
            "priority": "NORMAL"
        }
    ]
}

return msg;
'''

Have you sent this from the console to test that it works?

Oh thats actually a typo in the flow i copied the original one is exactly the same except the f_port. Im using the f_port 1.

I pasted “030101” into the “simulate Downlink” on the Application website and it worked.
Screenshot (46)

Okay, I figured it out by myself.
The problem was that the flow TTS delivered was not working as I expected it to work .

My solution was to convert the payload to Base64 and inject it like that.
So my Hex Payload “030101” is converted to “AwEB”.
After I converted it I was able to inject it into the function node which published the Payload as excepted.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.