Netvox configuration
Configuration guide
Payload codec
Application setup
Add the device to UMA
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
function Decode(fPort, bytes, LoRaObject) {
var decoded = {
version: bytes[0],
device_type: "R718N325",
report_type: bytes[2],
battery_voltage: (bytes[3] & 0x7F) * 0.1,
battery_low: (bytes[3] & 0x80) ? true : false,
currents_mA: {
L1: (bytes[4] << 8 | bytes[5]),
L2: (bytes[6] << 8 | bytes[7]),
L3: (bytes[8] << 8 | bytes[9])
},
multiplier: {
L1: 1,
L2: 1,
L3: 1
}
};
// Add devEUI and ISO timestamp if available
if (LoRaObject) {
decoded.devEUI = LoRaObject.devEUI;
decoded.rssi = LoRaObject.rxInfo && LoRaObject.rxInfo[0] ? LoRaObject.rxInfo[0].rssi : null;
decoded.snr = LoRaObject.rxInfo && LoRaObject.rxInfo[0] ? LoRaObject.rxInfo[0].loRaSNR : null;
decoded.data = LoRaObject.data;
decoded.time = LoRaObject.time ? LoRaObject.time : new Date().toISOString();
} else {
decoded.time = new Date().toISOString();
}
return decoded;
}