1. Home
  2. Radionode RN320 LoRaWAN Sensor Integration Guide with Tago.io Platform

Radionode RN320 LoRaWAN Sensor Integration Guide with Tago.io Platform

Introduction

This guide explains how to connect the RN-320 sensor series to the ThingsBoard platform.

The Radionode RN320 series is a robust, battery-operated wireless environmental sensor, professionally engineered for durability and extreme longevity, boasting an unbelievable 10-year battery life (RN320-BTH model with 17,000mAh) facilitated by LoRaWAN technology for easy, wide-range network setup.

This specific RN320-BTH model excels with an embedded high-accuracy temperature and humidity sensor, critical data protection via a retransmission function that prevents sample drops, and permanent local storage on a microSD card. User interaction is enhanced by an E-paper display, loud buzzer (97dBA), and a 3-Color LED indicator (Best, Moderate, Bad), while quick access to comprehensive remote monitoring is ensured by simple QR code registration to the Radionode365 service. It also offers easy installation with a magnet and wall bracket.

General Features of RN320 Device

  • Long Range Wireless / LoraWAN ®
  • E-Paper Display
  • Loud Buzzer 97dBA
  • 3 Color LED Indicator (Best, Moderate, Bad)
  • Long Battery Life (17000mAh)
  • MicroSD Card supported
  • Easy Installation with Magnet and Wall Bracket

In this integration scenario we use the RN320-BTH series for the demo.

Prerequisites

To continue with this guide, you will need the following:

  • RN320-BTH Temperature & Humidity Cloud Data Logger
  • LoRaWAN® gateway (e.g., Radionode LoRaWAN Gateway)
  • Configured integration on a networks server and ThingsBoard
  • Network Server account (The Things Stack)
  • Tago.io account (PE account)

Device Connection: The Things Stack Community Setup

Register Application

The first step is to register in the The Things Stack cloud console. Next, create an application in The Things Stack console.

  1. Go to the console and open the Applications section.
  2. Press the Add application tab and then fill in the Application ID and Application Name.
  3. Click Create application.

Payload Decoder

To ensure successful data transmission, both the device and the network server must be correctly configured. Our device submits data in binary format.

In this documentation, we explain how to add the payload formatters in the TTN platform.

  1. In the application tab, click on Payload formatters and select the Uplink option.
  2. Copy and paste the payload formatter code below into the editor.
function decodeUplink(input) {
  const res = Decoder(input.bytes, input.fPort);
  if (res.error) {
    return { errors: [res.error] };
  }
  return { data: res };
}

function Decoder (bytes, port) {
  const readUInt8 = b => b & 0xFF;
  const readUInt16LE = b => (b[1] << 8) + b[0];
  const readInt16LE = b => {
    const ret = readUInt16LE(b);
    return (ret > 0x7FFF) ? ret - 0x10000 : ret;
  };
  const readUInt32LE = b => (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + b[0];
  const readInt32LE = b => {
    const ret = readUInt32LE(b);
    return (ret > 0x7FFFFFFF) ? ret - 0x100000000 : ret;
  };
  const readFloatLE = b => {
    const buf = new ArrayBuffer(4);
    const view = new DataView(buf);
    for (let i = 0; i < 4; i++) view.setUint8(i, b[i]);
    return view.getFloat32(0, true); // ieee754 float
  };

  const head = readUInt8(bytes[0]);
  const model = readUInt8(bytes[1]);

  if (head === 11) {
    // Check-in frame
    const timestamp = readUInt32LE(bytes.slice(2, 6));
    const date = new Date(timestamp * 1000);
    const yyyy = date.getUTCFullYear();
    const mm = (date.getUTCMonth() + 1).toString().padStart(2, '0');
    const dd = date.getUTCDate().toString().padStart(2, '0');
    const verFormatted = parseInt(`${yyyy}${mm}${dd}`);
    const interval = readUInt16LE(bytes.slice(6, 8));
    const splrate = interval;
    const bat = readUInt8(bytes[8]);
    const millivolt = readUInt16LE(bytes.slice(9, 11));
    const volt = (millivolt / 1000).toFixed(3);
    const freqband = readUInt8(bytes[11]);
    const subband = readUInt8(bytes[12]);

    return {
      head,
      ver: verFormatted,
      interval,
      splrate,
      bat,
      volt,
      freqband,
      subband
    };
  }
  else if (head === 12 || head === 13) {
    // Sensor / Hold
    const tsmode = readUInt8(bytes[2]);
    const timestamp = readUInt32LE(bytes.slice(3, 7));
    const splfmt = readUInt8(bytes[7]);

    if (splfmt !== 2) {
      return { error: "Unsupported Sensor Data Format: " + splfmt };
    }

    const raw_size = 4;
    const data = bytes.slice(8);
    const ch_count = data.length / raw_size;
    const data_size = data.length;
    let offset = 0;
    let temperature = null, humidity = null;

    if (ch_count < 2) {
      return { error: "Unsupported Sensor Data Size:" + ch_count };
    }

    temperature = parseFloat(readFloatLE(data.slice(offset, offset + raw_size)).toFixed(2));
    if (temperature <= -9999.0) temperature = null;
    offset += raw_size;

    humidity = parseFloat(readFloatLE(data.slice(offset, offset + raw_size)).toFixed(2));
    if (humidity <= -9999.0) humidity = null;

    return {
      head,
      model,
      tsmode,
      timestamp,
      splfmt,
      data_size,
      temperature,
      humidity
    };
  }

  return { error: "Unsupported head frame: " + head };
}

End Device Registration in The Things Stack

Next step is an End Device creation in the TTS. Open the Devices page and click the Register device tab.

To register the End Device, enter the following details:

  • Input Method: Select the end device in the LoRaWAN Device repository (Radionode devices are already registered in the Thing Stack platform).
  • End Device Brand: Choose the option Dekist Co.Ltd.
  • Model: Choose among the Radionode LoRaWAN models.
  • Choose the appropriate cluster where the device can be added.

Next, we need to enter the DevEUI correctly in the slot provided there. You can find the DevEUI on the sticker on the side of the device.

After this, add an End Device ID in the slot given and complete the end device registration by clicking Register end device.

Create device on Tago

After creating an account in the tago.io platform, the next step is to create a device. In the screenshot below you can see a devices tab, once you click that there is a tab to add a device.

After clicking the Add device button you will be prompted to a screen where you can add the company name Radionode in the search connectors tab. Since Radionode devices have device provisioning earlier, you can just install the device in one click. All the payload decoders are already stored in the device template, making it easy to install.

After choosing the Rn320BTH option you will be prompted to a screen as shown below. Just choose the LoRaWAN TTN option here.

After choosing the TTN option, you can just give a name to the device, choose the data retention period, and add the Device EUI number given on the side of the device. And click create my device.

Check data on Tago.io

To access data, just go to the devices page and click on the device name and the Data button. We can access the real-time data.

Dashboards can be created to visualize the data easily. In the main page you can find a dashboard tab with a “+” sign.

After that we can give a name to the dashboard and it is possible to choose from the template or create a dashboard with choosing our own widgets.

You can choose the widget and then set the widget name and then choose the device from where the data needs to be shown in real-time and the parameter to be shown.

After the dashboard setting, we can visualize the data in real-time and can download the data in csv or xlsx format also.

Updated on 2026년 5월 8일

Was this article helpful?

Leave a Comment