RAK7432/RAK7434 Quick Start Guide
Prerequisite
Before going through each step in the installation guide of the WisNode Bridge Analog RAK7432 (4-20 mA) or RAK7434 (0-5 V), make sure to prepare the necessary items listed below:
Hardware Tools
- RAK7432/RAK7434
- Micro USB cable
- Gateway in range, for testing
- A Windows/Mac OS/Linux computer
Software Tools
Product Configuration
Typical Network Application
RAK7432/RAK7434 converts data from the 4-20 mA/0-5 V analog protocol into LPWAN wireless messages and delivers it to a cloud server through an LPWAN gateway. Using the RAK7432/RAK7434, you can convert data from a conventional 4-20 mA/0-5 V analog sensor to a wireless network.
Connect the RAK7432/RAK7434 to the Sensor
Power Interface Configuration
The RAK7432/RAK7434 device can be powered either by:
- DC (VIN/GND) terminals
- Micro USB
The DC screw terminals are supporting 12 V to 24 V. The Micro USB port can be used to power the RAK7432/RAK7434, up to 5 V / 500 mA DC. At the same time, the USB port is used as the configuration port for the device. You can import your configuration settings using the Micro USB cable to connect the RAK7432/RAK7434 to a computer’s USB port.
The Micro USB port can be used only for powering the device. It cannot provide power to VOUT and power other devices in the other connected 4-20 mA/0-5 V.
Data Interface Configuration
The RAK7432/RAK7434 analog interface allows you to connect sensors with the same output. The VOUT on the data interface can supply external power to the analog sensor (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 RAK7432/RAK7434 WisNode Bridge Analog will be connected to the RAKwireless LoRaWAN Gateway. For this demonstration, a RAK7289 WisGate Edge Pro V2 gateway will be used. Listed below are the prerequisites for this section.
- RAK Serial Port Tool – Used to configure and set up the RAK7432/RAK78434 WisNode Bridge Analog.
- Documentation – A guide on how to configure 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 to Built-in network server.
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 an 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 this is 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.
- In 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.
RAK7432/RAK7434 Configuration
Connect the RAK7432/RAK7434 to Your Network
- Connect the RAK7432/RAK7434 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.
- Run the following commands:
-
To set up the Device EUI, run the command:
AT+DEVEUI=<Device EUI>
-
To check the Device EUI, run the command:
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
- CN470
- RU864
- IN865
- EU868
- US915
- AU915
- KR920
- AS923
For this demonstration, EU868 will 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.
Operating and Activation Mode Settings
- Supported operating modes are three: Class A, Class B,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 RAK7432/RAK7434, 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:
Connecting to The Things Network V3 (TTNv3)
At The Things Conference 2021, it was announced that The Things Network is upgrading to The Things Stack v3.
This section will show how to connect RAK7432/RAK7434 WisNode Bridge Analog to The Things Stack v3.
First, log in to TTNv3. To do so, head to the TTNv3 site. If you already have a TTN account, you can use your The Things ID credentials to log in.
To be able to connect RAK7432/RAK7434 WisNode Bridge Analog 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.
Adding an Application
This tutorial is for the 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).
- 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 21.
Registering and Configuring the Device in OTAA Mode
Registering the Device in OTAA Mode
- From the Application Overview page, click + Register end device.
- Select Enter device specifics manually and fill in the Frequency plan.
- Select LoRaWAN version 1.0.3 and fill in the JoinEUI (AppEUI).
For this example, the Europe 863-870 MHz (SF9 for RX2 - recommended) plan is chosen.
- For the JoinEUI, 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 a USB cable to your computer. Open RAK Serial Port Tool, choose the correct COM port and BaudRate, and run the following command:
AT+APPEUI
- Press the Confirm button next to the JoinEUI field.
- The Provisioning information section will expand. Scroll down to enter the required data for the device.
Here you must enter the following information:
- 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.
Configuring 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 on the Device Overview page, but since the two EUIs come with the device, you only need the Application Key from there.
- 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 of your LoRaWAN region. Refer to the TTN site to see more about your frequency plan.
AT+REGION=EU868
The 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
- To connect to the LoRaWAN Network after configuration, the device must be restarted. Restart it with the command:
AT+RESTART
- You can see in the Live data feed that the RAK7432/RAK7434 WisNode Bridge Analog is successfully joined.
Configuring the Analog Interface
Modifying the following values is not necessary but depends on the use case you need.
- Let’s set the AINPERIOD. This value determines the acquisition reporting period. The default value is 600 s. Now we are going to set it to 100 s:
AT+AINPERIOD=100
- The next step is to change the value range (the minimum and maximum value) of the analog interface data.
AT+AINVALUERANGE=1:-150:150
- AINLPMODE (Low power mode) will also need to be changed. Enabling this value will allow the analog data input interface to be turned off while the device is in AINPERIOD (while no acquisition is initiated).
AT+AINLPMODE=1