Category Archives: LoRa

Sending the first LoRa frames

I haven’t had much time to blog lately because I got a new job designing software for subsea embedded devices. So let’s recap what I’ve been doing with my LoRa transceivers.

First of all, those tiny boards that I bought are not really handy to use. There exists an arduino LoRa shield called Dragino which is a bit more expensive but in the end it’s really worth to buy some of those. Plug and play is really the way to get things done if you have little hobby time.

It took a bit of time and reading the schematic to figure out the the pins used by the Dragino shield. To save you a few minutes, here they are:

// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 6, 7},
};

This can be used with the lmic (LoRaMac-in C) port to Arduino. I tried the “raw” example and got two modules to talk to each other without problems. In the screenshot you can see a waterfall of a LoRa frame being sent (totally oversteering the SDR and generating ghost images).

Another thing I tried was on-off keying (OOK modulation) and frequency shift keying (FSK modulation) using the digital IO pin for the keying. However that was less than successful. If somebody reading this has been experimenting with this, please let me know in the comments.

The next step will be using my own functions to transmit and receive LoRa frames, because I don’t want to keep using an entire library for something that simple. Then I will make a short tour in cryptography. That will be interesting too because it is not easy to implement a good encryption scheme if you’re not a specialist. However I will make a good effort, document everything here (except the actual keys), and if I fail, people will be able to read the temperature in my garage.

PS: kudos to https://tohtml.com for providing an easy way to put source code into an html document. Will use again.

Getting started!

Today I got one of the Lora-modules hooked up to a breadboard. This took much more effort than it should have. If you want to buy some of these modules, I would recommend getting a version that has a 2.54mm pin spacing (if those exist), not metric 2mm ones. That should make things much easier when prototyping. Also make sure you know the pinout of the module. My seller didn’t include it. After some googling, I found the pinout of a board that looked suspiciously like mine, and visual inspection showed that the VCC and GND pins matched. Probing also showed that NSS matched, after which I just assumed that all the rest matched too.

I also added a 8 pin voltage level shifter module (bought on Ebay) to interface the 3.3V SX1278 to the 5V Arduino Uno. Unless I overlooked something in the datasheet, the I/O pins of the SX1278 are not 5V tolerant.

SX1278 hooked up to Arduino

Continue reading

LoRa PHY layer

I serendipitously stumbled upon a great talk from last year’s CCC congress by Matt Knight. It delves into the PHY layer of LoRa and he explains how the protocol was reverse engineered. Impressive work, and very educational! It also means that I will probably be able to use an SDR for testing.

 

Update

It’s been a while since I last used my blog. This is wrong, because it is a great way to document my experiments. Making it public can (possibly) help others on the same journey, but more importantly I can fall back to it at a later time.

Therefore, my new years resolution for 2017 is to use my blog more. More specifically, I intend to use it to document my ventures into LoRa-land, an exciting new radio protocol for low power communications. So there, now I only need to follow up on my promise!

I bought two LoRa modules from Ebay. once I got them, I realized that the pin header has a 2mm pitch instead of the standard 2.54mm. My first quest will therefore be to interface it somehow to a breadboard…