DI Device Configuration Guide
This guide explains how to connect a DI (Digital Input) device to the Bridge IO, configure data collection, send it via LoRaWAN®, and remotely manage DI settings using downlink commands.
Prerequisite
Before configuring DI (Digital Input), prepare the following:
-
A DI (Digital Input) device.
-
IO.BOX (latest version recommended).
Connect DI Device to Bridge IO Device
This section demonstrates how to connect a device to the Bridge IO using the Digital Input interface, with the DH-ARD631-50 Outdoor Active PIR sensor as an example.
- Have two devices, one transmitter and one receiver.
- The transmitter's POWER(1/2) is connected to the Vout and GND of the bridge.
- The receiver's POWER(2/3) is connected to the 12V_Out and GND of the bridge.
- The receiver's ALARM(5/6) is connected to the DI4 COM and DI4 IN of the bridge.
Figure 1: Sensor to Bridge wiringDigital Input Interface Configuration
-
(Optional) Go to the System tab from the main menu. Enable the DC12 V Output.
NOTEThat the power output interface connected to the example sensor is enabled here. Please enable the power output interface that your sensor is actually connected to.
Figure 1: Enable the power outputs-
Go to the DI/DO tab and select the Digital Input menu.
-
After enabling DI2 and reloading, the input state will be displayed.
Figure 1: Enable DI4The relevant parameters are listed below. For more detailed descriptions of the parameters, refer to Digital Input.
-
Port ID: Physical DI port. Auto-assigned and not editable.
-
Channel ID: Channel identifier used for reporting. Auto-assigned and not editable.
-
Debounce: Signal stabilization time to prevent false triggering. Set to 50 ms.
-
Interval (s): Reporting interval. Range: 5–86400 seconds. Default: 60.
-
Enable: Enables or disables the channel. Default: disabled.
-
Input State: Real-time input status (high/low). Read-only.
Connect Bridge IO to LoRa Network Server for Uplink
This section provides you with operation guidance for connecting the Bridge IO to different LoRaWAN network servers and forwarding the collected data to the server (uplink).
Before connecting to the LNS, ensure that you have completed Configure LoRaWAN Parameters in IO.BOX.
Built-in Network Server
In this section, the Bridge IO will be connected to an RAKwireless gateway. For the gateway, the built-in LNS will be used.
Set-up the Built-in Network Server
- Start by accessing the gateway. Refer to the appropriate WisGateOS 2 user manual depending on the gateway you are using:
Figure 1: WisGateOS 2 login page- Once logged in, head to the LoRa menu.
Figure 1: LoRa page- By default, the gateway works as a Built-In Network Server. If not, switch the Work mode to Built-in network server.
Adding Application
- Once the gateway is in Built-in network server mode, head to the Applications tab.
Figure 1: Create Application in the Built-In Network Server- Click the Add application button or add one now link to add a new application. On the new page, fill in the following information:
Figure 1: Adding application- Application name: type a name for the application.
- Application Type: Select the application type from the drop-down menu. In this document, choose Unified Application Key.
- Unified Application key: All devices use the same application key. After selecting this option, the Application Key field will appear. This value must match the one configured on the end device. You can manually enter the application key or click Autogenerate to generate one automatically.
Figure 1: Unified application keyThe Auto Add Device switch activates the Application EUI field. The device will be automatically added to the application after the application EUI and key verification.
Figure 1: Auto add device- Payload type: from the drop-down, select CayenneLPP payload type and turn on the Only forward data object feature.
- Once set, click Save application to add the application.
- After the application is added, head to the End devices tab. The devices should automatically register upon join request if you are using the Auto Add Device feature. If that’s not the case, click the Add end device button. On the End device information page fill in the following information:
Figure 1: Successfully created application- Activation Mode: choose the activation mode of your device.
- OTAA: Selected in this document.
- ABP: This mode pops up two additional fields:
- Application Session Key
- Network Session Key
- End device (group) name: the name of the device.
- Class: the class of the device.
- Frame Counter width: the width of the frame counter. Leave it as default.
- LoRaWAN MAC Version: the LoRaWAN MAC version.
Adding the Device
-
Once everything is set, click Add end devices to go to the page and add the device.
-
On the Adding end devices page, type the device EUI at the End Device EUI (main) and click Add to “End Devices list”.
Figure 1: Adding end device-
If the EUI is correct, the device will show in the End devices list.
-
If the EUI is not correct, the devices will show in the End devices with an error.
- Once the device is added to the End devices list, click Add end devices. Confirm you are adding the device.
Figure 1: Confirmation message for adding a device- After the device has successfully joined the LNS, you will see the LoRaWAN status in the IO.Box console toggles as activated. You might need to refresh the page.
Figure 1: Device is online
Figure 1: LoRaWAN statusWait a while and you will see the uplink data from the LoRaWAN network.
The format of the uplink message is as follows:
0xCA (Hex) = 202 (Dec) → Channel ID
0x0000 (Hex) = 0 (Dec) → DI Low
0x0001 (Hex) = 1 (Dec) → DI High
Figure 1: Uplink dataThe Things Network (TTN)
Gateway Configuration
RAK gateways can connect to The Things Stack (TTN v3) using the following methods:
Packet forwarder(UDP)
To connect a gateway to TTN v3 using Packet Forwarder (UDP), see How to Connect RAK Gateways to TTN v3 via UDP.
Basics™ Station (LNS)
To connect a gateway to TTN v3 using Basics™ Station (LNS), see How to Connect RAK Gateways to TTN v3 Using Basics™ Station (LNS).
Basics™ Station (CUPS)
To connect a gateway to TTN v3 using Basics™ Station (CUPS), see How to Connect RAK Gateways to TTN v3 Using Basics™ Station (CUPS).
Bridge IO Configuration
You can create applications and automatically register node devices on the TTN network server through IO.Box. For detailed configuration steps, refer to The Things Stack (TTN v3) Integration.
- After the device is created successfully, you can view the added device in the TTN.
Figure 1: Added device in the TTN- To activate the device, click Apply.
Figure 1: Active the device- After a successful Apply, the device in the TTN is activated and receives data as shown in Figure 62.
Figure 1: Device is online
Figure 1: Data detailsYou will also see the LoRaWAN activation status in the IO.Box console enabled.
Figure 1: LoRaWAN statusChirpStack
This guide will show you how to connect the Bridge IO to a ChirpStack network server. In this tutorial, the ChirpStack v4 network server is used as an example.
Gateway configuration
A gateway can be connected to the ChirpStack v4 server using the following methods:
Packet Forwarder (UDP)
To connect a gateway to ChirpStack v4 using Packet Forwarder (UDP), see How to Connect RAK Gateways to Chirpstack v4 via UDP.
Packet forwarder(MQTT)
To connect a gateway to ChirpStack v4 using Packet Forwarder (MQTT), see How to Connect RAK Gateways to Chirpstack v4 via MQTT.
Basics™ Station (CUPS)
To connect a gateway to ChirpStack v4 using Basics™ Station (LNS), see How to Connect RAK Gateway to Chirpstack v4 Using Basics™ Station (LNS).
Bridge IO Configuration
You can create applications and automatically register node devices on the ChirpStack server through IO.Box. For detailed configuration steps, refer to ChirpStack v4 Integration.
- After the device is created successfully, you can view the added device in the ChirpStack.
Figure 1: Added device in the ChirpStack- To activate the device, click Apply.
Figure 1: Active the device- After a successful Apply, the device in the ChirpStack is activated and receives data.
Figure 1: Device is online
Figure 1: Data detailsYou will also see the LoRaWAN activation status in the IO.Box console enabled.
Figure 1: LoRaWAN statusRemote Device Configuration via LoRaWAN Downlink
The Bridge IO device can be configured remotely through LoRaWAN downlink commands. This method allows you to modify parameters for the Digital Input (DI), enabling control of connected peripheral devices such as sensors and actuators.
The FPort for configuration commands must be set to 10.
General Command Format
All configuration downlinks follow this structure:
[Channel ID] [Command Code] [Payload]
Command Code Breakdown
The Command Code is a single hexadecimal byte where each bit group defines a specific action. Please refer to the following table for details.
| Bit Position | Function | Value & Meaning |
|---|---|---|
| Bit 7 | Get/Set | 0: Get (Read parameters)1: Set (Write parameters) |
| Bits 3-6 | Channel Type | 0: DI (Digital Input)1: DO (Digital Output)7: Modbus (RS485 interface) |
| Bit 2 | Enable/Disable | 0: Disable 1: Enable |
| Bits 0-1 | Parameter Mode | 00: Combined (Configure all parameters together)01: Individual (Configure parameters individually) |
Command Payload Specification
You can use LoRaWAN downlinks to remotely modify DI parameters and change the channel state.
Write Command Example: CA 84 00 00 01 F4 00 00 02 58
Command Structure Breakdown
-
CA: Channel ID -
84: Command Code (Indicates a Set/Write command for configuring a Digital Input channel) -
Payload:
-
00 00 01 F4: Debounce Time = 500 ms -
00 00 02 58: Report Interval = 600 seconds
-
You can enter the read command CA 00 in the LoRaWAN Downlink server to retrieve the current parameter configuration payload.
LoRaWAN Downlink Server Configuration
Before configuring LoRaWAN downlinks, ensure that your Bridge IO is connected to a LoRa Network Server and is actively communicating on the network.
This example demonstrates how to remotely set Debounce to 500 ms and Interval (s) to 600 seconds for Channel ID 202.
Built-in Network Server
-
Log in to your gateway's web management interface.
-
Go to LoRa > Applications > End devices > Downlink.
-
On the Downlink page, configure the following and click Send to transmit the command.
-
Frame Confirmation: Enable.
-
FPort: Set to
10. -
HEX Bytes: Enter the hexadecimal configuration command without spaces.
-
Figure 1: LoRaWAN Downlink built in- Confirm that the parameters for DI Channel ID 202 show Debounce to 500 ms and Interval to 600 seconds.
Figure 1: DI statusThe Things Network (TTN)
-
Log in to the TTN Console.
-
Select your Application and the target End Device.
-
Navigate to the Messaging > Schedule downlink tab, configure the parameters, and click Schedule downlink to send the command.
-
Insert Mode:
Replace downlink queue -
FPort:
10 -
Payload type:
Bytes -
Payload: Enter the hexadecimal configuration command and then click Schedule downlink.
-
Confirmed downlink: ✔ Check this box.
-
Figure 1: LoRaWAN Downlink TTN- Verify in your device's DI configuration that the Debounce and Interval for Channel ID 202 are set to 500 and 600, respectively.
Figure 1: DI status- Check the Live data tab in the TTN server to view the acknowledgment message returned by the device.
Figure 1: TTN confirmedChirpStack
-
Log in to the ChirpStack Network Server.
<IP address of ChirpStack>:9480 -
In the left navigation pane, go to Applications, select your target application, and then choose the specific end device.
-
Navigate to the device's Queue tab, configure the downlink parameters, and click Enqueue to send the command.
-
Confirmed: Enable.
-
FPort: Set to
10. -
HEX: Enter the hexadecimal configuration command.
-
Figure 1: LoRaWAN Downlink ChirpStack- Verify in your device's DI configuration that for Channel ID 202, Debounce is set to 500 and Interval is set to 600.
Figure 1: DI status- Check the Events tab in the ChirpStack server to view the acknowledgment message returned by the device.
Figure 1: ChirpStack confirmed