LoRa Basics™ Modem User Manual v3.2 documentation


LoRa Basics™ Modem is an easy-to-use software library that simplifies the development of LoRaWAN® end-nodes. By using LoRa Basics Modem in their solution, developers can work through an event driven interface, at a high level of abstraction without needing to delve into the details of the LoRaWAN protocol.

LoRa Basics Modem allows developers to seamlessly integrate the services provided by LoRa Cloud™ into their applications. LoRa Basics Modem can be used to generate messages compatible with the LoRa Cloud Modem & Geolocation Services, including periodic Device Management messages.


This document describes the LoRa Basics Modem library (SWL2001). This version of the document pertains to version 3.2.4 of the library.

It should be read in conjunction with:

  • LoRa Basics Modem SDK User Manual and associated SDK (SWSD001)

  • LoRa Basics Modem Porting Guide

Supported Transceivers

This version of LoRa Basics Modem supports the following transceivers:

  • LR1110 with firmware 0x0307.

  • LR1120 with firmware 0x0101.

  • SX1261.

  • SX1262.

  • SX1280.

  • SX1281.

New Features and Changes

The following new features and changes have been introduced since version 3.1.7 of the LoRa Basics Modem library.

New Features

  • AS923 group 4 Regional Parameters.

  • WW2G4 Regional Parameters for LoRaWAN protocol emulation.

  • SX128x radio support.


  • Added a new MCU_FLAGS option to the Makefile to make LoRa Basics Modem completely MCU agnostic.

  • LoRa Basics Modem library now uses the latest version of the LR11xx driver, v2.1.1.

  • SX126x driver was updated to the latest version, v2.1.0.

  • The PA configuration process in the example application was updated.

  • The ral_lr11xx_bsp_get_rssi_calibration_table workaround was removed from the example application as the LR11xx driver update makes it obsolete.

Bugs Fixed

  • LoRa Basics Modem now properly rejects files with a size between 8181 and 8192 bytes when using LFU.

  • Fixed an issue with the LFU service regarding encryption of files with size greater than 4080 bytes.

  • Fixed an issue with the radio interruption timestamp in the radio planner.

  • Corrected an issue regarding an outdated and aborted LBT pre-hook on LR11xx targets which resulted in no uplink.

  • Removed log print when uplinking on FSK to avoid adding delay on scheduled tasks.

  • When a link_adr_req MAC command with a new channel mask is received, it is now accepted if the custom datarate profile is enabled and configured with the highest datarate of the corresponding region.

  • The Large File Upload and stream services are properly reset when a rejoin request is received from the Modem and Geolocation Services.

  • Fixed the stack start and stop addresses in the example application stm32l476rgtx_flash.ld file.

  • Fixed hal_rtc_get_time_ms so that it returns a full range value.

A comprehensive list of changes is provided in the changelog file of the library.

Example Application

LoRa Basics Modem includes an example which serves to illustrate the use of the library and can also be used as a starting point when developing an application. This application is defined in the file utilities/user_app/main_examples/main_exti.c. The example application joins the LoRaWAN network and remains in sleep mode until the user button is pressed, at which time it makes a temperature measurement and sends an uplink with the measured value.

The application was developed for use in a Nucleo L476RG development board and supports the LR1110, LR1120, SX1261, SX1262, SX1280, and SX1281 transceivers.

To compile the example, perform the following steps:

  1. Edit file utilities/user_app/main_examples/example_options.h:

    1. Replace the values of USER_LORAWAN_DEVICE_EUI, USER_LORAWAN_JOIN_EUI, and USER_LORAWAN_APP_KEY with the correct values for your device and network.

    2. Replace the value of MODEM_EXAMPLE_REGION by the value corresponding to your region.

  2. In the utilities directory, issue the command make <TARGET> where target will be either sx128x, lr1110, lr1120, sx1261, or sx1262 depending on your transceiver.

  3. Plug in the Nucleo L476RG board.

  4. Drag the file utilities/build_<TARGET>/app_<TARGET>.bin to the NODE_L476RG storage device.

The example application outputs informational messages through the UART. These messages can be viewed by means of a terminal emulator using the serial parameters: 921600 baud, 8 data bits, no parity and 1 stop bit (921600 8N1).