I have some data in database that I need to sand on mqtt.
My data looks like this : 50C0E54373C3B68
First thing I need to do is converting this string to hex to look like this:
0x50 0xC0 0xE0...
I tried to read every byte and save it to array with this code:
var desKey = msg.payload.desKey;; var raw = new Buffer(26); raw  = desKey; raw  = desKey; raw  = desKey; raw  = desKey; raw  = desKey; raw  = desKey; msg.payload = raw; retrun msg;
but if character is not number array is empty.
how can I get 0xA 0xB 0xC... values to my array?