Commit graph

11 commits

Author SHA1 Message Date
Martin Jäger 8bb9bb67db lorawan: add emulator for unit testing
The emulator can be used for unit testing of LoRaWAN services.

It provides interfaces to send arbitrary messages to the LoRaWAN
stack and receive the response through callbacks without using
actual LoRa hardware.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-03-01 17:35:04 +01:00
Lucas Dietrich a59666754e lorawan: Add LORAWAN_PUBLIC_NETWORK configuration choice
Provides a toggle between public and private network selections.

Signed-off-by: Lucas Dietrich <lucas.dietrich@socomec.com>
2023-09-20 08:57:20 +02:00
Martin Jäger a9dc566a18 lorawan: add common backend for services
This is a prepartion for adding actual services needed for firmware
upgrade over the air (FUOTA).

The services run in a dedicated work queue.

This commit introduces code that initializes the work queue and
provides functions to schedule uplink messages after a given timeout.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-01-23 10:05:49 +00:00
Martin Jäger 22c8a67d4a lorawan: enforce larger system work queue stack size via Kconfig
The LoRaWAN subsystem uses the system work queue internally and needs
more than the default stack size of 1024 bytes. This is considered
in the sample application, but may be forgotten by out of tree users.

Enforcing it via Kconfig prevents users from accidentally getting
hard-to-debug stack overflows.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-11-28 10:49:18 +01:00
Benjamin Lindqvist 85c6de4335 lorawan: enable run-time config of region/freq
This commit adds support for compiling in support for several different
regions/frequencies and dynamically choosing which to use in run-time.
This commit introduces no API breakages - if a prj.conf contains only a
single region Kconfig, the new function lorawan_set_region() does not
need to be called.

Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
2022-11-14 11:16:16 +00:00
Jordan Yates f12d36a51e lorawan: move REQUIRES_FULL_LIBC dependency
Move the `REQUIRES_FULL_LIBC` dependency from `config LORA` to
`config LORAWAN`. The commit that added the `select` (f590d4fa) mentions
that this is required by `loramac-node`, which is only used by LoRaWAN,
not the base LoRa code.

This results in small FLASH savings when compiling the samples, but can
result in larger savings in more complex applications:
```
// With REQUIRES_FULL_LIBC
west build -b 96b_wistrio zephyr/samples/drivers/lora/send/
[162/162] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       37708 B       128 KB     28.77%
            SRAM:        8832 B        32 KB     26.95%
        IDT_LIST:          0 GB         2 KB      0.00%

// Without REQUIRES_FULL_LIBC
[181/181] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       37444 B       128 KB     28.57%
            SRAM:        8832 B        32 KB     26.95%
        IDT_LIST:          0 GB         2 KB      0.00%
```

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-02 14:16:18 +02:00
Giuliano Franchetto 6630f7fc07 lorawan: adding settings NVM for LoRaWAN
Adding a reference implementation of the Non-Volatile Memory module
needed to join any LoRaWAN network.

This NVM is based on the SETTINGS subsys to store all the required
key to join and communicate on a LoRaWAN network.

Without proper NVM, one may experience errors when using OTAA
to join the network, as the device may violate anti-replay
protection (depending on the version of LoRaWAN).

Signed-off-by: Giuliano Franchetto <giuliano.franchetto@intellinium.com>
2022-05-02 10:56:02 +02:00
Torsten Rasmussen 4790f68c84 kconfig: lorawan: experimental settings now uses select EXPERIMENTAL
With the introduction of `EXPERIMENTAL` and `WARN_EXPERIMENTAL` in
Zephyr all subsys/lorawan settings having `[EXPERIMENTAL]` in their
prompt has has been updated to include `select EXPERIMENTAL` so that
developers can enable warnings when experimental features are enabled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-10-25 10:46:48 +02:00
Marcin Niestroj 24a4b0d852 lorawan: add name to the region choice in kconfig
Adding name allows to modify default choice by other modules or
applications.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 19:59:35 -04:00
Kuba Sanak b44dcf88d9 lorawan: Add support for SystemMaxRxError
SystemMaxRxError is used to negotiate overall timing error for Rx
in the loramac-node library. Hence, add support for configuring this
parameter from Kconfig.

Signed-off-by: Kuba Sanak <contact@kuba.fyi>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Manivannan Sadhasivam 3ce8540f3a lorawan: Add initial support for LoRaWAN
Add initial support for LoRaWAN based on Semtech's loramac-node
library. Current implementation only supports OTAA config and
sending data to LoRaWAN server like ThingsNetwork.

While at it, this commit also moves the "loramac-node" library
definition from drivers/lora to subsys/lorawan. This is required
because, subsys/lorawan gets processed before drivers/lora and
that creates issue while building.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00