The story of LoRa began in 2009 when Cycleo, a French company, invented LoRa. LoRa (Long Range) support for Zephyr OS goes back to December 2019. Since then, there has been a huge interest among the community to extend their support for it. More recently, LoRaWAN (low-power wide-area network) support was added to Zephyr OS. This will provide true networking support to Zephyr OS over LoRa. It operates in licensed free Sub Gigahertz frequencies (865 MHz-India, 868 MHz-Europe, etc…). It makes the perfect choice for low data rates and long-range applications.
What is LoRaWAN?
LoRaWAN is a MAC layer that sits on top of the LoRa. According to the OSI model, LoRaWAN is the MAC (media access control) layer while LoRa is the PHY (physical) layer. LoRa protocol is closed, meaning it is proprietary to Semtech, while LoRaWAN specifications are open to the public. The reference implementation is available at the GitHub repository.
The end nodes transmit data to the gateway and the gateway will rely on the message to the network server. The network server has three components: network server, joint server, and application server. Communication between the end node and LoRaWan gateway happens through the LoRa technology while between the gateway and network server happens through TCP/IP mechanism.
LoRaWAN support in Zephyr OS
After successfully adding LoRa support to Zephyr OS, it was time for LoRaWAN. Rather than writing the code from scratch, the code was reused. This was because the existing code had support for many LoRa drivers. No modifications were required to the LoRaMac-Node repo other than enabling cryptographic drivers.
Designing the LoRaWAN API is hard when compared to LoRa. This is due to the synchronous (uplink) and asynchronous (downlink) nature of LoRaWAN specifications. The initial implementation supports both dynamic (OTAA) as well as static (ABP) ways of joining the LoRaWAN server, but there’s no support for Downlink.
Currently, it only has support for CLASS-A (all end device) device classes. The plan is to add support for CLASS-B and CLASS-C device classes. There is a potential plan to add secure element support for storing keys and states. This becomes a very important aspect when we need to deploy LoRaWAN to devices.
For someone who wants to start contributing, the most cost-effective board is 96Boards Wistrio. Those interested can also join the slack community here.
Source: All the images were taken from Linaro’s kernel engineer, Manivannan Sadhasivam’s presentation slides from the Open Source Summit 2020.
Abhishek Jadhav is an engineering student, RISC-V Ambassador, freelance tech writer, and leader of the Open Hardware Developer Community.
3 Replies to “LoRa & LoRaWAN support in Zephyr OS”
>The reference implementation is available at the GitHub repository.
That looks like the things network implementation opposed to an official one.
AFAIK there is only a reference implementation for the node but all of the server protocol is documented in the specs that are behind a email registration wall.
That’s correct! The link should be fixed. It should be pointed to: https://github.com/Lora-net/LoRaMac-node.git
Semtech only provides reference implementation for end node and the server side implementation varies between network providers.
Is this use of loramac-node effectively the official approach to LoRaWAN implementation in Zephyr? Wouldn’t it have been better to adopt the mbed os lorawan library, which makes proper use of RToS resources?