Now I'm trying to pull out the array by itself in a function and display the string which is simply "Hello World!"
I can't quite figure out the function to select just the array and display the string. Maybe there is another way rather than using a function node. Any help would be appreciated.
I think I figured it out. I converted to string in MQTT payload formatter with:
function decodeUplink(input) {
var msg = "";
var data = {};
for (var i = 0; i < input.bytes.length; i++) {
msg += (String.fromCharCode(input.bytes[i]));
}
data.message = msg;
return {
data: data,
}
}
In a function node, you always access properties via the msg object.
E.g. msg.payload or msg.topic etc.
Canned text...
There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.
Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.