LoRa or LoraWAN, perhaps you have already heard about it or never yet ? here is the opportunity to learn basics about that technology that looks simple but can achieve great things and bring a nice solution in home-automation (remote sensors without power, large coverage with only one gaseway, alert for flooding system among others,…) but also for remote monitoring of devices.
I’ll start with general presentation of the technology, before I present you LoRa architecture with its different parts and then I’ll end with list of main positive and negative aspects of the technology. In a separate post, I’ll show you a real case use with few different devices linked with Home-Assistant.
General Presentation:
First some explanations about vocabulary. Most of time we use words LoRa or LoRaWAN in a general way but there is a difference: LoRa is the proprietary radio modulation system used while LoRaWAN means the whole system from end devices till the server. Here I’ll use the word LoRa or Lora all the time to make it easier as we won’t investigate much in technical details.
For the little story, LoRa technology has been developped by a french company in Grenoble in 2009 (Cycléo). It has been bought over by american company Semtech that was then able to manufacture all chipsets for the radio system. As of today all devices that implement LoRa technology have a Semtech chipset in it. Protocol itself is now managed by foundation LoRa Alliance.
What was the goal of Cycléo when they developped that technology ? Allow connected devices, most of time sensors, to be able to send their data remotely, sometimes other very long distances, while working on battery or with limited energy (solar panels, batteries…).
Sensors can be as different as an electricity or water counter, cars counter on a road, satisfaction buttons that you find in public places, humidity/temperature sensors….
Frequencies used:
LoRa uses frequencies free to use and different according at areas in the world:
- 863-870MHz for Europe
- 902-928MHz for USA, Canad, and South America
- 470-510MHz for China
- 915-928 for Australia
- 920-923 for Asia with some specifics in some countries
It’s important to always check frequency of LoRa equipments you buy or you won’t be able to use it in your area !
Data sent:
To be able to transmit on very long distances, transmission speed is very slow and packets are very small (it’s completely different with Wifi for comparison as it’s full duplex and high volume of packets all the time).
Also all packets are encrypted and so even if third parties can receive transmissions, they can’t be decoded and so used by third parties.
So we have a complete system in which sensors can work on a single battery durant multiple years and send datas at kilometers away. Even the simplets and smallest devices transmit easily at few kilometers, and gateways have quite easily a range of 20/30km cover around.
For information, current world record for LoRa transmission is 832km using weather balloon with a LoRa sensor (with the ridiculous radio power of 25mW and gateway on the ground !
An other case with my own gateway installed on terrace of my flat in town and it gets a coverage of around 30km while I’m in town.
Asymetric protocol
An other important detail to finish that general presentation is that it’s designed mainly for uplink of data and so is very asymetrical for traffic, even unidirectional for 99% of time.
Indeed, sensors are going to send messages to network but network won’t send back data in return. So, 99% of traffic is from sensors and devices to network and very few from network to sensors/devices. That’s why devices are listening at downlink messages very shortly when they send an uplink message.
We’ll talk about it again later as it has consequences on how network works. For example, messages counter in my gateway (only 15 downlink messages messages from network to devices for 3 237 uplink messages from devices).
Nevertheless, some devices can be an exception by using a special LoRa class that is class C, it allows to listen all the time at downlink messages. For example, the LED indicator for conference room showned below is only receiving messages but never sends any. Of course, this mode is only possible for devices that are not on limited power source like batteries or solar panels.
LoRa network architecture:
As with GSM networks for example, LoRa network has been designed so multiple networks can cohabit without problems if they are properly configured. So, it exists some private LoRa networks used for example by carriers to track their trucks, assets, or your own private network, some commercial networks like Swisscom, Orange,… and some participatory networks such as The Things Network, Helium…
Whatever the network, they all share the same structure that we are going to see more in details now helped with diagram below (diagram larger by clicking on it).
-
-
- Let’s start on the left with devices, most of time sensors like we talked before that are going to send datas at regular interval on LoRa network. Messages sent are received by one or more LoRa gateways in range. LoRa network handles automatically double messages and so no risk to receive 2 times the same message. Each message has a single ID so LoRa network can delete duplicate messages received by multiple gateways. As explained before, messages will be nearly only from sensors to LoRa network (Uplink). Messages from network to sensors are mainly to modify settings remotely in a sensor (Downlink) and they’ll be transmitted only when sensor will send a message (listening window). Indeed, it’s impossible to get a device that listens all the time as it would “cost” way too much in energy. It’s the Class A mode. Other modes exist in LoRa but they are quite specific and not much used: Class B where device will listen at regular intervals and not only when it transmits, and Class C where device listens all the time when he is not transmitting (but it’s only for devices that have permanent power supply). Few models of sensors/devices below (from left to right: humidity/temperature sensor from Dragino (LHT-65N), water leak/flood detector (Laiier Severn WLD), light indicator for busy conference room):
-
-
- Messages sent by devices are received by one or more gateways around. Gateways are “just” relaying radio messages from devices to LoRa server (Uplink) and also in the other way (Downlink). As size of LoRa message is very small, gateways can be connected at LoRa server through a simple GSM link or analog modem on phone lines as they generate very few traffic. Gateway can run on a simple SBC such as Raspberry without any issues using an appropriate HAT (for example at RakWireless on the left below), it can also be a dedicated hardware (such as the model in the middle) or more robust/industrial solution such as the one on the right. Most of these gateways can be powered by batteries/solar panels for secluded areas, far from any energy or for farms.
- Messages sent by devices are received by one or more gateways around. Gateways are “just” relaying radio messages from devices to LoRa server (Uplink) and also in the other way (Downlink). As size of LoRa message is very small, gateways can be connected at LoRa server through a simple GSM link or analog modem on phone lines as they generate very few traffic. Gateway can run on a simple SBC such as Raspberry without any issues using an appropriate HAT (for example at RakWireless on the left below), it can also be a dedicated hardware (such as the model in the middle) or more robust/industrial solution such as the one on the right. Most of these gateways can be powered by batteries/solar panels for secluded areas, far from any energy or for farms.
- LoRa server itself is fully software and can run on one or multiple computers depending of network size. He is most of time installed on Internet for an easy access from gateways to server, but it can also be installed in LAN for business network for example and can also be run straight in the gateway itself for very limited network or private ones (gateways shown above all support that mode). For private networks, we can use Chirpstack that is the only open-source LoRa server and that is as powerful as commercial softwares. For public or semi-public networks, operator will grant you access at needed settings to add gateways and devices in its network through a management console. The server will manage all gateways connected to it and also all radio traffic from devices, and will handle also different ways to communicate with outside through MQTT, API, etc… It’s server that will communicate with Home-Assistant to send for example sensors updates (most of time through MQTT). For our use in home-automation systems, we’ll use mainly participative networks such as The Things Network (TTN) or sometimes Hélium. Indeed, commercial networks like the ones of telecom operatiors, are not avalaible for end-users (Swisscom, in Switzerland, for example, grants access at LoRa network only if you are a company registered with them, same for Orange Business in France). Participative networks are based on a shared and fair use of ressources. TTN supplies and maintains the network server and users share their gateways which allows to develop quite easily a worldwide network that everyone can use free of charge. We’ll get more in details about it in a separate article dedicated at configuration of a LoRa device and its use with Home-Assistant.
- Application servers are services that will use datas received from sensors and devices through the LoRa network. Home-Assistant, if linked with a LoRa server, can be nearly considered like an Application server. It can also be a supervisor that will retrieve and display datas/states from sensors.
-
In conclusion:
-
- LoRa is perfect to collect datas from remote sensors (even very remote ones) with network quite easy to deploy. Communications being encrypted, data are secured. Ridiculous power needed to send a message, sensors can run during years on a single battery.
- Easy communication with home-automation systems like Home-Assistant through MQTT or an API. We’ll detail the process in a separate article.
- Indeed, it won’t replace Wifi or mobile network as communication is neither duplex, neither symetric neither high speed.
- Technology quite cheap with lot of different manufacturers for devices/sensors and gateways, easy to install its own LoRa network.
- Very flexible options to install gateways as they can be powered by just solar panels and use GSM connection for communication with LoRa server.
PS: This article has been published also on HACF website (french speaking community of Home-Assistant users) on that page: (HACF Lora Présentation).
Recent Comments