I a looking to troubleshoot sending commands to my downlink of my device on the TTN network.
In the TTN console I do this and it works:
But from Node Red I have the following in a function feeding into a MQTT Out and it does not work: [Device and App ID are of course REPLACED as to not share them]
// TTN downliank settings
var dev_id = "REPLACED"; // from previous MQTT received message in this case;
var dlPort = 2; // downlink port in this application
var dlConfirmed = true;
var dlScheduled = "replace"; // allowed values: "replace" (default), "first", "last"
// MQTT settings
msg.topic = "v3/REPLACED@ttn/devices/" + dev_id + "/down/push";
msg.qos = 0;
msg.retain = false;
var payload_raw = Buffer.alloc(2, 0);
payload_raw[1] = 0x12c; // Changed uplink fequency to 5min (300 sec in Hex)
var base64data = payload_raw.toString('base64');
// use payload fields
var message = {
port: dlPort,
confirmed: dlConfirmed,
schedule: dlScheduled,
payload_raw: base64data,
};
msg.payload = message;
return msg;
I was referencing this post:
and this post:
as starting points but have hit a dead end for now. Any help is appeciated.
Here is part of the debug output to show a payload example.
But even still I have yet to seem to get this to work.
And thoughts on how to even troubleshoot this would be good as I do not even know if the command from Node Red is reaching the TTN application. None of the live data views show it.