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
- RAK7431 WisNode Bridge Serial
- Micro USB Cable
- Gateway in Range, for Testing
- A Windows/Mac OS/Linux Computer
Software
Connect the RAK7431 to an RS485 Device
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.
Figure 1: RAK7431 bridge with connected sensor and power supplyData 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.
Figure 1: RAK7431 Interface pin definitionLoRaWAN Network Configuration
The RAK7431 WisNode Bridge Serial communicates through a standard LoRaWAN® network and can be registered with a compatible LoRaWAN Network Server.
Connect to the Built-in Network Server
This guide uses the Built-in Network Server available on a RAKwireless WisGate gateway.
- Log in to the gateway Web UI. For instructions on how to access the Web UI, refer to the user guide for your gateway.
Figure 1: WisGateOS V2 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.
Create an 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:
- 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.
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- 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.
Figure 1: Adding application- 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.
Figure 1: Successfully added end deviceIf 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
Figure 1: Adding ABP device- 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.
Figure 1: Successfully created applicationAdd the RAK7431
- Once everything is set, click Add end devices to go to the page and add the device.
Figure 1: Adding end 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.
Figure 1: Confirmation message for adding a deviceConfigure LoRaWAN Parameters
- Connect the RAK7431 to a computer using the Micro USB cable.
- Open the RAK Serial Port Tool and select the correct COM port. The default baud rate is 115200.
- After selecting, press Open.
Figure 1: RAK Serial Tool- 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
Figure 1: Configuring the RAK7431Set 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:
Figure 1: RAK7431 Successful JoinAfter the RAK7431 restarts, it attempts to connect to the configured LoRaWAN network. Once the RAK7431 successfully joins the network, the basic LoRaWAN network setup is complete.
Connect to The Things Stack
In this section, it will be shown how to connect RAK7431 WisNode Bridge Serial to The Things Stack. To login into the TTNv3, head on here. If you already have a TTN account, you can use your The Things ID credentials to log in.
Figure 1: The Things Stack Home Page
Figure 1: Console Page after successful loginTo be able to connect RAK7431 WisNode Bridge Serial to TTNv3 you should already have connected a gateway in range to TTNv2 or TTNv3, or you have to be sure that you are in the range of a public gateway.
Add an Application
This tutorial is for EU868 Frequency band.
- To create an application, choose Create an application (for new users that do not already have created applications) or Go to applications > + Add application (for users that have created applications before).
Figure 1: Create an application page- Fill in the needed information:
- Owner - Automatically filled by The Things Stack, based on your account or created Organization.
- Application ID - This will be the unique ID of your application in the Network. Note that the ID must contain only lowercase letters, numbers, and dashes (-).
- Application name (optional) - This is the name of your application.
- Description (optional) – Description of your application. Optional application description; can also be used to save notes about the application.
- After you fill in the information, click Create application. If everything is filled in correctly, you will see the same page, as shown in Figure 53.
Figure 1: Application OverviewRegister and Configure the Device In OTAA Mode
Registering the Device in OTAA Mode
- From the Application Overview page, click on + Add end device.
Figure 1: Adding a device in OTAA mode- Below the Register end device heading you can find two options for registering a device. Since RAK7431 WisNode Bridge Serial is part of The LoRaWAN Device Repository, you can register it From The LoRaWAN Repository option. In the Brand dropdown menu find and select RAKwireless Technology Co. and a Model field will pop up next to it. In it choose RAK7431 WisNode Bridge Serial.
Figure 1: Choosing the device- After choosing the device, three more fields will pop up.
- Hardware Ver. – Version of the hardware. This is the only option, so leave it as default.
- Firmware Ver. – Version of the firmware. This is the only option, so leave it as default.
- Profile (Region) – Here the region is chosen.
For this example, the EU_863_870 is chosen.
- Next, an Enter registration data heading will pop up below. Scroll down to enter the required data for the device.
Figure 1: Registration Data- Here you must enter the following information:
- Frequency plan – Note: For this example, you will choose Europe 863-870 MHz (SF9 for RX2 - recommended).
- AppEUI - The AppEUI uniquely identifies the owner of the end device. It is provided by the device manufacturer. To get the AppEUI, connect your device via USB cable to your computer. Open RAK Serial Port Tool, choose the correct COM port and BaudRate and run the following command:
AT+APPEUI
Figure 1: AppEUI of the device- DevEUI - The DevEUI is the unique identifier for this end device. It is provided by the manufacturer and is printed on the label on the back of the device.
- AppKey - The root key to deriving session keys to secure communication between the end device and the application. AppKey can be generated by clicking the Generate button
. - End device ID – The End device ID is automatically filled based on the DevEUI. It can be changed. Note that the end device ID must contain only lowercase letters, numbers, and dashes (-).
If you are going to register more than one device of this type, you can choose the option Register another end device of this type and be transferred to the same page to register the next device.
- After filling in the registration information, click Register end device.
Configure the Device in OTAA Mode
- For configuring the node you will need the following three parameters: Device EUI, Application EUI, and Application Key. You can see them all in the Device Overview page, but since the two EUI's come with the device, you only need the Application Key from there.
Figure 1: OTAA device parameters- Using the RAK Serial Port Tool, set the join mode, device class, and your LoRaWAN region to your correct frequency band, with the following set of AT commands:
- For the join mode (OTAA)
AT+JOINMODE=OTAA
- For the class (Supported classes are: Class A, Class B and Class C. Remember for different classes to change the command with the correct letter, for example for Class B it will be AT+CLASS=B, in this case it is Class A.)
AT+CLASS=A
- For the region, replace the frequency band with the one for your LoRaWAN region. Refer to the TTN site for your frequency plan.
AT+REGION=EU868
Figure 1: Setting up the RAK7431 WisNode Bridge Serial operation modesThe following tutorial is based on using the EU868 frequency band.
- Now that those parameters are set, enter the App Key, using the command below. Remember to replace the "XXXX" with the corresponding parameter value for your particular case.
AT+APPKEY=XXXX
Figure 1: Setting up the RAK7431 WisNode Bridge Serial OTAA parameters- To connect to the LoRaWAN Network after configuration, the device must be restarted. Restart it with the command:
AT+RESTART
Figure 1: Joining the network confirmationYou can see in the Live data feed that the RAK7431 WisNode Bridge Serial is successfully joined.
Figure 1: Receiving data in the Live data feedConnect to Helium
Helium has quickly become the most widespread LPWAN communal network with more than 27,000 devices deployed globally. All the RAKwireless node products are compatible with it and the process of adding a device to the network is intuitive and straightforward.
This section will focus on giving a brief guide on how to connect the RAK7431 to the network console, assuming that there is a Helium Hotspot within range.
Log in or create your account in the Helium console page.
Figure 1: Helium ConsoleOnce registered/logged in, you will end up at the home page where you can see your function tree on the left and your DC balance at the top, as well as several useful links.
Figure 1: Helium console home screenGo to the Devices section in the function tree. If this is your first time doing this, there will be no devices registered. Click the + Add Device button to get started.
Figure 1: Devices sectionA window will pop up with a set of a field containing the device parameters required for its registration.
Figure 1: Adding a new deviceFill in a name of your choosing. The Dev EUI, App EUI, and App Key will have random values generated for you by default. Press the eye icon to reveal the values. You can manually replace them with values of your own. For this tutorial, use the default values. Press the Submit button, and you are done.
Figure 1: Helium devicesNow, your RAK7431 is registered and is awaiting activation. For this to happen, you need to import the Dev EUI, App EUI, and App Key in the RAK7431 using the RAK Serial Port Tool.
Open the tool, select the desired port (default baud rate) and open it. Then start importing your settings.
Configure your LoRa band and activation mode. This tutorial will be using the EU868 band and OTAA (the only option available for now with Helium) with device class A (default one, does not need configuring).
- Regional band, device class, and activation mode setting
at+joinmode=OTAA
at+region=EU868
- Enter the Dev UI
Use the command below by replacing the XXXX with your Device EUI from the Helium console:
at+deveui=XXXX
- Enter the App EUI
The same as with the Device EUI, replace the XXXX with your value:
at+appeui=XXXX
- Enter App Key
Finally, fill in the App key with the following command:
at+appkey=XXXX
- Join Network
Run the following AT command in order for the node to join the network.
Once the procedure is initiated and successfully complete, you will have a notification in the serial console.
at+restart
Figure 1: RAK7431 EUIs and keyIf you take a look at the Helium console, you will also see the join request packets both in the graph and event log. Your node is now a part of the Helium Network.
Figure 1: Helium console live device dataNext Steps
After the RAK7431 successfully joins a LoRaWAN network, continue with the following guides according to your application requirements:
-
RS485 Data Transmission and Polling - Configure transparent or non-transparent data transmission, scheduled polling, polling intervals, and Modbus polling instructions.
-
MQTT Integration and Remote Configuration - Subscribe to RAK7431 uplink data through MQTT and remotely read or modify polling, DTU, and LoRaWAN settings using downlink commands.
-
RAK7431 AT Command Manual - View the complete AT command reference for local device configuration.
