LoRaWAN Gateways Tutorial | Lora LoraWAN | What Are LoRaWAN Gateways?

3.0K130

Intro: LoRaWAN Gateways Tutorial | Lora LoraWAN | What Are LoRaWAN Gateways?

Check out the video of this Article: https://youtu.be/avGefKfQ0AI

Hey, what's up, Guys! Akarsh here from CETech.

If you have a lot of questions in your mind related to LoRa, LoRaWAN, LoRaWAN Gateways, etc. then you should give this a read because today we are going to get an insight into LoRaWAN Gateways, their purposes, their working, types, etc.

Some of our previous projects were related to LoRaWAN Gateways like setting up LoRaWAN Gateway with TheThingsNetwork and LoRaWAN based GPS Trackerbut today we are not going to do any of the things like these. We will discuss the LoRaWAN Gateway in detail which will also clear some of your doubts related to the use of LoRaWAN Gateway. So do give it a go if you are interested in LoRaWAN Gateways.

STEP 1: Get PCBs for Your Projects Manufactured

PCBGOGO, established in 2015, offers turnkey PCB assembly services, including PCB manufacturing, PCB assembly, components sourcing, functional testing, and IC programming.

Its manufacturing bases are equipped with the most advanced production equipment. Though it’s only five years old, their factories have experience in the PCB industry for over 10 years in Chinese markets. It is a leading specialist in surface-mount, thru-hole, and mixed technology PCB assembly and electronic manufacturing services as well as turnkey PCB assembly.

PCBGOGO provides the order service from prototype to mass production, join them now in celebrating Christmas and New Year in style! They are offering big coupon discounts along with surprise gifts with your orders and many more giveaways are being held!!!!

STEP 2: What Is LoRa?

Before we head over to LoRaWAN or LoRaWAN Gateway, we need to know what LoRa is because LoRaWAN is an enhanced or in other words more advanced version of LoRa. So basically, LoRa is the short form for Long Range. As its name suggests, LoRa is a radio frequency-based communication protocol that is used to transfer data over large distances to be specific over hundreds of kilometers by consuming very little power. The Longest range of data transmission using LoRa is recorded to be approx. 700 km but in that experiment, it was tried to make the conditions closer to the ideal conditions. You can read about that experiment from here. In normal conditions, I have observed a range of somewhere around 8 km comfortably which is still very high. Low power and Long Range, these two properties are the ones that make LoRa special. As mentioned above it works on the frequency bands which come under the radio frequency range. It uses license-free sub-gigahertz radio frequency bands like 433 MHz, 868 MHz, 915 MHz, and 923 MHz based on the location where we are using it.

It is based on spread spectrum modulation techniques derived from chirp spread spectrum (CSS) technology and is not a paid network like the cellular network. There are a lot of LoRa modules that we can use to transmit and receive data using LoRa they can work in either point-to-point mode or in the broadcast mode as well but the data will only remain within those LoRa nodes and the network consisting of those nodes. If we want to get data somewhere outside of the network, we can't do that by just using LoRa alone. That's where we need LoRaWAN. In LoRaWAN we connect the LoRa technology with any other technology such as Wi-Fi, Internet, etc through a Gateway. This enhances the capability of LoRa a lot. Some Advantages and Disadvantages of LoRa are:-

Advantages:

  • Long Range: LoRa devices can transmit signals over distances from 1km — 10km.
  • Low Power: LoRa end nodes wake up only at a fixed time, which can extend battery life. End node batteries can last for 5-10 years.
  • Security: Data encryption using AES128 between end nodes and network servers/ Data encryption using AES128 at the application level.
  • Low Cost: Work in free frequencies and no upfront licensing cost to use the technology. 6) Easy Deployment: Simple network architecture and easy to deploy by yourself.

Disadvantages:

  • Not for large data transmission.
  • Not for continuous monitoring.
  • Wake up only at a fixed time, so you can’t communicate with end nodes at any time.
  • The transmission rate is slow and easy to get interference because of using free frequencies.

So these were some details about LoRa. Now in the next step, we are going to check what LoRaWAN is.

STEP 3: What Is LoRaWAN?

In the last step, we checked out what LoRa is and we also got to know that whenever we need to transmit data outside a network between LoRa modules or on any device other than a LoRa module then we need a LoRaWAN with a LoRaWAN Gateway in it but before using LoRaWAN we obviously need to know what LoRaWAN is and what its specifications are, that we are going to do in this step.

LoRaWAN is the short form of LoRa based Wide Area Network. Whenever we use LoRa by combining it with any other technology such as the Internet, Wi-Fi, etc then it is said that we are using a LoRaWAN. In simple words, we connect our LoRa network with the Internet or any other technology. You might be thinking that how would the LoRa network be connected to the Internet. The answer to this question is by using a LoRaWAN Gateway. What is a Gateway and what it does will be discussed in the next step. For now, let's focus on LoRaWAN.

LoRaWAN network architecture is deployed in a star-of-stars topology in which gateways relay messages between end-devices and a central network server. The gateways are connected to the network server via standard IP connections and act as a transparent bridge, simply converting RF packets to IP packets and vice versa. The wireless communication takes advantage of the Long Range characteristics of the LoRaÒ physical layer, allowing a single-hop link between the end-device and one or many gateways. All modes are capable of bi-directional communication, and there is support for multicast addressing groups to make efficient use of spectrum during tasks such as Firmware Over-The-Air (FOTA) upgrades or other mass distribution messages.

Security is a primary concern for any mass IoT deployment and the LoRaWAN specification defines two layers of cryptography:

  • A unique 128-bit Network Session Key shared between the end-device and network server.
  • A unique 128-bit Application Session Key (AppSKey) shared end-to-end at the application level.

AES algorithms are used to provide authentication and integrity of packets to the network server and end-to-end encryption to the application server. By providing these two levels, it becomes possible to implement ‘multi-tenant’ shared networks without the network operator having visibility of the user's payload data.

So this was some of the information about LoRaWAN. In the next step, we will check out what LoRaWAN Gateway is and will also have a look at the role of a server in a LoRaWAN.

STEP 4: LoRaWAN Gateway and It's Working

In the previous steps, we got to know that we get a LoRaWAN by connecting our LoRa based network to the Internet. But for connecting the LoRa network to the Internet, we need a LoRaWAN Gateway. One thing that needs to be mentioned here is that connecting the LoRa network to the Internet is nowhere similar to connecting a mobile phone or any other device to the Internet. Here connecting to the Internet means connecting the network to a server such as TheThingsNetwork, ThingSpeak, etc. The data is sent to that server and from there onwards we can get data on our non-LoRa devices. So the LoRaWAN Gateway acts as a bridge between the LoRa Network and the Server. With the previous line, you might have got a clue of what is inside a Gateway. There is nothing more than a LoRa module and an Internet chip like ESP8266 connected together that make up a LoRaWAN Gateway. What happens between them is that the LoRa based chip inside the Gateway connects to the LoRa Network to be connected to the Internet. This chip collects the data from the LoRa Network and sends this data to the Internet chip which is connected to the Server and ultimately sends the data to the server. In this way, the LoRaWAN Gateway connects a LoRaWAN Gateway to the Internet the communication can be done in a reverse manner as well because the LoRa modules that we use are all transceivers and can transmit and receive data simultaneously. I have made a simple LoRaWAN Gateway on my own which you can check from here and its video tutorial from here. So this was the working of a LoRaWAN Gateway. The LoRaWAN Gateways are mainly classified on the basis of two parameters which are as given below:

  • Position: On the basis of the position we mean to say that the place where we can place our Gateway to make it work safely. There are two types of Gateways in this category:-
    • Indoor Gateways: These are the Gateways that are safe to be used Indoors. They are not weatherproof and can get damaged due to weather conditions outside. They have vents on their body as well due to which leaving them outside will not be a wise thing as water can enter in them ultimately frying them out. Examples of some Indoor Gateways from Dragino are LG308, LG01-N, LPS8, etc.
    • Outdoor Gateways: Unlike the Indoor Gateways these Gateways are more robust and weatherproof. They are structured in a manner that makes them waterproof and suitable for use outdoors. Examples of some Indoor Gateways from Dragino are DLOS8, OLG02, etc.
  • Channels: The number of channels of a LoRaWAN Gateway tells us that how many numbers of LoRa Networks a Gateway can handle simultaneously. There are again two types of Gateways in this category:
    • Single Channel: These are the Gateways that can connect a single LoRa network to the internet at a time. They have a single LoRa chip inside them that's why they can connect a single LoRa network to the Internet. Examples of some Single Channel Gateways from Dragino are LG01-N, OLG01-N, etc.
    • Multiple Channel: These are the Gateways that can connect more than one LoRa network to the internet at a time. They have more than one LoRa chip inside them which makes them capable of connecting multiple LoRa networks to the Internet. Examples of some Single Channel Gateways from Dragino are LPS8, DLOS8, etc.

STEP 5: LoRaWAN Network Server

In this step, we are going to get a look over what is a LoRaWAN Network Server, What it does, and will also mention some of the famous servers used nowadays.

The LoRaWAN Network Server is at the core of every LoRaWAN Network that enables connectivity, management, and monitoring of devices, gateways, and end-user applications. Its main objectives are to ensure the security, scalability, and reliability of data routing throughout the network. The core components of a LoRaWAN network server are:-

  • The Gateway Server manages secure gateway connections and configurations. It supports both the legacy UDP forwarder and the new LoRa Basics™ Station protocol which enables remote updates and configuration.
  • The Network Server implements the LoRaWAN protocol, validates the authenticity and integrity of devices, deduplicates uplinks, selects the gateways used for downlink, and sends ADR commands to optimize the data rate of devices.
  • The Application Server is responsible for decrypting the data received from the sensors and encrypting the data sent to the end devices. The data can be integrated into existing data management systems or IoT platforms such as AWS, Azure, and Google Cloud.
  • The Join Server stores device root keys and generates session keys to enable secure transmission of LoRaWAN messages. Our interoperable Global Join Server integrates with our LoRaWAN networks as well as with third-party ones.
  • The Identity Server registers users, applications, devices, and gateways. This allows for running a scalable, multi-tenant network, distributed over multiple regions around the world.

The LoRaWAN Network Server is also connected to the Packet Broker, a global agnostic LoRaWAN traffic exchange platform to increase network capacity. All functionalities are exposed by APIs so that the LoRaWAN stack can be integrated into companies' billing, network operation, device management, and organization systems. Some of the famous Network Servers that are used nowadays are:-

  • TheThingsNetwork Platform: TheThingsNetwork Server is an open-source platform that offers Secure, Scalable, and reliable LoRa routing of your valuable IoT data. The main features of TheThingsNetwork are Secure routing, Device management, User management, Data Storage, Monitoring, etc. You can check out my video tutorial on interfacing LoRaWAN Gateway with TheThingsNetwork from here.
  • Thingspeak Platform: ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize, and analyze live data streams in the cloud. You can send data to ThingSpeak from your devices, create instant visualization of live data, and send alerts.

Apart from the two mentioned above, there are a lot more servers that can be used as LoRaWAN Network Server.

STEP 6: Additional Factors Affecting Performance of LoRa

Till now, we got some detailed knowledge about LoRa, LoRaWAN, LoRaWAN Gateways, and LoRaWAN Network Servers. Now we will discuss some of the factors that if managed suitably can result in significantly improving the performance of the LoRa network.

  1. Power: It is a very important factor that decides the range of the LoRa module. The LoRa modules are available with different power ratings. Starting from 25mW to 100 mW and also going up to the 1W mark as well. Obviously, the more the power, the more will be the range of the module.
  2. Antenna: These also play a very important in data transmission using LoRa. The better the antenna power we use the better the range of the LoRa module another factor that helps is antenna tuning. An antenna that is well-tuned helps in increasing the range of the LoRa module.
  3. Height: This is also an important factor when we talk about the LoRa module range. The more the height at which the LoRa module is placed the better will be the range obtained from the module because it can be clearly seen that as we go above the ground level the obstructions in the Line of sight keeps on decreasing ultimately causing less attenuation.

So this was all about LoRa and LoRaWAN. Hope you liked it.