IoT Drivers  v3.3.0 (S2022)
Engineering in Software Technology
ABP setup steps
Note
All the following code must be implemented in the initialisation part of a FreeRTOS task!
Nearly all calls to the driver will suspend the calling task while the driver waits for response from the RN2484 module.

Example code

In this use case, the driver is setup to Activation by personalization (ABP).

Workflow

  1. Define the necessary app identification for ABP join:
    // Parameters for ABP join
    #define LORA_appAddr "????????"
    #define LORA_nwkskey "????????????????????????????????"
    #define LORA_appskey "????????????????????????????????"
Note
The parameters depends on the setup of the LoRaWAN network server and will be given to you.
  1. Set the module to factory set defaults:
    {
    // Something went wrong
    }
  2. Configure the module to use the EU868 frequency plan and settings:
    {
    // Something went wrong
    }
  3. Set the necessary LoRaWAN parameters for an ABP join:
    if (lora_driver_setAbpIdentity(LORA_nwkskey,LORA_appskey,LORA_appAddr) != LORA_OK)
    {
    // Something went wrong
    }
  4. Save all set parameters to the RN2483 modules EEPROM (OPTIONAL STEP):
    Note
    If this step is performed then it is no necessary to do the steps above more than once. These parameters will automatically be restored in the module on next reset or power on.
    {
    // Something went wrong
    }
    // All parameters are now saved in the module
  5. Join LoRaWAN parameters with ABP:
    {
    // You are now joined
    }
lora_driver_join
lora_driver_returnCode_t lora_driver_join(lora_driver_joinMode_t mode)
Joins a LoRaWAN either with ABP or OTAA.
lora_driver_configureToEu868
lora_driver_returnCode_t lora_driver_configureToEu868(void)
Set the driver up to using EU868 standard.
LORA_OK
@ LORA_OK
Definition: lora_driver.h:66
lora_driver_saveMac
lora_driver_returnCode_t lora_driver_saveMac(void)
Save the set parameters into the EEPROM of the RN2483 module.
LORA_ACCEPTED
@ LORA_ACCEPTED
Definition: lora_driver.h:75
lora_driver_setAbpIdentity
lora_driver_returnCode_t lora_driver_setAbpIdentity(char nwkSKEY[33], char appSKEY[33], char devADD[9])
Set identifiers and keys for a ABP join.
lora_driver_rn2483FactoryReset
lora_driver_returnCode_t lora_driver_rn2483FactoryReset(void)
Reset the RN2483 module.
LORA_ABP
@ LORA_ABP
Definition: lora_driver.h:95