RadioLib (open beta) - a new LoRaWAN v1.1 stack

Hi there TTN community,

We present you a new LoRaWAN stack, as of now in open beta: RadioLib!
(GitHub - jgromes/RadioLib: Universal wireless communication library for embedded devices)

After countless hours of work during the past months, we are now looking for people to try out this brand new stack. It isn’t in an official version release yet as it’s in beta, so you’ll have to clone the repo yourself.
Side note: DO NOT post bugs and issues here - refer to the GitHub link for those.

Here are some of the current highlights - as far as a beta-version can be trusted:

  • LoRaWAN v1.1 from the ground up
  • Runs on a lot of platforms
  • SX126x implemented
  • SX127x implemented
  • Complete ADR and other common server-side MAC commands
  • Complete session persistance on EEPROM-enabled boards (looking at you, ESP32 & Pico!) allowing real deepsleep and battery swaps
  • Support for both dynamic bands (e.g. EU868) and fixed bands (e.g. US915)
  • Support for boards with drifting clocks (looking at you, Atmel)
  • Self-contained (no external dependencies)
  • Many more (future…)

The stack has been tested (read: compiled + handful of uplinks/downlinks) on the following platforms & modules:

  • ESP32 & SX1276 (TTGO LoRa32 T3 v1.6.1)
  • SAMD & SX1276 (Adafruit Feather M0 with RFM95)
  • ESP32-S3 & SX1262 (Heltec Wireless Stick Lite V3)
  • ASR605x & SX1262 (Heltec Cubecell AB-01)
  • Pico / RP2040 & SX1262 (RAK11300)
  • ATmega4808 & SX1262

And tested on the following regions:

  • EU868 (extensively during development)
  • AU915 (smoke tested, just a couple of hours)
  • US915 (smoke tested, just a couple of hours)

Over the course of the 2023’s summer, RadioLib’s author Mr. Gromes added initial support for LoRaWAN by providing all the essentials for joins, uplinks and downlinks. But while he may be an RF expert and implemented the fundamentals, this was by no means a functional LoRaWAN stack. So, encouraged by @descartes, I took this opportunity to learn the LoRaWAN specification once and for all and spent all my spare time (and some sweat and tears) on getting this here.

Let’s use this topic as a meta-topic about RadioLib’s LoRaWAN stack. Can you help test this stack? Please share your experience, successes, questions and ideas for improvements here!

Do NOT use this thread for actual bugs and problems - refer to GitHub for those and don’t forget to include debug information.

I’ll try to keep an eye on the feedback, but please know that I’m a full-time student plus part-time teacher, and I’d like to point out once more that this is a beta-version: expect bugs, don’t expect us to fix all your problems. You are strongly requested to contribute yourself (or at least propose solutions to make it easier)!

Finally, is RadioLib going to be the solution you’re looking for, and are you in a position to compensate my students for their teacher being distracted the last months? They would love some extra hardware for their LoRaWAN-enabled air quality boxes. Please check out https://www.meetjeleefomgeving.nl/contributing/. And while you’re at it, I am most definitely sure @descartes could use more than a few beers to drink away all the headaches and crises I’ve caused him! Really, Nick, I’m very grateful for all the support, you were a great sparring partner during the process and the supplier of most of the boards and dev environment. Thank you! I’d have quit three times over otherwise…

And who knows… will LMIC be able to retire for all but the smallest boards? :slight_smile:

But let’s not forget that all of this was only possible because of RadioLib’s main developer Mr. Gromes. Definitely deserves the credits!

14 Likes

I’d note for those who wonder who this new kid on the block is, he’s come out of the shadows of the @Ichthus_College_Info account where he runs the awesome community air quality monitoring project with his students for his town: https://www.meetjeleefomgeving.nl

This covers the whole LoRaWAN gambit - from soldering hardware, firmware, logistics, integrations & dashboards. And coping with a grumpy old programmer in Steven’s second language for some integration & dashboard stuff.

So it would be fair to say that @stevencellist has earnt his stripes on the whole LoRaWAN shebang before embarking on his RadioLib adventure.

There is still stuff to implement, still some cross-referencing to do, still some time needed for devices to run for a few weeks, but we tested this with our eyes open, looking at logs from all angles, including the actual SPI transfers.

This has been tested in my underground bunker / radio proof chamber on US915 & AU915 to check the region settings are good. Duty cycle & dwell periods will be your own responsibility.

RadioLib does not naturally fit in to 32K flash. If you have the time & inclination to put it on a diet, do say so. For now I’m soak testing it on a selection of devices - it works just fine on an ATmega480X based device, like the RocketScream board, if you do want to stick to AVR.

5 Likes

Nice work. Thanks for the update.

Might find the SX1262 devices I accidentally bought a while ago and gave up, as there was no decent LoRaWAN libraries out there, and RadioLib had LoRa P2P-only support at that time.

Glad it worked out for your AU915 tester too :slight_smile:

2 Likes

An update on this topic: RadioLib just updated to version 6.3, allowing you all to use its (beta) LoRaWAN support straight from your favourite library manager (Arduino / PlatformIO). No need to clone locally anymore for normal use!

If you use its LoRaWAN stack in any way, we ask you kindly to share your experience! Does it work just fine, were there hiccups along the way, is it a complete disaster? Please let us know (and for actual issues, file those on the GitHub repository, please and thank you :slight_smile: )

9 Likes

10 posts were split to a new topic: RadioLib / Heltec detour via Chirpstack

2 posts were split to a new topic: LW v1.1 device not joined

I am not a huge fan of platformio. Happily RadioLib does not need platformio and i can use normal .ino code files and libraries in combination with arduino-cli.
I do not know if i am searching wrong, but are there any .ino examples out there that would show how to use RadioLib in combination with TheThingsNetwork?

HI

You can begin with Starter.ino example, fine with TTN

https://github.com/jgromes/RadioLib/tree/master/examples/LoRaWAN

Thanks. Do i always need GitHub - mcci-catena/arduino-lmic: LoraWAN-MAC-in-C library, adapted to run under the Arduino environment in combination with RadioLib to get somethings send with the keys into the TTN network?

From the first post:

Did the need of LMIC retired?

Erm, no, the libraries are mutually exclusive, they both do the same thing, having two at the same time will make life “interesting”.

If you look at the notes that accompany the starter files it will tell you all about how to use it. They were written explicitly for TTN by someone that knows TTN reasonably well and uses TTN a fair bit with RadioLib, so you should be good to go.

LMIC is a most excellent library that I used when I first started out with LW and it still works fine in a number of use cases. But it’s not as up to date as RadioLib which supports LW 1.1 and is easier to implement on ESP32 with deep sleep. On the other hand, LMIC still fits on to smaller devices, whereas RadioLib needs at least 64KB for AVR, ie not Uno.

1 Like

And with the somewhat recent additional support for SX126x radios LMIC has become a valid choice for newer hardware as well! When I wrote that comment it wasn’t available for those.

Thanks for all the answers. I know now, that i want to use RadioLib and not LMIC.