Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

MLRT-E-iEU-AR REV 1.0

Javascript file

View file
nameMLRT-E-Javascript_Decoder.js

Use the above script (MLRT-E-Javascript_Decoder.js) to decode the packets coming from Multitech Gateway

Eg. The MULTITECH Gateway sends the following JSON Output via MQTT

Code Block
languagejson
{    "tmst":1032057036,
     "chan":6,
     "rfch":1,
     "freq":867.7,
     "stat":1,
     "modu":"LORA",
     "datr":"SF10BW125",
     "codr":"4/5",
     "lsnr":9.5,
     "rssi":-53,
     "opts":"",
     "size":6,
     "fcnt":26,
     "cls":0,
     "port":1,
     "mhdr":"403f35f601801a00",
     "data":"AAAzMgGA",
     "appeui":"31-27-9a-c1-1e-c0-70-00",
     "joineui":"31-27-9a-c1-1e-ca-20-00",
     "deveui":"36-38-37-34-66-32-6f-18",
     "devaddr":"01f6353f",
     "ack":false,
     "adr":true,
     "gweui":"00-80-00-00-00-01-8c-8a",
     "seqn":26,
     "time":"2024-05-08T09:34:03.030289Z"}

The payload is present in the "data" field as a base64 value

Code Block
languagejson
"data":"AAAzMgGA"

The base64 value is converted to HEX and the output is decoded using the "decode_MLRT-E_Uplink" function

The "decode_MLRT-E_Uplink" function uses HEX Payload as input

"data":"AAAzMgGA" in HEX

Code Block
languagetext
# HEX BUFFER : [0x00, 0x00, 0x33, 0x32, 0x01, 0x80]
# In DECIMAL : [0, 0, 51, 50, 1, 128]

Example Decoded Output:

Code Block
languagetext
NTC1_Raw_Value: 0
NTC1_Temperature: 0
NTC2_Raw_value: 25.5
NTC2_Temperature: 25
Battery_Low: 0
Radio_Communication_Error: 0
Received_Signal_Strength: 0
NTC2_Sensor_Error: 0
NTC1_Sensor_Error: 1
Storage_Voltage: 2.56