I have a collection of sensors using LoRaWan to connect via ttn to a Node Red application and this is working very well.
For bandwidth economy I want to try not using my present payload configuration and just transmit an array of 8 bytes.
If I do this the output from the ttn uplink node is msg.payload:buffer[8]
followed by e.g. [10, 175, 0, 232, 0, 4, 9, 1]
.
In Node Red how do I extract the individual bytes from the array?
You can just use the function node and interact with the buffer as you would with normal javascript code. The API doc for the buffer object can be found here
You can also look at the node-red-contrib-binary node which lets you specific field types and names and it will build a JSON object from the byte stream.