[Visit https://www.nuvoton.com/iot_startup for more IoT solutions]
Reyax RYLR998 module features the LoRa long range, high interference immunity, and lower power consumption for wireless communication. And it is controlled by AT command. To test it before develop application, you may want to try to control it via AT command. A simply way is to use a NuMaker board running pass-through firmware to connect between PC and RYLR998 module.
Let's do it step by step. First, connect RYLR998 module to Arduino UNO connector on NuMaker-IoT board
Next, to build the pass-through firmware. The pass-through source code is written on Mbed OS v6. So you need to install Mbed tool to build the code. If you don't know the Mbed OS, we also provide pre-built firmware for NuMaker-IoT-M487 and NuMaker-IoT-M467, feel free to contact us (SalesSupport@nuvoton.com)
The pass-through source code as follows
Code: Select all
#include "mbed.h"
#define PC_BAUDRATE 115200
#define DEV_BAUDRATE 115200
UnbufferedSerial pc(USBTX, USBRX);
UnbufferedSerial dev(D1, D0);
// Low active Reset for RYLR998
DigitalOut dev_rst(D2, 1);
DigitalOut led1(LED1);
DigitalOut led2(LED2);
void dev_recv()
{
char c;
led1 = !led1;
while(dev.readable()) {
dev.read(&c, 1);
pc.write(&c, 1);
}
}
void pc_recv()
{
char c;
led2 = !led2;
while(pc.readable()) {
pc.read(&c, 1);
dev.write(&c, 1);
}
}
int main()
{
pc.baud(PC_BAUDRATE);
dev.baud(DEV_BAUDRATE);
printf("Starting pass-through firmware...\r\n");
pc.attach(&pc_recv, SerialBase::RxIrq);
dev.attach(&dev_recv, SerialBase::RxIrq);
while(1)
sleep();
}
Next, program the firmware to NuMaker board.
There are many terminal tools on PC, the "Termite" is recommended. When Nu-Link USB on NuMaker board connects to PC, launch Termite and open the Nu-Link VCOM with following configuration. COM port depends on your system assigned.
Now, you can issue AT+RESET to reset module, or AT+VER? to get module version number. Please refer RYLR998 manual for other AT commands.
If you have any problems, please feel free to contact us SalesSupport@nuvoton.com
For Nuvoton IoT platform information, please refer https://www.nuvoton.com/iot_startup