03 July 2020

RaspberryPI and LoRAWAN with SX1276

I had laying around a SX1276 LoRA module for some months and following an IoT discussion at work I thought it would be the right time to play with it.

Instead of wiring an Arduino board with level converters (or use a 3v3 Arduino Nano, which I have), I opted to use an old, single-core, 512 MB RAM, Raspberry Pi B+: wiring is straightforward and I can debug+control it remotely over SSH.

Not that I have meaningful data to transmit. I am interested in the RF part of the whole thing since 868 MHz lies between 70 and 23 cm HAM bands and everyone writes wonders about the LoRA modulation scheme. Because of that I chose the software that offered the fastest way to get a signal on the air with the support of TTN. I used arduino-lmic-rpi with bcm2835-1.64 driver. The RPi distro is based on Debian 8 with kernel 4.9.35, don't ask me its name.

The TTN part is well documented: you need to create an Application and register your device on their portal. Then get Device EUI, Application EUI and App Key which have to be inserted into the .cpp file. Pay attention that DEUI and AEUI need to be reversed, so LSB first. Compile and run.

If everything is correct and your LoRA node can reach a gateway nearby, your transmissions will begin to appear on the web console. You need a TTN gateway in your area and it must be able to receive your transmission!!

Performance? My signal is being received by 4 gateways and a couple of them seem to be quite far away (but in line of sight).

Nothing new so far, I have only replicated someone else's work.