Hi,
I'm struggling to get a function working and not sure why, I'm sure it'll be an easy answer but I just don't understand enough yet to get it.
I'm trying to get a section of the data sent into a function using substr() but I get an error in the debug window.
code in the function
var mac = msg.payload.substr(14, 12);
msg = mac;
return msg;
The payload is a UDP message set as a Buffer in the node, is this why it's failing? maybe it's not a string?? do I need to covert it?
As usual any help will be greatly appreciated, thanks
Phil