LoRaWAN® Application Configuration

Last modified by Microchip on 2023/11/09 08:54

Application Configuration

This section provides you with information on how to configure the SAM R34-based LoRaWAN® application examples on Advanced Software Framework 3 (ASF3) to be able to join the network server/join server based on the provisioning parameters used to register/enroll a device.

Every application example on ASF3 pertaining to the SAM R34 device/WLR089U0 module has an application configuration file called conf_app.h, which is available at PACKAGE_ROOT/src/config.

Application Configuration File

This application provides the method of end-device activation.

#define DEMO_APP_ACTIVATION_TYPE OVER_THE_AIR_ACTIVATION
 //#define DEMO_APP_ACTIVATION_TYPE ACTIVATION_BY_PERSONALIZATION

This application provides the message type for sending data from the end-device.

#define DEMO_APP_TRANSMISSION_TYPE UNCNF
 //#define DEMO_APP_TRANSMISSION_TYPE CNF

This application mentions the port for uplink data.

#define DEMO_APP_FPORT 1

This application can modify or set the DevEUI (64-bit) to be used with OTAA. The SAMR34 Xplained Pro board has the DevEUI stored in its EDBG controller; the user has to define EDBG_EUI_READ as 1 to read the DevEUI from edbg and to set it. Otherwise, the value DEMO_DEVICE_EUI configured in conf_app.h will be used as a DevEUI.

By default, EDBG_EUI_READ is defined in the project properties as symbols.

The WLR089 Xplained Pro board has the DevEUI stored in its internal flash; the user has to define MODULE_EUI_READ as 1 to read the DevEUI from flash and to set it. Otherwise, the value DEMO_DEVICE_EUI configured in conf_app.h will be used as a DevEUI.


By default, MODULE_EUI_READ is defined in the project properties as symbols.

#define DEMO_DEVICE_EUI {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}

The application can modify or set the AppEUI (64-bit) to be used with OTAA.

#define DEMO_APPLICATION_EUI {0xDA, 0xBB, 0xAD, 0x00, 0xDA, 0xBB, 0xAD, 0x00}

This application can modify or set the AppKey (128-bit) to be used with OTAA.

#define DEMO_APPLICATION_KEY {0xBA, 0xAD, 0xF0, 0x0D, 0xBA, 0xAD, 0xF0, 0x0D, 0xBA, 0xAD, 
0xF0, 0x0D, 0xBA, 0xAD, 0xF0,0x0D}

Ensure class A device is defined.

#define DEMO_APP_ENDDEVICE_CLASS CLASS_A

Gateways usually only support 8+1 channels (also known as a SUBBAND). The NA/AU Regional band has 64+8 channels. Therefore, there are eight SUBBANDs in the case of NA/AU region. The application by default is configured to work in SUBBAND 1. Change the SUBBAND value according to the gateway/NS configuration.