LoRa seems to be getting everywhere and I recently found I needed to remotely monitor some items. Nothing major, temperature, light level and possibly a few switches. There would be more to these units which will record locally and where possible relay via the internet. Some units have no or limited internet access and thus another solution sought. There are various solutions including GPRS or similar but LoRa suddenly becomes an option especially using a public network such as The Things Network (TTN).
Thus at the start of 2016 I started to look more at using LoRa. I won’t go into the details of the basics, which can be found elsewhere on the web but in essence you have nodes which connect to a gateway; the gateway then relays the information to a server. You then build an application by pulling the data from the server.
So as a test I want to connect to TTN so I need a gateway. These are costly though, in excess of £200 and sadly the only existing LoRaWAN gateway in the area, TTN: Thatcham, is out of range. Not being sure if this project will go anywhere this is a lot to invest and so a simple and cheap solution is to use a LoRa module as a single channel gateway.
This is not a true LoRaWAN gateway but for testing will do fine. Thankfully this has been done several times so rather that reinvent the wheel I have used a solution by Thomas Telkamp ( https://github.com/tftelkamp/single_chan_pkt_fwd ). This uses a HopeRF RFM95, or RFM92, module connected to a Raspberry Pi. A single channel receives the data and forwards it on to TTN.
My version of a single channel LoRa gateway, a simple throw it together job!
The test setup consists of this gateway and a test node. The node is actually an Arduino UNO connected to a RN2483 module and a temperature sensor. Every minute it reads the temperature and transmits it.
First problem, Only one in three, or less, transmissions are received. This is because the RN2483 hops frequency around. A true gateway would not have an issue Cheap Oakleys here. I came up with three solutions:
- I could get the gateway to cycle through frequencies, but that is time-consuming and might actually make it worse.
- I could invest in more modules to receive a wider range of channels, but that costs!
- Disable transmission channels.
I don’t think (1) would work well and (2) is expensive which leaves just (3). This is simple to implement, on the node, a RN2484, ensure only channel 0, or whichever one you are using, is enabled. On the RN2483 we do this with the command:
- mac set ch status 0 on
- mac set ch status 1 off
- mac set ch status 15 off
So there is no jumping about and a single channel is now fixed. There are other limitations including there is no confirmation of transmission, it is send and forget, assume it gets there.
So I have a gateway, what next?
- Check out the range.
- Start making some test nodes (temperature, door sensor, etc.).
- Create simple application.
This will take some time, but if all works as planned I might invest in a real gateway, or at least build a better one like the one by mirakonta (https://github.com/mirakonta/lora_gateway/wiki).