E2C Trinity LoRa Device to BACnet_IP Data Forwarding User Guide

E2C Trinity LoRa Device to BACnet_IP Data Forwarding User Guide

Robustel E2C Trinity LoRa Device to BACnet/IP Data Forwarding User Guide

Document Version: V1.0

Gateways & Firmware Requirement:

SoftwareE2C FieldE2C Facility
Gateways supportingLG3120eLG5120
Firmware Requirement=2.4.111(TBD)

Manual Description

Manual Purpose

This manual is designed for field engineers who need to forward LoRaWAN sensor data to higher-level systems (such as a BMS — Building Management System) via the BACnet/IP protocol. By following the step-by-step instructions in this manual, you will complete the full configuration workflow from LoRa southbound data collection to northbound BACnet/IP data forwarding.

Scope of Application

You do not need deep theoretical knowledge of the BACnet or LoRaWAN protocols. By following the instructions in this manual, you can easily configure the gateway as a BACnet Server, map LoRa sensor data tags to BACnet objects, and verify the data using third-party tools.

Basic Concepts & Network Topology

Gateway Role: From Collector to Server

In a typical IIoT project, imagine the gateway as a translator between your local sensors and the Building Management System (BMS). The data flow consists of two main stages:

First Stage (Southbound): LoRaWAN sensors communicate with the gateway via wireless radio frequencies. The gateway acts as a LoRaWAN Network Server (LNS), receiving encrypted hexadecimal raw data from the sensors and decoding it into readable engineering values (e.g., Temperature: 26°C) using a Payload Codec script, then storing them as internal "Tags".

Second Stage (Northbound): The gateway operates as a BACnet IP Server on the network. It takes those internal Tags, converts them into standard BACnet objects, and exposes them so that a higher-level system, such as a BMS or a BACnet testing tool like Yabe Explorer, can continuously read the data.

Preparations

(Note: This document uses the LG3120e gateway and E2C Field software as an example. The configuration process for other supported gateway and software combinations is very similar.)

Before starting the configuration, please ensure the following preparations are met:

Hardware Device Requirements

DeviceRequirement
GatewayA Robustel gateway with E2C Field or E2C Facility software installed, and must support LoRaWAN functionality. In this document, we use LG3120e with E2C Field for an example.
Debugging PCA PC used to log into the gateway's Web UI and run the BACnet testing software (Yabe).
Southbound DeviceLoRaWAN sensor(s) (powered on), to provide the initial data source.
Ethernet CableStandard Ethernet cables to connect the gateway and the debugging PC.

Environment and Network Requirements

  • LAN Connectivity: The gateway and the debugging PC must be connected to the same Local Area Network (LAN) (e.g., connected to the same switch or the gateway's LAN ports).
  • IP Allocation: Ensure all devices have valid IP addresses in the same subnet (e.g., 192.168.0.x) and there are no IP conflicts.
  • Port Accessibility: Ensure the PC's firewall allows UDP 47808 traffic (the standard BACnet/IP port).
  • Wireless Coverage: LoRaWAN sensors must be placed within the gateway's wireless signal coverage range (actual distance varies by environment, typically up to several kilometers).
  • BACnet Testing Tool: Download and install Yabe (Yet Another Bacnet Explorer) on your debugging PC. It is a free, industry-standard tool used to search and verify BACnet Server devices.

Prerequisite: Southbound Data Collection

Before forwarding data via BACnet, the gateway must first collect data from the field devices. In this guide, we will use a LoRaWAN temperature and humidity sensor as an example to collect two tags: Temperature and Humidity.

Logging into E2C Field

  1. Connect your PC to the gateway's LAN port.
  2. Open a web browser and enter the gateway's IP address (the default is usually 192.168.0.1).
  3. Log in with your credentials and click Edge Computing in the gateway's Web GUI to enter the E2C Field software.
  4. Workflow Overview To set up a new sensor, you need to complete the following steps:
    1. Check if the codec is pre-integrated (Step 1).
    2. If not pre-integrated, obtain and import the codec (Step 2).
    3. Create a Device Profile (Step 3).
    4. Add the LoRaWAN device and associate tags (Step 4).

Step 1: Check for Payload Codecs

The purpose of this step is to provide the gateway with a "translator" script to convert raw hexadecimal data sent by the sensor into readable data points (e.g., temperature, humidity, or battery level). You only need to do this once per sensor model. Please follow the path below based on your sensor's current status:

Please navigate to LNS Configuration > 【Payload Codecs】.

  • If your sensor model is listed, the codec is already built into the system; please proceed directly to 【4.4 Step 3】.
  • If your sensor is not listed, please proceed directly to 【4.3 Step 2】.

Step 2: Importing a Payload Codec

The system supports creating custom Codec files through either Add or Copy methods. These operations require the operator to have a technical background in Codec development. This step explains the method of importing a file, which has a lower barrier to entry and broader applicability, to complete the creation of a Payload Codec for the vast majority of standard use cases.

  1. Obtain the Raw Codec File:
    1. Primary Source: Contact the sensor manufacturer directly to obtain the raw Codec file compatible with your specific model.
    2. Public Resources: If the manufacturer does not provide the file directly, you may search for it in these common community repositories:
      - Milesight: https://github.com/Milesight-IoT/SensorDecoders
      - Dragino: https://github.com/dragino/dragino-end-node-decoder
      - Other vendors: https://github.com/TheThingsNetwork/lorawan-devices
  2. Convert Codec File Format: Use the conversion tool to process the raw Codec file into the TOML format supported by E2C Field.
    1. Place the e2c-trinity-codec-converter.exe tool and the extracted raw Codec folder into the same directory.
    2. Run the tool, then select the appropriate 【Vendor】 and 【Model】.
    3. Click 【Generate Codec TOML】 to complete the conversion.

  1. Import to E2C Field:
    1. Navigate to 【LNS Configuration】 > 【Payload Codecs】 > 【Import Codec】 > 【Import from file】.
    2. Upload the generated TOML file.
    3. Mandatory Testing (Critical Step): This step verifies the decoding logic and determines which data points are available for your device.
      1. Go to the 【Uplink Test】 tab, input the sample hex payload provided in your sensor’s manual, and click 【Run Decode】.
      2. You must ensure the system successfully outputs the JSON result. Please note that the data points available to your device are entirely dependent on the output of this Run Decode process. For example, if your Codec file theoretically supports 50 data points, but the hex payload only successfully parses 2 points during the test, then the device will only possess those 2 data points after binding to this Profile.
      3. If your sensor supports downlink control, please perform the same test under the 【Downlink Test】 tab.
      4. Once the test is successful, you must click 【Publish】 to save the codec; otherwise, it will not take effect.

Step 3: Create a Device Profile

Purpose of this step: To define the shared network settings for a specific model of sensor. Instead of typing the frequency and join settings for multiple identical sensors, you create one Profile and apply it to all of them.

  1. Go to LNS Configuration > Device Profiles > Create New.
  2. Configure the parameters based on your sensor's manual according to the table below:
Parameter NameConfiguration DescriptionRecommended / Example Value
Payload CodecThe translator script you verified in Step 1.e.g., AM102_Codec
NameA recognizable name for this model template.e.g., Profile_AM102_EU868
Description(Optional) Brief details about this profile's purpose.e.g., Milesight AM102 sensor profile
RegionThe LoRa radio frequency band applicable to your physical location.e.g., EU868, US915, AS923
MAC VersionThe LoRaWAN protocol version supported by the sensor (check the sensor datasheet).e.g., 1.0.3
Regional parameters revisionThe revision of the LoRaWAN Regional Parameters specification the sensor complies with. Must be correct to avoid MAC errors.e.g., A, B, or RP002-1.0.0
ADR algorithmThe Adaptive Data Rate algorithm used by the network server to optimize data rates. Usually left as default.e.g., Default ADR algorithm
Flush queue on activateClears any pending downlink messages when the device re-joins the network. Highly recommended for OTAA.Checked (Yes)
RX1 DelayThe delay in seconds for the first receive window. Keep the default unless specified otherwise by the sensor manual.e.g., 1
Expected Uplink interval (seconds)The expected time interval between regular sensor data reports.e.g., 3600 (for 1 hour)
Activation MethodHow the sensor securely connects to the gateway. OTAA is highly recommended for security.OTAA
Device ClassThe LoRaWAN operating class. Class A (battery-powered/sleeps) or Class C (mains-powered/always listening).e.g., Class A
  1. Click [Publish] to finish the profile.

Step 4: Add a Device and Associate Tags

Purpose of this step: To register the actual, physical sensor to the gateway using its unique IDs, and select which data points (Tags) you want to collect.

  1. Go to Data Collection > LoRaWAN Device > Add Device.
  2. Configure the physical device identity:
Parameter NameConfiguration DescriptionRecommended / Example Value
Device ProfileSelect the pre-configured template for this sensor model (created in Step 2). This automatically applies the correct network and decoding rules.e.g., Profile_AM102_EU868
NameA custom, recognizable name for this specific physical sensor.e.g., MeetingRoom_Sensor_01
Description(Optional) Additional notes about the device's installation location, purpose, or physical condition.e.g., 3rd Floor Meeting Room A
Device EUI (HEX)The globally unique 16-character hexadecimal identifier of the sensor. Typically found on the device's physical label or its packaging.e.g., 24E124128C012345
Join EUI (AppEUI)The globally unique 16-character hexadecimal identifier used to identify the Join Server during the OTAA process. Provided by the manufacturer.e.g., 5572404C696E6B4C
Application Key (AppKey)The 32-character AES-128 root key specific to this device, used to secure the OTAA activation. This is highly sensitive information provided by the vendor.e.g., 5572404C696E6B4C6F52613230313823
  1. Click [Next] to enter Tag Verification.
  2. The system will automatically list all available data points (Tags) this sensor can provide (e.g., temperature, humidity, battery). Check the boxes for the tags you need.
  3. Click [Confirm], then click the [Publish LoRa] button at the top right of the screen to apply changes.

Verifying Southbound Data Collection

Once added, power on or reboot your physical sensor to force it to join the gateway.

  1. Check Connection Status: Go to Data Collection > LoRaWAN Device. Look at the Status column. A green icon means the sensor has successfully joined the gateway.
  2. View Data: Click the [View Tags] icon (eye symbol) next to your device.
  3. Observe the Latest Value and Update Time columns. If you see real numbers (e.g., 25.5 for temperature) updating periodically, your sensor is successfully online and sending data.

Tip: You can check the Status to verify if the Temperature and Humidity tags are successfully reading values before proceeding to the BACnet configuration.

Northbound Configuration: BACnet IP Server

This is the core step where we expose our internal tags to the BACnet network.

Creating the BACnet IP Server

  1. Go to Data Forwarding.
  2. Click the [+ Create] button at the top, select BACnet IP Server, and click Save.
  3. You will enter the BACnet IP Server Configuration page. Enable BACnet IP Server Configuration and configure the Basic Settings:
ParameterDescription & Action
Local network portSelect the gateway's network interface connected to the LAN (e.g., br_lan(192.168.0.1)).
Port NumberKeep the default 47808. This is the standard UDP port for BACnet IP.
Local Device IDEnter a unique number for this gateway in your building network (e.g., 0). Note: This ID must not duplicate any other BACnet device on the same LAN.
Enable BBMDEnable this if the higher-level system (e.g., Yabe or BMS) and the gateway are on different subnets. Leave it disabled (default) if they are on the same subnet.

Mapping Tags to BACnet Objects (Crucial Step)

The Yabe / BMS does not understand the internal tag names like "Temperature". It only understands standard BACnet Objects like "Analog Input 1 (AI:1)". You must translate them using the BACnet IP Mapping Table.

  1. Scroll down to the BACnet IP Mapping Table section, click the [Add] button.
  2. In the new row, configure the mapping for your tags. Fill in the following parameters and Save:
ParameterDescriptionExample Value
Mapping Object TypeThe standard BACnet object type (e.g., AI for Analog Input).AI
DeviceSelect the Southbound device from which to collect data.MeetingRoom_Sensor_01
TagSelect the specific Southbound data variable to map.Temperature (or Humidity)
Instance numberThe unique instance identifier for the BACnet object.1 (for Temperature) / 2 (for Humidity)
Conversion ModeHow to handle decimal to integer conversion (Round, Ceil, Floor). This setting applies to both data forwarding (uplink) and write-back (downlink).Round
  1. Click [Add] again and repeat the process to map the second tag (Humidity) using the values shown in the table above.
  2. Click [Submit] at the bottom to save the configuration.
  3. Very Important: Click the [Publish] button at the top right of the page. The configuration will only take effect on the edge gateway after publishing.

Tip: This section uses AI (Analog Input) as an example to demonstrate the most basic mapping workflow. If you need to map other types of BACnet objects (such as BI, BO, MSI, etc.), or need to understand detailed rules for data conversion and write-back, please refer to Chapter 8 "BACnet Mapping Rules in Detail".

Verifying Configuration with Yabe

Search and Discover the Gateway

  1. Open the Yabe software on your PC.
  2. Click the green [+] (Add device) button under the Devices window.
  3. Select your local PC network interface and ensure the port is 47808 (Hexadecimal: BAC0, as Yabe uses hex for port numbers). Click Save.
  4. In the Devices tree on the left, you should see a node named BACnet IP Server 0 (where 0 is your Local Device ID). Click to expand it.

Read Object Values

  1. In the Objects window (bottom left), you will see the mapped objects:
    • AI:1 (mapped to Temperature)
    • AI:2 (mapped to Humidity)
  2. Click on AI:1. Look at the Properties window on the right. Find the Present_Value property. If it shows the correct real-time temperature (e.g., 28), your BACnet data forwarding is successful.

Verify Write-back (Optional)

If you have configured writable tags on the southbound side and mapped them to writable BACnet object types (such as AO, BO, MSO), you can verify the write-back function as follows:

  1. In the Yabe Objects window, find a writable object (e.g., AO:1) and right-click on it.
  2. Select Write Properties, change the Present_Value to the target value, and click confirm to send.
  3. Observe the result:
    • For wired devices (such as Modbus): write-back usually takes effect immediately.
    • For LoRaWAN sensors: The write-back command will be internally queued by the gateway and sent when the sensor wakes up for its next communication. Therefore, it will not take effect immediately. Please be patient (the waiting time depends on the sensor's configured reporting interval). This is determined by LoRaWAN's power-saving mechanism.
  4. Note: [Conversion Mode] also takes effect during write-back (downlink). For example, if set to Round, a floating-point value sent by the BMS will be converted to an integer according to this rule before being written back to the southbound device.


Common Troubleshooting

Issue / PhenomenonPossible CauseSolution
Yabe cannot find the gatewayPC and Gateway are not on the same network subnetPing the gateway's IP from your PC to ensure network connectivity. Check if Windows Firewall is blocking UDP 47808.
Yabe finds the gateway, but there are no AI:1 / AI:2 objectsConfiguration is submitted but not publishedGo back to the E2C Web UI, ensure you have clicked both [Submit] and [Publish].
Object exists in Yabe, but value is 0 or frozenThe Southbound collection failed, so the tag has no dataGo to Data Collection to verify if the LoRaWAN device is actually online and updating values.
BMS reports "Device ID Conflict"Another controller on the site is using the same Device IDChange the Local Device ID in the BACnet IP Server configuration to a unique number (e.g., change 0 to 2001). Submit and Publish.
Write-back command sent, but sensor does not respondLoRaWAN sensor is in sleep mode, command is queued; or sensor does not support downlink controlWait for the sensor's next wake-up (duration depends on the reporting interval), or confirm whether the sensor supports downlink control commands.
Yabe reports error during write-back (Error Code 25)The written value exceeds the boundary value range, or numeric overflow occurredCheck if the written value is within the allowed range, and confirm whether the object type supports write operations.
Value after write-back does not match expectation[Conversion Mode] conversion rule caused the numeric changeConfirm whether the [Conversion Mode] setting meets expectations (Round / Ceil / Floor).

Core Parameter and Mapping Rules Reference

Quick Parameter Reference

ParameterDefault / Recommended ValueDescription
Port47808 (UDP)Standard BACnet/IP port. Do not change unless specified by the BMS engineer.
Local Device IDUnique number (e.g., 0 to 4194303)The unique identifier of the gateway in the BACnet network.
AI (Analog Input)E.g., AI:1, AI:2Used for continuous numerical sensor data (Temperature, Pressure, Level). Mostly Read-Only.
AV (Analog Value)E.g., AV:1, AV:2Internal analog value, no physical I/O meaning. Read/Write.
AO (Analog Output)E.g., AO:1, AO:2Used for continuous numerical control targets (Frequency setting, Valve opening percentage). Read/Write.
BI (Binary Input)E.g., BI:1Used for digital status (Running/Stopped status, Fault alarm). Read-Only.
BV (Binary Value)E.g., BV:1Internal binary value, no physical I/O meaning. Read/Write.
BO (Binary Output)E.g., BO:1Used for digital control commands (Start/Stop command). Read/Write.
MSI (Multi-state Input)E.g., MSI:1Used for multi-state input (e.g., operating mode: Cooling/Heating/Ventilation). Read-Only.
MSO (Multi-state Output)E.g., MSO:1Used for multi-state output (e.g., setting operating mode). Read/Write.
MSV (Multi-state Value)E.g., MSV:1Internal multi-state value, similar to MSI/MSO but without physical I/O meaning. Read/Write.

BACnet Mapping Rules in Detail

Object Type to Southbound Data Type Mapping

BACnet Object TypeAllowed Southbound Source Data TypesDescription
AI / AO / AVushort, short, uint, int, ulong, long, float, double, BYTENumeric data is uniformly converted to REAL (float32) for forwarding.
BI / BO / BVAll types (excluding string, raw-data, BCD)Numeric / Boolean: 0 maps to INACTIVE (0), non-zero maps to ACTIVE (1).
MSI / MSO / MSVushort, short, uint, int, ulong, long, float, doubleInteger data is processed according to [Conversion Mode]. In BACnet standard, Present_Value starts from 1.
Conversion ScenarioUplink (Forwarding)Downlink (Write-back)
Float to IntegerDefault is Round; if user configures [Conversion Mode], follow the configurationDefault is Round; if user configures [Conversion Mode], follow the configuration
Float to BooleanNon-zero is trueNon-zero is true
Boundary Value OverflowYabe reports error, Status_Flags=1, Error Code=25Yabe reports error, Status_Flags=1, Error Code=25

Conversion Mode

The mapping page provides a [Conversion Mode] field, which is empty by default (dropdown single-select). Options are as follows:

  • Round: 2.3 → 2, 2.5 → 3
  • Ceil: 2.3 → 3
  • Floor: 2.3 → 2

If left blank, the system defaults to Round. This setting applies to both Data Forwarding (uplink) and Write-back (downlink).

+1 Offset for MSI / MSO / MSV

When mapping to MSI, MSO, or MSV object types, an [Enable +1 Offset] checkbox will appear, checked by default.

  • When checked: BACnet Present_Value = Original tag value + 1. For example, if the original tag value is 0, BACnet displays 1.
  • When unchecked: BACnet Present_Value = Original tag value, no offset. For example, if the original tag value is 0, BACnet displays 0.

Recommendation: In the BACnet standard, Present_Value for MSI/MSO/MSV starts from 1. If your original tag values start from 0, it is recommended to keep [Enable +1 Offset] checked to ensure compliance with the BACnet standard.


    • Related Articles

    • Robustel E2C Trinity BACnet Protocol(Northbound) User Guide

      Robustel E2C Trinity BACnet Protocol (Northbound) User Guide Document Version: V1.1 Gateways & Firmware Requirement: Software E2C Factory E2C Field E2C Facility Gateways supporting EG3120 EG5120 EG5200 LG3120 LG5120 Firmware Requirement (RobustOS Pro ...
    • Robustel E2C Trinity BACnet Protocol (Southbound) User Guide

      Robustel E2C Trinity BACnet Protocol (Southbound) User Guide Document Version: V1.1 Gateways & Firmware Requirement: Software E2C Factory E2C Field E2C Facility Gateways supporting EG3120 EG5120 EG5200 LG3120 LG5120 Firmware Requirement (RobustOS Pro ...
    • Robustel E2C Trinity BACnet Protocol(Northbound) User Guide

      Robustel E2C Trinity BACnet Protocol (Northbound) User Guide Document Version: V1.1 Gateways & Firmware Requirement: Software E2C Factory E2C Field E2C Facility Gateways supporting EG3120 EG5120 EG5200 LG3120 LG5120 Firmware Requirement (RobustOS Pro ...
    • Robustel E2C Trinity BACnet Protocol (Southbound) User Guide

      Robustel E2C Trinity BACnet Protocol (Southbound) User Guide Document Version: V1.1 Gateways & Firmware Requirement: Software E2C Factory E2C Field E2C Facility Gateways supporting EG3120 EG5120 EG5200 LG3120 LG5120 Firmware Requirement (RobustOS Pro ...
    • E2C Trinity LoRa to Modbus TCP Slave Protocol (Northbound) User Guide

      Document Version: V1.0 Gateways & Firmware Requirement: Software E2C Field E2C Facility Gateways supporting LG3120e LG5120 Firmware Requirement (RobustOS Pro Version) =2.4.111 (TBD) 1. Manual Description 1.1 Manual Purpose This manual guides field ...