let buffer = Buffer.from(msg.payload);
let hexString = [];
for (let i=0; i< buffer.length;i++) {
let hex = buffer.readUInt8(i).toString(16);
hex = hex.length < 2 ? '0' + hex : hex;
hexString.push(hex.toLocaleUpperCase());
};
msg.payload = hexString.join('');
return msg;