RAK7431 Quick Start Guide
Prerequisite
Before going through each and every step in the installation guide of the RAK7431 WisNode Bridge Serial, make sure to prepare the necessary items listed below:
Hardware Tools
- RAK7431 WisNode Bridge Serial
- Micro USB Cable
- Gateway in Range, for Testing
- A Windows/Mac OS/Linux Computer
Software Tools
Product Configuration
Typical Network Application
RAK7431 converts data from the RS485 protocol into LPWAN wireless messages and delivers it to a cloud server through an LPWAN gateway. Cloud servers can also proactively send data to RAK7431 for two-way data transmission. Using the RAK7431, you can convert data from a conventional RS485 wired network to a wireless network.

Connect the RAK7431 to the Sensor
Power Interface Configuration
The RAK7431 device can be powered either by:
- DC (VIN/GND) terminals
- Micro USB
The DC screw terminals are supporting 8 to 48 VDC. The Micro USB port can be used to power the RAK7431, up to 5 V / 500 mA DC. At the same time, the USB port is used as the configuration port for the device. Using the USB cable to connect the RAK7431 to a computer’s USB port, you can import your configuration settings.
The Micro USB port can be used only for powering the device. It cannot provide power to VOUT and power other devices in the RS485 network.

Data Interface Configuration
The RAK7431 - RS485 serial interface can support up to 16 RS485 devices. VOUT on the data interface can supply external power to the RS485 connected devices (only when the device is powered from the DC input). The VOUT output voltage is the same as the DC input voltage VIN.

Gateway Connection Settings
In this section, the RAK7431 WisNode Bridge Serial will be connected into the RAKwireless Gateway. For this guide, the RAK7289 WisGate Edge Pro V2 shall be used. Listed below are the requisites for this section:
- RAK Serial Port Tool - used to configure the RAK7431 WisNode Bridge Serial
- WisGateOS 2 User Manual- guide on how to configure the RAK7289 WisGate Edge Pro V2
Gateway Configuration
Built-In Network Server Setup
- Start by accessing the gateway. You can see how to do it on the WisGateOS V2 user manual.

- Once logged in, head to the LoRa menu.

- By default, the gateway works as a Built-In Network Server. If that is not the case, check the Built-in Network Server Mode Settings on the WisGateOS V2 User manual to switch the mode.
Adding Application
- Once the gateway is in Built-in network server mode, head to the Applications tab.

- Click the Add application button or add one now link to add a new application. On the new page, fill in the following information:
- Application name - type a name for the application.
- Application description - optionally you can write a description of the application.
- Application Type - from the drop-down menu select the type of application.
- Unified Application key - all devices will use the same application key. Selecting this option pops up an Application Key field. You can type your application key there or use the Autogenerate button to generate one.

The 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.

- Separate Application keys – each device will have its own application key. The key is added when registering the 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:
- Activation Mode - choose the activation mode of your device:
- OTAA
- ABP - This mode pops up two additional fields:
- Application Session Key
- Network Session Key

- End device (group) name – the name of the device.
- End device description (optional) – optionally, you can add a description for 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. V1.0.2 pops up a LoRaWAN Regional Parameters reversion field where you need to select the reversion of the device.

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”.
- 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.

RAK7431 Configuration
Connect the RAK7431 to Your Network
- Connect the RAK7431 to a computer using the Micro USB cable.
- Open the RAK Serial Tool and select the correct COM port. The default baud rate is 115200.
- After selecting, press Open.

- To set up the Device EUI, run the command:
AT+DEVEUI=<Device EUI>
- To check the Device EUI run:
AT+DEVEUI
- To set up the Application EUI run the command:
AT+APPEUI=<application EUI>
- To set up the Application Key run the command:
AT+APPKEY=<application Key>
- To check the previously configured Application EUI and Key, run the commands:
AT+APPEUI
AT+APPKEY

Set the Frequency Region
The node supports the following Regional Frequencies:
- EU433
- CN470
- CN470ALI
- RU864
- IN865
- EU868
- US915
- AU915
- KR920
- AS923
For this demonstration, EU868 shall be used. To set the desired regional frequency band use the command:
AT+REGION=EU868
The regional frequency settings need to be consistent with the RAK commercial gateway supported band.
Data Serial Port Rate Setting
The baud rate setting needs to be consistent with the baud rate of the sensor, which is 9600.
The AT command for execution is:
AT+BAUDRATE=9600
Operating and Activation Mode Settings
- Supported operating modes are two: Class A and Class C. To set the operating mode (Class C in this case), you need to execute the AT command:
AT+CLASS=C
Changes will take effect as soon as they are made.
- Activation mode supports the following two modes: ABP and OTAA. To set the activation mode (OTAA in this case), you need to execute the AT command:
AT+JOINMODE=OTAA
- Restart is needed for the modification to take effect. To restart the RAK7431, execute the command:
AT+RESTART
- If everything is configured right, after the execution of the restart command this output pops up in the RAK Serial Tool:

Configure RAK7431 Working Modes
Data Transparent Mode
When the RS485 data interface works in Modbus mode, the data encapsulation format can be divided into two types: transparent mode and non-transparent mode.
- In transparent mode, the Modbus execution instruction response data (data, received by the node) will be directly forwarded through the LoRaWAN network.
- In the non-transparent mode, the Modbus execution instruction response data (data, received by the node) will be encapsulated in the message header according to the Modbus protocol, and then transmitted to the server through LoRaWAN.
The non-transparent mode is the default one.
Enter the following AT command in the RAK Serial Tool to change the mode:
AT+TRANSPARENT=n
n | Condition |
---|---|
0 | transparent mode is turned off |
1 | it is turned on |
The change takes effect immediately after modification.
Scheduled Polling Function
When the device works in MODBUS mode, it supports the scheduled polling function.
This means that the device will perform a polling operation every given period (polling cycle). During polling, the device will send the pre-added MODBUS instructions in turn and forward the corresponding response data through the LoRaWAN network.
The device turns on the scheduled polling by default. The AT command for this is:
AT+ENABLEPOLL=n
n | Condition |
---|---|
0 | turns scheduled polling off |
1 | turns it on |
The modification takes effect after restart.

Scheduled Polling Cycle
This command sets/reads the scheduled polling cycle. This command only works if scheduled polling is enabled. The modification takes effect after the next polling cycle or a restart.
Example: To set the polling cycle to 60 seconds, use this command:
AT+POLLPERIOD=60
RAK7431 supports polling mode, which stores up to 32 query instructions at a maximum length of 128 bytes per instruction. Polling intervals and wait times can be adjusted as needed. RAK7431 converts the data returned by the RS485 node into a LoRaWAN message, which can be sent to the LoRaWAN gateway as is or encapsulated. In transparent mode, the data for the RS485 is sent in the payload of the LoRa message as is, and in non-transparent mode, the data of RS485 is encapsulated in the LoRa message with a header and validation.
Add Polling Instructions
To add polling instruction, execute the AT command:
AT+ADDPOLL=<n>:<xxxx>
Parameter | Description | Value Range |
---|---|---|
n | polling instruction ID | 1 to 127 |
xxxx | polling instruction content; hexadecimal string | 128 bytes max |
According to the temperature and humidity register address of the temperature and humidity sensor in the example and the RS485 address, the polling instruction should be:
AT+ADDPOLL=1:010300000002C40B
Example: If you have added multiple RS485 temperature and humidity sensors, continue to increase the polling instructions based on the RS485 address and register address, for example:
- RS485 Temperature and humidity sensor addr: 01, Polling 1: 010300000002C40B
- RS485 Temperature and humidity sensor addr: 04, Polling 2: 040300000002C45E
- RS485 Temperature and humidity sensor addr: 08, Polling 3: 080300000002C492
- RS485 Temperature and humidity sensor addr: 0F, Polling 4: 0F0300000002C525
You will need to increase the polling instruction by the following AT commands:
AT+ADDPOLL=1:010300000002C40B
AT+ADDPOLL=2:040300000002C45E
AT+ADDPOLL=3:080300000002C492
AT+ADDPOLL=4:0F0300000002C525
The RAK7431 sends an instruction to the sensor every 1 minute to obtain temperature and humidity data, and the following is the result of 3 consecutive scheduled polls:
- DTU Tx: The polling instruction sent to the Sensors over RS485 Data Interface
- DTU Rx: The sensor data received.
- LoRa Tx:Send the received data through a LoRaWAN network.


- Humidity calculation: hex is 0210, the decimal is 528, converted humidity is 52.8% RH.
- Temperature calculation: hex is 012F, the decimal is 303, converted temperature is 30.3° C.
MQTT Subscribe to Data Server
To better demonstrate the functionality, you will use the gateway MQTT integration feature to subscribe to the Built-In Network Server Topics, using the MQTT client, to obtain data and send instructions to the RAK7431. To communicate with the MQTT bridge in the gateway, you need to use MQTT Topic Templates.
MQTT Topic Configuration:
Application/{{application_ID}}/device/{{device_EUI}}/join
Application/{{application_ID}}/device/{{device_EUI}}/rx
Application/{{application_ID}}/device/{{device_EUI}}/tx
Application/{{application_ID}}/device/{{device_EUI}}/ack
Application/{{application_ID}}/device/{{device_EUI}}/status
-
Download and install MQTTfx tool to read the topics and send data to the gateway and node.
-
After installation, the MQTT Client must be configured. Select local mosquitto from the drop-down list and click the edit connection profiles icon marked in the image below to open the settings page.

- On the next window, input the Broker Address and Broker Port. If the Client ID is empty press Generate. Then click OK.
- Broker Address: Address of MQTT server – the gateway IP.
- Broker Port: Consistent with MQTT Broker Port set by the gateway - by default 1883.

- Click on the Connect button. The green dot indicates that the connection is successfully subscribed to the MQTT Broker.

- If you want to receive all data from the MQTT Bridge, use the wildcard character #.
- Choose the Subscribe tab, enter the wildcard and press Subscribe.

- If the node sends data, the MQTT client will display it as it is subscribed to the topic.

- Notice that the data field is in base64 format, which has to be converted to hex string to be useful. You can change the data format from the built-in server settings.
- This is done by going to LoRa>Application, select the application you created and enter the "Configuration" interface of the application. Chose HEX String in Decode Type . Press Save changes.

RAK7431 Remote Control and Configuration via MQTT.fx
To remotely control the RAK7431 you need to publish messages to the Gateway’s Network Server MQTT “TX” topic.
Add a Scheduled Polling Task List
Downlink instruction message format:
DTU_CMD | MSER | MDATA_LEN | MDATA | |
---|---|---|---|---|
0x03 | 2Byte | 2Byte | TASK_ID | DATA |
1Byte | nByte |
The message length does not contain the header.
Example: You will add a polling instruction.
Publish topic:
application/1/device/60c5a8fffe75404b/tx
Application ID and Device EUI should be consistent with the settings within the gateway.
- To successfully complete this, the JSON data format must be followed.
Content of the uplink:
{
"confirmed":true,
"fPort":129,
"data":"030001000901010300000002C40B"
}
Parameter | Description |
---|---|
"confirmed":true | This indicates that the downlink to the RAK7431 will be confirmed for successful receiving. |
"fPort":129 | Defines the port that you want to send the command. (For more information on the fPort see the AT Command Manual for RAK7431) |
"data":"030001000901010300000002C40B" | The data of the task in hexadecimal format. |
The content of the data that you will send is:

- DTU command word
- The message number
- Message length (excluding header)
- The task ID
- The content of the task

- After publishing the data, you can see the downlink instruction and uplink answer from the RAK Serial Tool:

Message format when execution is successful:
DTU_CMD | MSER | MDATA_LEN | MDATA |
---|---|---|---|
0x83 | 2Byte | 2Byte | TASK_ID |
1Byte |
- The MQTT subscription bar can see the upstream message "83000100010101" for successful execution.

Remove the Scheduled Polling Task List
Downlink instruction message format:
DTU_CMD | MSER | MDATA_LEN | MDATA |
---|---|---|---|
0x04 | 2Byte | 2Byte | TASK_ID |
1Byte |
Example: Removal of timed polling temperature and humidity sensor task order on a node:
Publish the topic:
Application/1/device/60c5a8fffe75404b/tx
Content:
{
"confirmed":true,
"fPort":129,
"data":"040001000101"
}

Message format when execution is successful:
DTU_CMD | MSER | MDATA_LEN | MDATA |
---|---|---|---|
0x84 | 2Byte | 2Byte | TASK_ID |
1Byte |

- The MQTT subscription bar sees the upstream message "84000100010101", which means the task was successfully removed.
Read the Scheduled Polling Task List
Downlink instruction message format:
DTU_CMD | MSER | MDATA_LEN | MDATA |
---|---|---|---|
0x05 | 2Byte | 2Byte | TASK_ID |
1Byte |
Publish topic:
application/1/device/60c5a8fffe75404b/tx
Content:
{
"confirmed":true,
"fPort":129,
"data":"050001000101"
}

Perform successful upstream message format:
DTU_CMD | MSER | MDATA_LEN | MDATA | |
---|---|---|---|---|
0x85 | 2Byte | 2Byte | TASK_ID | DATA |
1Byte | nByte |
- Open the MQTT subscription column that is to see to the performance of the above line: "8500010009010103000000002C40B" is the query to the task, the order ID is 1, the task order content is 010300000002C40B (example registers).
