DO Device Configuration Guide
This guide explains how to connect a DO (Digital Output) device to the Bridge IO, configure output control, send commands via LoRaWAN®, and remotely manage DO settings using downlink commands.
Prerequisite
Before configuring DO (Digital Output), prepare the following:
-
A DO (Digital Output) device.
-
IO.BOX (latest version recommended).
Connect DO Device to Bridge IO Device
This section demonstrates how to use the Bridge IO Digital Output interface and its internal power output to connect and control a bulb (supports 5 VDC input).
-
Connect the 5V_Out terminal of the Bridge IO to one terminal of the bulb.
-
Connect the other terminal of the bulb to the COM terminal of the selected DO channel.
-
Connect the NO terminal of the DO channel to the GND terminal of the Bridge IO.
Figure 1: wiring diagramEnsure that 5V_Out is enabled in IO.BOX before operating the DO channel.
When the Output State is set to Enabled, the relay closes the connection between COM and NO, completing the circuit:
5V_Out → Bulb → COM → NO → GND
Current flows through the bulb, and the bulb turns ON.
When the Output State is set to Disabled, the relay opens the connection between COM and NO, interrupting the circuit. No current flows and the bulb remains OFF.
Digital Output Interface Configuration
-
(Optional) Go to the System tab from the main menu. Enable the DC 5V 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.
-
Go to the DI/DO tab and locate the Digital Output section. Enable the channel to activate the output port.
-
When the Output State is Enabled, the bulb is lit, and when it is Disabled, the bulb is off.
Figure 1: Output stateThe relevant parameters are listed below. For more detailed descriptions of the parameters, refer to Digital Output.
-
Port ID: Physical DO port. Auto-assigned and not editable.
-
Channel ID: Output channel identifier used in control commands. Auto-assigned and not editable.
-
Output State: Sets the output level (high/low). Writable.
-
Interval (s): Reporting interval. Range: 5–86400 seconds. Default: 60.
-
Enable: Enables or disables the output channel. Default: disabled.
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:
0xD1 (Hex) = 209 (Dec) → Channel ID
0x0100 (Hex) = 256 (Dec) → DO OFF (Output Low)
0x0101 (Hex) = 257 (Dec) → DO ON (Output 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 Output (DO) interfaces, enabling control of connected peripheral devices such as sensors and actuators.
The FPort for configuration commands must be set to 10, except for toggling a DO channel's output state (ON/OFF), which requires FPort 1.
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) |
Digital Output (DO) Configuration
You can use LoRaWAN downlinks to remotely configure Digital Output (DO) channels, modify their parameters, and change the output state.
Write Command Example: D1 8C 00 00 02 58
Command Structure Breakdown
-
D1: Channel ID -
8C: Command Code (Write configuration for DO channel) -
Payload:
00 00 02 58: Report Interval = 600 seconds
You can enter the read command D1 08 in the LoRaWAN Downlink server to retrieve the current parameter configuration payload.
-
To change the Interval value, the command must be sent with FPort set to 10.
-
To change the output state (turn ON/OFF), the command must be sent with FPort set to 1 using one of the following specific commands:
-
D1 01 00– Turn OFF the output -
D1 01 01– Turn ON the output
-
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 the Interval to 600 seconds for Channel ID 209.
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- Verify that the Interval for DO Channel ID 209 is now set to 600.
Figure 1: DO 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.
-
Confirmed downlink: ✔ Check this box.
-
Figure 1: LoRaWAN Downlink TTN- Verify in your device's DO configuration that the Interval for Channel ID 209 is now set to 600.
Figure 1: DO 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 DO configuration that the Interval for Channel ID 209 is set to 600.
Figure 1: DO status- Check the Events tab in the ChirpStack server to view the acknowledgment message returned by the device.
Figure 1: ChirpStack confirmed