I want to process the data traffic of all devices in one ttn application with node-red.
How can i setup a node-red node for this?
The Node-RED built-in MQTT client node can use wildcards in its subscription, such as +/devices/+/up
. Is that what youāre after?
For the serverās credentials use the applicationās human readable id from TTN Console for the user name, and for the password use an Access Key, with at least the āmessagesā right.
Iām currently using the TTN nodes in node-red. Must i switch to MQTT to have the āall devices upā feature?
I need a flow that listenes for all devices of a certain ttn app, but will only answer to that one device which actually sent a message, e.g. like a āDHCPā server.
I switched in Node-Red from TTN node to MQTT node.
After 2 hours of fiddling i still not manage it to get the MQTT output node to trigger a downlink in ttn console.
Has anyone an example how to correctly feed MQTT output node in node-red, so that TTN starts downlink?
Looking in my Node-RED instance I just found an old, but still operational, TTN message client that did not have any device id configured, and shows uplinks for all devices in that application.
But the above surely is an outdated version; Iāve no idea if more recent versions of that library still support this. (I thought I stopped using this TTN Node-RED library long agoā¦)
A regular Node-RED MQTT output works just fine for me. Like:
The inject node just injects a boolean true
when clicking the button on its left side, which I ignore. In the function node, Iāve used:
const payload = [0x01, 0x02, 0x03, 0x04];
return {
topic: 'my-app-id/devices/my-device-id/down',
payload: {
port: 1,
confirmed: false,
payload_raw: new Buffer(payload).toString('base64'),
schedule: 'replace'
}
};
Ok, got it running now, the ābase64ā was the secret sauceā¦
Thanks for your help!
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.