RAK Unified Interface V3 (RUI3) Serial Operating Modes
RAKwireless offers RAKwireless Unified Interface V3 (RUI3) which allows you to develop firmware for you RAKwireless devices and modules quickly and easily. RUI3 has APIs that you can use to create your own custom firmware on the module itself. You also have the option to use an external host microcontroller or microprocessor which sends commands via AT commands to RUI3 compatible module. The commands are sent via serial interface (abstracted as Serial Port) thru UART, USB, BLE and NFC.
This guide gives information and details about the three Serial Operating Modes of RUI3:
RUI3 Serial Operating Modes
AT Mode
It is designed for humans to configure devices interactively. It can also be used for M2M communication, but the transmission of big-sized human-readable text data is very inefficient. This is the easiest to understand on the three RUI3 serial modes because many other communication modems offers AT Command interfaces. In AT command mode, the RUI3 enabled device needs to wait for an external command coming from a host microcontroller or microprocessor.
For example, AT+APPEUI=?
AT command will show the Device EUI.
AT+APPEUI=?
0102030405060708
OK
Custom Mode
The AT command has corresponding parsers to analyze every byte received from the serial port (in every command sent, there will be expected reply). In custom mode, you can disable AT Command and create your own set of command and write dedicated parsers for each custom commands you designed. This gives you flexibility in creating your own command. This mode requires you to use RUI3 APIs.
RAK Modules Default Serial Operating Mode
The default mode of every serial port can be switched to a new mode. After switching to a new mode, the new mode setting will be kept even if the device resets. Default serial port has AT command mode. The default serial port is also where firmware update is done.
RAK4630
RAK Device | Serial Port | Serial Instance Assignment | Default Mode |
---|---|---|---|
RAK4630 | USB (Default serial port) | Serial | AT Command |
UART1 (pin 19, 20) | Serial0 | AT Command | |
UART2 (pin 15, 16) | Serial1 | Custom Mode | |
BLE | AT Command | ||
RAK4631+RAK5005-O | USB (Default serial port) | Serial | AT Command |
TX0/RX0 (Base board) | Serial0 | AT Command | |
TX1/RX1 (Base board) | Serial1 | Custom Mode | |
BLE | AT Command |
RAK3172
RAK Device | Serial Port | Serial Instance Assignment | Default Mode |
---|---|---|---|
RAK3172 | UART2 (pin 1, 2) (Default serial port) | Serial, Serial2 | AT Command |
UART1 (pin 4, 5) | Serial1 | Custom Mode | |
RAK3272S | UART2 (J4 header pin 7, 8) (Default serial port) | Serial, Serial2 | AT Command |
UART1 (J5 header pin 5, 6) | Serial1 | Custom Mode | |
RAK3372 | USB (Default serial port) | Serial, Serial2 | AT Command |
TX1/RX1 (Base board) | Serial1 | Custom Mode |
RAK3172-SiP
RAK Device | Serial Port | Serial Instance Assignment | Default Mode |
---|---|---|---|
RAK3172-SiP | UART2 (pin 29, 30) (Default serial port) | Serial, Serial2 | AT Command |
UART1 (pin 17, 18) | Serial1 | Custom Mode | |
RAK3272-SiP | UART2 (J3 header pin 7, 8) (Default serial port) | Serial, Serial2 | AT Command |
UART1 (J4 header pin 5, 6) | Serial1 | Custom Mode |
Switching Serial Operating Mode
After switching to a new mode, the new mode setting will be kept even if the device resets.
AT Command to Custom Mode
You need to use the RUI API Serial.begin
to switch the serial operating mode to custom mode. There is no direct AT command to switch to custom mode. You have to upload a firmware that uses the RUI API to the device. For example, in switching the Serial1 to custom mode, you will need Serial1.begin(115200,RAK_CUSTOM_MODE)
.
Custom Mode to AT Command
AT+ATM
command on a Serial Port will switch its serial operating mode to AT Command mode.
Serial Operating Mode Design Summary
AT Command Mode | Custom Mode | |
---|---|---|
Target User | Human/Machine | Human/Machine |
Purpose | Configure devices | Customize serial port parser |
Benefit | Friendly interface for human | Extendable |
Drawback | Inefficient in M2M case | Need to write parser from scratch |
Prerequisite | No | Need to setup IDE to write code |