Skip to main content

RAK4600 Module Quick Start Guide

This guide covers the following topics:

Prerequisites

What Do You Need?

Before going through the step in the installation guide of the RAK4600 WisDuo LPWAN Module, make sure to prepare the necessary items listed below:

Hardware Tools

  1. RAK4600 WisDuo LPWAN+BLE Module
  2. Windows PC
  3. USB to TTL adapter
  4. RAKDAP1 Flash and Debug Tool
  5. LoRaWAN gateway in range

Software Tools

  1. RAK Serial Port Tool
  2. RAK4600 Firmware
  3. RAK Firmware Upgrade Tool

Definition of Terms

List of Acronyms
ABPActivation-By-Personalization
BLEBluetooth Low Energy
DFUDevice Firmware Upgrade
EUIExtender Unique Identifier
LoRaLong Range
OTAAOver-The-Air-Activation
TTNThe Things Network
P2PPeer-to-peer communication
SWDSerial Wire Debug

Product Configuration

Interfacing with RAK4600

In this section, a RAK4600 module is used for demonstration. Use a USB to TTL adapter to connect to the module. In case the RAK4600 module is mounted on an evaluation board or a custom PCB, use the appropriate interface to connect to the serial port.

warning

Before powering the RAK4600 Module, you should install the LoRa and BLE Antenna first. Not doing so might damage the board.

Use Figure 1 as a reference to connect the antennas.

Figure 7915: RAK4600 Module antenna connection
  1. Connect the RAK4600 to USB to the TTL adapter, as shown in Figure 2.

In general, the pin marked as TX of the adapter must be connected to the USART1_RX pin of the RAK4600, and the RX pin of the adapter connects to the RAK4600 USART1_TX pin.

Figure 7916: RAK4600 module connection
  1. Open RAK Serial Port Tool. Any serial communication tool will work, but it is recommended to use the RAK Serial Port Tool.

  2. Configure the serial communication tool by selecting the proper port of the computer UART port and configure the link as 115200 baud, 8 bits, no parity bit, and 1 stop bit.

  • Choose the correct COM Port number for your device. Go to your Device Manager by pressing Windows + R and type devmgmt.msc or search in the Start Menu.
Figure 7917: Device Manager
  • Look for Ports (COM & LPT). Find the name of your USB UART Module driver and take note of the COM Port Number.
  1. The RAK4600 console output can now be read in the RAK serial port tool, as shown in Figure 4.
Figure 7918: RAK4600 on RAK Serial Port Tool

Configure the RAK4600

Through UART

To connect the RAK4600 module to a LoRa P2P connection or a LoRaWAN network, the module must be configured, and the LoRa parameters must be set by sending AT commands through the UART interface.

Connect the RAK4600 module to the computer as described in the previous section. Using the serial communication tool, it is possible to send commands to the RAK4600. For example, sending the at+version will display the current firmware version, as shown in Figure 5.

The full set of RAK4600 AT commands can be found in Appendix I.

Figure 7919: at+version command response

Through the BLE Interface

To configure the RAK4600 through BLE, execute the following steps.

  1. Install the “nRF Connect” or the “nRF Master Control Panel (BLE)” app provided by Nordic Semiconductor.
  2. Open the app on the mobile device and scan for BLE devices.
  3. Reset the RAK4600 module. After a few seconds, a list of BLE devices will be shown. The RAK4600 is listed as “RUI-XX: XX: XX".
Figure 7920: Nordic app scan for BLE devices
NOTE

Connect within 60 seconds after resetting the RAK4600. After that time, the BLE broadcast will be stopped.

  1. After pressing the “CONNECT” button, a list will be displayed, as shown in Figure 7.
Figure 7921: Options to connect to the RAK4600
  1. Select the service named “Nordic UART Service”.
  2. To receive data from mobile, enable notification on TX Characteristic by clicking on the arrow.
Figure 7922: Enable notifications from mobile phone
  1. Write a value on RX Characteristic by clicking on the arrow.
Figure 7923: Send AT command
  1. A small input window will pop up. This is where you will input the AT commands.
Figure 7924: nRF app AT command input window
  1. Send AT commands to RAK4600 in this dialog.

    • For example, to check the current firmware version, type “at+version” then click on the “SEND” button.
Figure 7925: nRF app, send at command over BLE

The console output shall be read on the TX Characteristic of the App.

Figure 7926: AT response over BLE

Connecting to The Things Stack (TTN V3)

This section will show how to connect the RAK4600 module to The Things Stack (TTN V3) platform.

Figure 7927: The Things Stack diagram

As shown in Figure 13, The Things Stack is an open-source LoRaWAN Network Server suitable for global, geo-distributed public and private deployments as well as for small, local networks. The architecture follows the LoRaWAN Network Reference Model for standards compliancy and interoperability. This project is actively maintained by The Things Industries.

LoRaWAN is a protocol for low-power wide-area networks. It allows for large-scale Internet of Things deployments where low-powered devices efficiently communicate with Internet-connected applications over long-range wireless connections.

The RAK4600 module can be part of this ecosystem as a device, and the objective of this section is to demonstrate how simple it is to send data to The Things Stack using the LoRaWAN protocol. To achieve this, the RAK4600 module must be located inside the coverage of a LoRaWAN gateway connected to The Things Stack server.

Registration to TTN and Creating LoRaWAN Applications

The first step is to go to The Things Network platform and select a cluster, as shown in Figure 14. The Things Industries adds more clusters from time to time, so select the one closes to your location. In this guide, Europe 1 is selected.

Figure 7928: Selecting Cluster in TTN V3

You can use the same login credentials on the TTN V2 if you have one. If you have no account yet, you need to create one.

  1. To register as a new user to TTN, click on Login with The Things ID, then select register on the next page, as shown in Figure 15 and Figure 16.
Figure 7929: Login using TTN account
Figure 7930: Registration of new account
  1. You should now be on the step of creating your TTN account. Fill in all the necessary details and activate your account.

  2. After creating an account, log in to the platform using your username/email and password, then click Submit, as shown in Figure 17.

Figure 7931: Logging in to TTN platform
  1. Click Authorize to proceed.
Figure 7932: Authorization to TTN
  1. Now that you are logged in to the platform, the next step is to create an application. Click Create an application.
Figure 7933: Creating TTN application for your LoRaWAN devices
  1. To have an application registered, input first the specific details and necessary information about your application, then click Create application.
Figure 7934: Details of the TTN application

If you have no error on the previous step, you should now be on the application console page. The next step is to add end-devices to your The Things Stack application. LoRaWAN specification enforces that each end device has to be personalized and activated. There are two options in registering devices depending on the activation mode selected. Activation can be done either via Over-The-Air-Activation (OTAA) or Activation-By-Personalization (ABP).

NOTE

Once you have the application in The Things Stack (TTN V3), you need to ensure that you are in coverage of a LoRaWAN gateway that is registered to The Things Stack (TTN V3) as well. Without the coverage of that LoRaWAN gateway, you cannot activate any device that you will register in your application.

RAKwireless has LoRaWAN gateways that you can connect to The Things Stack (TTN V3) if no LoRaWAN gateway coverage is available in your location.

The Things Stack OTAA Device Registration

  1. Go to your application console to be able to register a device. To start adding an OTAA end device, click + Add end device, as shown in Figure 21.
Figure 7935: Add end device
  1. To register the module, you need to click first Manually then configure the activation method by selecting Over the air activation (OTAA) and compatible LoRaWAN version, then click the Start button, as shown in Figure 22 and Figure 23.
Figure 7936: Manually register device to The Things Stack
Figure 7937: Device activation configuration
  1. Then, input a unique End device ID and EUIs (DevEUI and AppEUI), as shown in Figure 24. Check if your module has a DevEUI on sticker or QR that you can scan, then use this as the device unique DevEUI.

Optionally, you can add a more descriptive End device name and End device description about your device.

  1. After putting all the details, click Network layer settings to proceed to the next step.
NOTE

It is advisable to use a meaningful End device ID, End device name, and End device description that will match your device purpose. The End device ID rak-device is for illustration purposes only.

Figure 7938: OTAA Device Information
  1. Next step is to set up Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. Then you can click Join settings.
Figure 7939: OTAA Configuration
  1. The last step in the registration of a new OTAA end-device is the configuration of the AppKey. To get the AppKey, you must click the generate button, then click Add end device to finish your new device registration.
Figure 7940: OTAA AppKey generation and device registration

You should now be able to see the device on The Things Stack console after you fully registered your device, as shown in Figure 27.

NOTE

The AppEUI, DevEUI, and AppKey are the parameters you will need to activate your LoRaWAN end device via OTAA. The AppKey is hidden by default for security reasons, but you can easily show it by clicking the show button. You can also copy the parameters quickly using the copy button.

The three OTAA parameters on The Things Stack device console are MSB by default.

These parameters are always accessible on the device console page, as shown in Figure 27.

Figure 7941: OTAA device successfully registered to The Things Stack

RAK4600 OTAA Configuration for The Things Stack

The RAK4600 module supports a series of AT commands to configure its internal parameters and control the functionalities of the module. To set up the RAK4600 module to join The Things Stack using OTAA, start by connecting the RAK4600 module to the computer (see Figure 1) and open the RAK Serial Port Tool. Wait for the communication to start. It is recommended to test the serial communication and verify the current configuration by sending either of these two AT commands:

at+set_config=device:restart
at+version
Figure 7942: AT Command response

As an example, these are the list of the parameters you need to configure in RAK4600:

  • LoRa join mode: OTAA
  • LoRa class: Class A
  • LoRa region: EU868
  • Device EUI: 1133557799224466
  • Application EUI: 1000000000000009
  • Application Key: 04FA4E626EF5CF227C969601176275C2
  1. Set the LoRa join mode to OTAA.
at+set_config=lora:join_mode:0
  1. Set the LoRa class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region to EU868.
at+set_config=lora:region:EU868
  1. Set the Device EUI.
at+set_config=lora:dev_eui:1133557799224466
  1. Set the Application EUI.
NOTE

All zero value Application EUI at+set_config=lora:app_eui:0000000000000000 is not supported and will return error.

at+set_config=lora:app_eui:1000000000000009
  1. Set the Application Key.
at+set_config=lora:app_key:04FA4E626EF5CF227C969601176275C2
Figure 7943: Configuring LoRa Parameters
NOTE

After configuring all the parameters, you need to reset your RAK4600 Module to save the parameters.

  1. After resetting, join in OTAA mode.
at+join

After 5 or 6 seconds, if the request is successfully received by a LoRa gateway, then you should see the messages shown in Figure 30.

  1. Try to send a message from the RAK4600 module.
at+send=lora:2:1234567890
Figure 7944: OTAA Test Sample Data Sent via RAK Serial Port Tool

You can see the data sent by the RAK4600 module on The Things Stack platform, as shown in Figure 31.

Figure 7945: OTAA Test Sample Data Sent Viewed in The Things Stack

The Things Stack ABP Device Registration

  1. To register an ABP device, go to your application console and select the application where you want your device to be added, then click + Add end device, as shown in Figure 32.
Figure 7946: Add end device
  1. To register the module, you need to click first Manually then configure the activation method by selecting Activation by personalization (ABP), compatible LoRaWAN version, and click the Start button, as shown in Figure 33 and Figure 34.
Figure 7947: Add end device
Figure 7948: Manually register device to The Things Stack
  1. At this step, you need to put a unique End device ID and DevEUI, as shown in Figure 35. Check if your module has a DevEUI on sticker or QR that you can scan, then use this as the device unique DevEUI.

Optionally, you can add a more descriptive End device name and End device description about your device.

  1. After putting all the details, click Network layer settings to proceed to the next step.
NOTE

It is advisable to use a meaningful End device ID, End device name, and End device description that will match your device purpose. The End device ID rak-device-abp is for illustration purposes only.

Figure 7949: Device Information
  1. Next step is to set up Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. In an ABP device, you also need to generate Device Address and NwkSKey (Network Session Keys). Then, you can click Application layers settings.
Figure 7950: ABP Configuration in The Things Stack
  1. The last step in the registration of a new ABP end-device is the configuration of the AppSKey. To get the AppSKey, you must click the generate button, then click Add end device to finish your new device registration.
Figure 7951: ABP Configuration in The Things Stack

You should now be able to see the device on The Things Stack console after you fully registered your device, as shown in Figure 38.

Figure 7952: RAK4600 registered at The Things Stack

RAK4600 ABP Configuration for The Things Stack

To set up the RAK4600 module to join The Things Stack using ABP, start by connecting the RAK4600 module to the computer (see Figure 1) and open the RAK Serial Port Tool. It is recommended to test the serial communication by sending either of these two AT commands:

at+set_config=device:restart
at+version
Figure 7953: AT Command response

As an example, these are the list of the parameters you need to configure in RAK4600:

  • LoRa join mode: ABP
  • LoRa class: Class A
  • LoRa region: EU868
  • Device address: 260BDE80
  • Network Session Key: 433C7A924F7F6947778FE821525F183A
  • Application Session Key: A585653A949C2B2D44B55E99E94CB533
  1. Set the LoRa join mode to ABP.
at+set_config=lora:join_mode:1
  1. Set the LoRa class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region to EU868.
at+set_config=lora:region:EU868
  1. Set the Device Address.
at+set_config=lora:dev_addr:260BDE80
  1. Set the LoRa Network Session Key.
at+set_config=lora:nwks_key:433C7A924F7F6947778FE821525F183A
  1. Set the LoRa Application Session Key.
at+set_config=lora:apps_key:A585653A949C2B2D44B55E99E94CB533
Figure 7954: AT Command for ABP LoRa parameters via RAK Serial Port Tool

After configuring all the parameters, you need to reset the RAK4600 Module to save the parameters.

  1. After resetting, join in ABP mode.
at+join
NOTE

By using the ABP mode in LoRaWAN, it doesn’t require to join a network before sending a LoRaWAN package. But to keep the consistency of internal states of the firmware of the RAK4600 module, it is still required to send the at+join command in the ABP mode. This time, the firmware should reply almost immediately with an “OK”.

  1. Try to send data from the RAK4600 to The Things Network in ABP mode.
at+send=lora:2:1234567890
Figure 7955: ABP Test Sample Data Sent via RAK Serial Port Tool

You can see the data sent by the RAK4600 module on The Things Stack device console Live data section and the Last seen info should be a few seconds ago.

Figure 7956: OTAA Test Sample Data Sent Viewed in The Things Stack

Connecting with ChirpStack

This section shows how to connect the RAK4600 to the ChirpStack platform. As described in the ChirpStack website:

“The ChirpStack open-source LoRaWAN Network Server stack provides open-source components for LoRaWAN networks. Together they form a ready-to-use solution including a user-friendly web interface for device management and APIs for integration. The modular architecture makes it possible to integrate within existing infrastructures. All components are licensed under the MIT license and can be used for commercial purposes.”

Figure 7957: RAK4600 in the context of the ChirpStack platform

The architecture of the ChirpStack platform is shown in Figure 43. Similar to the case of TTN, the RAK4600 is located in the periphery and will transmit the data to the backend servers through a LoRa gateway. More information about this architecture can be found at https://www.chirpstack.io/.

  • In this section, it is assumed that you are using a RAK LoRa gateway, such as RAK7243. The gateway must be configured and registered previously to ChirpStack deployment. More information can be found in the Connect the Gateway with Chirpstack section.
NOTE

The frequency band used in this example is EU868 which is supported by the high-frequency version of RAK4600.

  • These are the steps needed to send data to the ChirpStack platform from a RAK4600 module:

    1. Create a new Application
    2. Register a new device on the platform
    3. Configure the Join Mode:
      • OTAA mode on the platform
      • OTAA mode on the RAK4600
      • ABP mode on the platform
      • ABP mode on the RAK4600
    4. Send data from the RAK4600 and receive it at the platform

The following section gives the details of each of these aforementioned steps. As usual, you must choose to use either ABP or OTAA mode to register the device to the network server.

Create a new Application

  1. Go to the Application section, then click on the “+ CREATE” button.
Figure 7958: Application section of the RAK’s ChirpStack LoRaServer
  1. ChirpStack LoraServer supports multiple system configurations, with only one by default. By default, a new Application should be created, although it is possible to reuse the existing ones. For this setup, create a new Application by clicking on the "CREATE APPLICATION" button.
Figure 7959: Creating a new Application on the RAK’s ChirpStack LoRaServer
  1. Create an Application named “rak_node_test”. Fill in the required parameters, as shown in Figure 46. To finish, click on the CREATE APPLICATION button.
  • Application Name: rak_node_test
  • Application Description: test
  • Service profile: field is to select the system profile.

The Application Description field is just a descriptive text.

CREATE APPLICATION”.

Figure 7960: Filling parameters of an Application on the RAK’s ChirpStack LoRaServer
Register a new Device
  1. Click on the Application “rak_node_test” created in the previous step.
Figure 7961: List of applications created on the RAK’s ChirpStack LoRaServer
  1. Select the “DEVICES” tab, as shown in Figure 48.
Figure 7962: Device tab of an Application on the RAK’s ChirpStack LoRaServer
  1. Inside of the “DEVICES” tab, create a new device (LoRa node) by clicking on the “+ CREATE” button.
Figure 7963: Add a new device at DEVICES tab of an Application on the RAK’s ChirpStack LoRaServer
Figure 7964: New device registration form on the RAK’s ChirpStack LoRaServer
  1. Fill the parameters requested as appears in Figure 50.
  • Device name and Device description: These are just descriptive texts.
  • Device EUI: This interface allows you to generate a Device EUI automatically by clicking the icon highlighted in red in Figure 51. You can also add a specific Device EUI directly in the form.
  • Device-profile: To join in OTAA mode, select “device_profile_otaa” or “device_profile_abp” to join in ABP mode.
NOTE

ChirpStack doesn’t support AS923 in ABP mode.

Figure 7965: Generate a new Device EUI in the device registration form

LoRaWAN Join Mode

The LoRaWAN specification defines that to join in a LoRaWAN network, each end-device has to be personalized and activated. Activation can be done either via Over-The-Air-Activation (OTAA) or via Activation-By-Personalization (ABP). In OTAA, the end-device previously personalized is activated when deployed or reset. In ABP, personalization and activation are done as a single step.

OTAA Mode
Configure the OTAA Mode on the Platform
  1. If you have selected “device_profile_otaa”, then after the device is created, an Application Key must be also created for this device.
Figure 7966: Choosing OTAA mode in the device registration form
  1. A previously created Application Key can be entered here, or a new one can be generated automatically by clicking on the icon highlighted in red.
Figure 7967: Application Key for the OTAA mode in the device registration form
  1. Once the Application Key is added to the form, the process can be finalized by clicking on the “SET DEVICE-KEYS” button.
  • As shown in Figure 54, a new device should be listed in the “DEVICES” tab. The most important parameters, such as the Device EUI are shown in the summary.
Figure 7968: New crated device listed in the DEVICES tab
  1. To end the process, it is a good practice to review that the “Application Key” is properly associated with this device. The “Application Key” can be verified in the “KEYS(OTAA)” tab.
Figure 7969: Application Key associated to the new device
NOTE

Standard OTAA mode requires the Device EUI, Application Key, and the Application EUI, but in the ChirpStack’s implementation, only Device EUI and the Application Key are mandatory. The Application EUI is not required and is not recorded in the Application tab. Nevertheless, the Application EUI is a mandatory parameter in the RAK4600 module firmware. To resolve this mismatch, you can reuse the Device EUI as the Application EUI during the configuration on the side of the node.

Configure the OTAA mode on the RAK4600

RAK4600 complies with the LoRaWAN 1.0.2 specification. By default, the LoRa join mode is OTAA and the LoRa Class is Class A.

To set up the RAK4600 to join ChirpStack using OTAA, start by connecting the RAK4600 to the computer as shown in section Interfacing with RAK4600. Open the RAK Serial Port Tool and wait for the communication to start. It is recommended to test the serial communication by sending an AT command as:

at+get_config=lora:status

or

at+version
Figure 7970: RAK Serial Port Tool connected to a RAK4600

As an example, the following parameters will be configured in RAK4600:

  • LoRa join mode: OTAA
  • LoRa class: Class A
  • LoRa region: EU868
  • Device EUI: d045f054b2797f7c (from ChirpStack registration)
  • Application EUI: d045f054b2797f7c (from ChirpStack registration)
  • Application Key: 2cb29aefe344c0d7b044e7a7d3afda6d (from ChirpStack registration)
  1. Set the LoRa join mode to OTAA.
at+set_config=lora:join_mode:0
  1. Set the LoRa Class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region.

For the Europe region, type the command:

at+set_config=lora:region:EU868
NOTE

Remember that the device frequency shall be in the same frequency band as the gateway.

  1. Set the Device EUI.

Get the Device EUI number from the ChirpStack register.

at+set_config=lora:dev_eui:d045f054b2797f7c
  1. Set the Application EUI.

Get the Application EUI number from the ChirpStack register.

at+set_config=lora:app_eui:d045f054b2797f7c
NOTE

Remember, the Application EUI parameter is not required in the ChirpStack platform; therefore, it is possible to use the same id as the Device EUI. Otherwise, the firmware will complain.

  1. Set the Application Key.

Get the Application Key from the TTN register.

at+set_config=lora:app_key:2cb29aefe344c0d7b044e7a7d3afda6d
  1. Save RAK4600 parameters.

Reset the RAK4600 to save the parameters.

Figure 57 summarizes the set of commands sent over the console for setting the OTAA mode on the RAK4600

Figure 7971: RAK4600 LoRa parameters configuration over the Serial Port Tool
  1. Command the RAK4600 to join in OTAA mode
at+join
  • After 5 or 6 seconds, if the request is successfully received by a LoRa gateway, then the “OK Join Success” message will be shown.
Figure 7972: RAK Serial Port Tool, join the network
  • The JoinRequest and JoinAccept messages are also displayed on the ChirpStack platform, specifically in the LORAWAN FRAMES section.
Figure 7973: ChirpStack Console, checking LoRaWAN join request
  1. Send data from RAK4600 to ChirpStack

For example, to send the string 1234567890 over LoRa port 2, type the command:

at+send=lora:2:1234567890
Figure 7974: RAK Serial Port Tool, send a LoRaWAN message

On the ChirpStack platform, the messages shall appear in the “LORAWAN FRAMES” tab, as shown in Figure 61.

NOTE

By convention, messages sent from nodes to the gateway are considered as UPLINK, while messages sent by the gateway to nodes are considered as a DOWNLINK.

Figure 7975: ChirpStack Console, checking LoRaWAN messages received
ABP Mode
Configure the ABP Mode on the Platform

During the registration of a new device, if “device_profile_abp” is selected, then the ChirpStack platform will assume that this device will join the LoRaWAN network using the ABP mode.

  1. Fill in the parameters requested, as appears in Figure 62:
  • Device name and Device description: These are just descriptive texts.
  • Device EUI: You can also add a specific Device EUI directly in the form.
  1. Once these parameters are filled, click on the “CREATE DEVICE” button.
NOTE

Check Disable counting frame verification to prevent the node-side frame counting from starting from zero after the node is powered on during the test. The server cannot synchronize the node-side counting, causing the transmission to fail.

Figure 7976: ChirpStack Console, configuring a device in ABP mode
  1. After selecting the ABP mode, the following parameters appear in the ACTIVATION tab below:
  • Device address
  • Network Session Key
  • Application Session Key
Figure 7977: ChirpStack Console, parameters required for the ABP mode
  • The parameters can be generated as random numbers by the platform or can be set with user values. Once these parameters are filled properly, the process is completed by clicking on the “(RE)ACTIVATE DEVICE” button.
Configure the ABP mode on the RAK4600

RAK4600 complies with the LoRaWAN 1.0.2 specification. The RAK4600 LoRa join mode is OTAA by default and the LoRa Class is Class A.

To set up the RAK4600 module to join ChirpStack using ABP, start by connecting the RAK4600 to the computer as shown in section Interfacing with RAK4600. Open the RAK Serial Port Tool, wait for the communication to start. It is recommended to test the serial communication by sending an AT command as:

at+get_config=lora:status

or

at+version
Figure 7978: RAK Serial Port Tool connected to a RAK4600

As an example, the following parameters will be configured in RAK4600:

  • LoRa join mode: ABP
  • LoRa class: Class A
  • LoRa region: EU868
  • Device address: 26011af9 (from ChirpStack registration)
  • Network Session Key: c280cb8d1df688bc18601a97025c5488 (from ChirpStack registration)
  • Application Session Key: 4d42ec5caf97f03d833cdaf5003f69e1 (from ChirpStack registration)
  1. Set the LoRa join mode to ABP.
at+set_config=lora:join_mode:1
  1. Set the LoRa Class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region.

For the Europe region, type the command:

at+set_config=lora:region:EU868
  1. Set the Device Address.

Get the Device Address from ChirpStack registration.

at+set_config=lora:dev_addr:26011af9
  1. Set the Network Session Key.

Get the Network Session Key from the ChirpStack registration.

at+set_config=lora:nwks_key:c280cb8d1df688bc18601a97025c5488
  1. Set the Application Key.

Get the Application Key from the ChirpStack registration.

at+set_config=lora:apps_key: 4d42ec5caf97f03d833cdaf5003f69e1
  1. Save RAK4600 parameters.

Reset the RAK4600 to save the parameters.

Figure 55 summarizes the set of commands sent over the console for setting the ABP mode on the RAK4600.

Figure 7979: RAK4600 LoRa parameters configuration over the Serial Port Tool
  1. Command the RAK4600 to join in ABP mode.
at+join

Almost immediately after sending the command, the “OK Join Success” should be replied to in the console, as shown in Figure 66.

Figure 7980: RAK Serial Port Tool join LoRaWAN in ABP mode.
NOTE

The ABP mode in LoRaWAN doesn’t require to join a network before sending a LoRaWAN package. But, to keep the consistency of internal states of the firmware of the RAK4600, it is still required to send the at+join command in the ABP mode.

  1. Send data from RAK4600 to ChirpStack.

For example, to send the string 1234567890 over LoRa port 2, type the command:

at+send=lora:2:1234567890

The console will feedback with an “OK” message.

Figure 7981: RAK Serial Port Tool ABP message sent

The sent data shall be displayed on the ChirpStack console on the LORAWAN FRAMES tab.

Figure 7982: ChirpStack console UPLINK LoRaWAN frame in ABP mode.

LoRa P2P Mode

This section will show how to set and link two RAK4600 units to work in LoRa P2P mode.

  1. The two RAK4600 units shall be set to operate at the same frequency, for this demonstration: EU868.

  2. As shown in the previous sections, the setup of the RAK4600 units is done by connecting them with a general-purpose computer through the UART port, as shown in section Interfacing with RAK4600. The setup of each RAK4600 can be done separately, but testing the LoRa P2P mode will require having both units connected simultaneously to a UART port (This could be one computer with two (2) ports or two (2) computers with one UART port each).

  3. To set the RAK4600 to work in LoRa P2P mode, open the RAK Serial port tool and send the command, as shown in Figure 69.

at+set_config=lora:work_mode:1
Figure 7983: RAK4600 setting to LoRa P2P mode
  1. Configure the LoRa P2P parameters for both units. The command for setting the parameters has the following format:
at+set_config=lorap2p:XXX:Y:Z:A:B:C
  • Based on the AT Commands for RAK4600, the parameters are:

    • XXX: Frequency in Hz.
    • Y: Spreading factor, [6, 7, 8, 9, 10, 11, 12].
    • Z: Bandwidth, [0:125 kHz, 1:250 kHz, 2:500 kHz]
    • A: Coding Rate, [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
    • B: Preamble Length, 5~65535.
    • C: Power in dBm, 5~20.

For this example, the LoRa parameters are:

  • Link frequency: 869525000 Hz
  • Spreading factor:7
  • Bandwidth: 125 kHz
  • Coding Rate:4/5
  • Preamble Length: 5
  • Power: 5 dBm
  1. The set parameters are translated into the following RAK4600 AT command that is sent to both units, as shown in Figure 70.
at+set_config=lorap2p:869525000:7:0:1:5:5
Figure 7984: Setting both RAK4600 units with the LoRa P2P parameters
  1. Next, set the transmission mode of the RAK4600. In this example, Unit 1 is set to sender mode, and Unit 2 is set to receiver mode by AT command.
  • Unit 1 (Sender):
at+set_config=lorap2p:transfer_mode:2
  • Unit 2 (Receiver):
at+set_config=lorap2p:transfer_mode:1
Figure 7985: Set the module in the sender (left) and the receiver (right) mode
  1. Now, to send a message, the string “123456890” from Unit1 to Unit2. Type the command on Unit 1:
at+send=lorap2p:1234567890
  • The message will be automatically received by Unit 2.
Figure 7986: Sending a message from RAK unit 1(left) to RAK unit 2 (right)

Bluetooth Interface

Starting with the firmware version V3.0.0.6, there are three BLE modes in the RAK4600 module: Peripheral mode, Central mode, and Beacon scan mode.

  1. Peripheral mode: In this mode, you can scan RAK4600 BLE and connect with it using your normal mobile devices.
  2. Central mode: The RAK4600 BLE will not broadcast so that your normal mobile devices will not be able to scan it, but it is useful for IoT use case. For example, you can connect some BLE sensor nodes to the RAK4600. By setting the RAK4600 in the central mode, the RAK4600 acts as a BLE gateway. In the central mode, "Nordic UART Service" is supported.
  3. Beacon scan mode: The RAK4600 will scan the surrounding BLE signal. This mode is useful to scan for beacons like iBeacon near you.
NOTE

For the central and beacon scan patterns, you need to use the API development of RUI to play its role. For BLE related API interfaces, refer to RUI API Reference.

By default, RAK4600 BLE will work in the peripheral mode so that you can configure it over BLE, including DFU. Every time after resetting, you have only 60 seconds to connect your mobile device with RAK4600 over BLE. If you don’t connect with RAK4600 in 60 seconds after resetting it, the RAK4600 BLE radio will not broadcast to reduce power consumption. There is no limitation once your mobile device has connected with RAK4600 over BLE in 60 seconds.

Surely, you can set RAK4600 BLE to work in the central mode. After a RAK4600 module reset, there will be 30 seconds that RAK4600 BLE radio works in the peripheral mode. In peripheral mode, you can connect to RAK4600 through BLE using your mobile device and configure RAK4600 over BLE. But if you don’t connect with RAK4600 through BLE in 30 seconds, the RAK4600 BLE radio will change to central mode automatically. In central mode, RAK4600 can not be scanned by your mobile devices until you change the work mode to the peripheral or reset RAK4600 again.

Miscellaneous

Upgrading the Firmware

Before you start working with the RAK4600, it is recommended to keep the RAK4600 updated to the latest version of the firmware. The latest firmware can be found in the software section of the RAK4600 Module Datasheet.

In the following sections, two (2) options for flashing new firmware in a RAK4600 are shown: Upgrade through DAPLink and Upgrade through BLE.

Firmware Upgrade Through DAPLink

Refer to RAKDAP1 Flash and Debug Tool Overview

Through BLE

Requirements

The table shows the minimum hardware and software required to perform the firmware upgrade through BLE.

Mobile PhoneAndroid
DFU Packagehttps://downloads.rakwireless.com/#LoRa/RAK4600/Firmware/History-Release-Version/DFU-Package/
nRF connect appNordic Semiconductor
nRF Master Control Panel (BLE)Nordic Semiconductor
Upgrade Procedure

Follow this procedure to upgrade the firmware in Device Firmware Upgrade (DFU) mode through the Bluetooth Low Energy (BLE) interface.

  1. Download the latest DFU package of the RAK4600.

  2. Install the mobile app named “nRF Connect” or “nRF Master Control Panel (BLE)", which are developed by the Nordic Semiconductor company.

  3. Open the Nordic mobile app and scan for the BLE signal.

  4. After resetting the RAK4600, its BLE interface should broadcast a device name with the format “RUI_XX:XX:XX” for 60 seconds, as shown in Figure 73. Refer to the Bluetooth Interface to know more.

Figure 7987: RAK4600 BLE device name
  1. Select the device and press CONNECT.

  2. Select Secure DFU Service and enable the “Indications” option by pressing the icon highlighted in red in Figure 74.

Figure 7988: Enable the “Indications” option
  1. On the Buttonless DFU, click on the up arrow, then a pop-up menu should appear, as shown in Figure 75.
Figure 7989: Pop up menu to enter to the bootloader mode
  1. Press the SEND button to reset the RAK4600 and to enter into the DFU mode.

  2. Scan again with the Nordic app, and a device named DfuTarg should appear, as shown in Figure 76.

Figure 7990: Nordic app scan with RAK4600 in DFU mode
  1. Press CONNECT, then click the icon highlighted in red (DFU).

  2. Select the Distribution packet (ZIP) option in the pop-up menu and press OK.

Figure 7991: DFU icon
  1. Select the Distribution packet (ZIP) option in the pop-up menu and press OK.
Figure 7992: DFU mode options
  1. In the dialog menu, select the DFU package that was downloaded. After that, it will start to update the firmware through DFU over the BLE interface. The upgrade progress will be shown the same as Figure 79.
Figure 7993: DFU firmware update progress
  1. Upon completion, the RAK4600 will restart automatically, and the DFU connection will be terminated.

Now, the RAK4600 is ready to work with the new firmware.