Hi, I am establishing a project using F8926-GW LoRaWan Gateway to transmit the data to IPC. The LoRaWan gateway is transmitting base64 data, how am I going to decode the base64 data by using Node Red?
Give this a try:
// 1. Check if the payload exists and is a string
if (typeof msg.payload === 'string') {
// 2. Convert the base64 string into a Node.js Buffer
let decodedBuffer = Buffer.from(msg.payload, 'base64');
// 3. Convert the Buffer into a standard UTF-8 string
msg.payload = decodedBuffer.toString('utf8');
}
return msg;
Returns "abcd" from your example.
