IoT Drivers  v3.3.0 (S2022)
Engineering in Software Technology
Quick start guide for RN2483 based LoRa Driver

This is the quick start guide for the LoRaWAN Driver using RN2384 Module, with step-by-step instructions on how to configure and use the driver in a selection of use cases.

The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.

LoRa Driver use cases

Initialise the driver

The following must be added to the project:

Add to application initialization:

  • Initialise the driver without down-link possibility:
    lora_driver_initialise(ser_USART1, NULL); // The parameter is the USART port the RN2483 module is connected to - in this case USART1 - here no message buffer for down-link messages are defined
  • Alternatively initialise the driver with down-link possibility:
    MessageBufferHandle_t downLinkMessageBufferHandle = xMessageBufferCreate(sizeof(lora_driver_payload_t)*2); // Here I make room for two downlink messages in the message buffer
    lora_driver_initialise(ser_USART1, downLinkMessageBufferHandle); // The parameter is the USART port the RN2483 module is connected to - in this case USART1 - here no message buffer for down-link messages are defined

Then the LoRaWAN transceiver needs to be hardware reset.

Note
This must be done from a FreeRTOS task!!
lora_driver_resetRn2483(1); // Activate reset line
vTaskDelay(2);
lora_driver_resetRn2483(0); // Release reset line
vTaskDelay(150); // Wait for tranceiver module to wake up after reset
lora_driver_flushBuffers(); // get rid of first version string from module after reset!

Now you are ready to use the LoRaWAN module :)

lora_driver.h
Driver to MicroChip RN2483 LoRaWAN module.
lora_driver_flushBuffers
void lora_driver_flushBuffers(void)
Flush the internal buffers in the driver.
lora_driver_initialise
void lora_driver_initialise(serial_comPort_t comPort, MessageBufferHandle_t downlinkMessageBuffer)
Initialise the LoRa driver..
lora_driver_resetRn2483
void lora_driver_resetRn2483(uint8_t state)
Controls the reset pin on the RN2483 Module.
lora_driver_payload
Payload data structure.
Definition: lora_driver.h:51