Reputation: 1089
I would be interested on using node-red output function to publish kind of payload.
I know that the command using mosquitto publisher the call would be like this
mosquitto_pub -h staging.thethingsnetwork.org -t '0807060504030201/devices/0102030405060708/down' -u 0807060504030201 -P 'I0f+e1W+CWgIiuIC4SjR5cpLxFZQfK2agDEpuCBpttI=' -m '{ "payload":"SGVsbG8gd29ybGQK","port":1,"ttl":"1h"}'
Thus I was wondering how to fill correctly those paremeters on the mosquitto publish function available in node-red, so far I have translated the previous call to the function as
-server: staging.thethingsnetwork.org
-client ID: blank
-username: 0807060504030201
-password: I0f+e1W+CWgIiuIC4SjR5cpLxFZQfK2agDEpuCBpttI=
The field payload, will be injected from an input inject function where payload is as above and in json format.
Is that valid setup?
Thanks in advance,
REgards
EDIT suggestions of knolleary in images
Upvotes: 0
Views: 1592
Reputation: 10117
The MQTT nodes in Node-RED do not support passing in the broker details with the message, you must manually configure the MQTT broker node.
Once that is configured and deployed, messages passed to the MQTT output node will get published to the broker, using the payload
and topic
properties of the message.
Upvotes: 2