Provides a RIOT adaption of Semtech LoRaMAC implementation. More...
Provides a RIOT adaption of Semtech LoRaMAC implementation.
This package provides an API built on top of the Semtech LoRaMAC-node reference implementation of a LoRa network.
This package only works with Semtech SX1272 and SX1276 radio devices. Thus, in order to use it properly, the application
Makefile must import the corresponding device driver:
In order to use this package in an application, add the following in the application
Since the LoRa radio depends on regional parameters regarding the access to the physical support, the region where the device is used needs to be set at compile time. Example for EU868:
The package provides a simple API for initializing the MAC, setting/getting parameters, joining a network and sending/receiving packets to/from a LoRa Network.
main.c, some header files must be first included:
Then define global variables:
Now in the
To receive downlink messages, enable the
semtech_loramac_rx and use a dedicated receiving thread.
semtech_loramac_recvfunction in a loop:
If the board CPU provides an internal EEPROM, this package provides a mechanism for storing EUIs, keys and some MAC parameters (frame counter, join status). After a successful join procedure, use
semtech_loramac_save function to persist this information and it will be loaded automatically at the next reboot. If the device is already joined to a network, to avoid another OTAA join procedure use
semtech_loramac_is_mac_joined function to check the join status of the device.
This mechanism is especially useful when using deep sleep power modes that don't preserve RAM.
The internal implementation of the required LoRaWAN timings (delay before opening RX windows, duty-cycle delays) automatically achieves the lowest possible power consumption while remaining usable when RIOT's low power modes are not blocked. All timings are managed by the ztimer high level timer abstraction layer running on the low-level RTT peripheral which allows for:
The library is using the BSD 3-clause license.
|Semtech LoRaMAC timer compatibility definitions. |
|Public API and definitions of the Semtech LoRaMAC. |