How can I get array components values

Note that this is not an Array it is a Buffer, which is not the same thing. However, if you just want individual bytes as numbers then you can access as if it is an array of 8 bit integers. So you can use, for example
var x = msg.payload[2]
to get element 2. There are a number of questions though. Is that what you are trying to do or do you want the buffer split into a sequence of messages each containing one value or what?

If you want one number per message then first convert it to an explicit array using

msg.payload = [...msg.payload]
return msg

then feed it into a Split node and it will give you a sequence of messages, each with one number.

1 Like