Long range transmission is necessary for transmitting data from IoT devices. But sending large amounts of data over a very long distance requires too much energy.
Using Wi-Fi or cell modems for this purpose is expensive and slow. That’s where LoRa comes in. This technology uses chirp spread spectrum to send encoded data packets over long-range distances.
1. Get a LoRa Gateway
If you are new to LoRa, the first thing you will need is a gateway. There are a number of different options available, but if you want to get started quickly we recommend the KONA Micro Gateway from Tektelic with Ethernet and 4G cell backhaul.
A gateway is a device that scans the LoRa spectrum and captures data packets sent by end devices (like sensors). The gateway then relays the data to a network server that handles the message on behalf of the device. The network server is in charge of removing duplicate data packets, verifying that the message was received and handled correctly, and performing security checks.
You can build your own gateway using a Raspberry Pi and the LoRa module from Dragino, but it is also possible to purchase one from a variety of retailers. We recommend checking the list of compatible gateways on the LoRa Alliance website before making a purchase. It is important that the gateway you choose supports the LoRaWAN protocol and is compatible with your application.
2. Connect Your LoRa Gateway to a Router
LoRa is an open, long range wireless communication protocol developed by Semtech for the Internet of Things (IoT). It uses unlicensed spectrum to transmit data in low-power radio frequency signals over large distances. These signals are picked up by LoRa gateways, which then send the data to a network server for processing.
A network server deduplicates messages received from multiple gateways, decrypts the end-to-end encrypted data and handles LoRa features such as adaptive data rating. It then routes the data to an application. Network servers can be provided by network operators such as TTN or ChirpStack or by end users like you.
To connect your router to the LoRa Gateway, you can use a cable connected to an Ethernet port or through Wi-Fi. You can also configure a static WAN IP address in the Network –> Network Interface.
3. Connect Your LoRa Gateway to the Internet
LoRa is an RF modulation technology that enables long-range, low-power wide area networks (LPWANs). In urban areas, messages can travel up to three miles (five kilometers), and in rural areas they can go as far as 10 miles (15 kilometers) or more. In addition, LoRa devices consume very little energy – they can operate on just milliwatts of power – and their batteries last for many years.
For you to communicate with your LoRa devices, they need to be connected to a gateway that can receive the data packets. The gateway then sends the data packet to a network server that interprets the information. You can run your own network service (Semtech offers a reference implementation), or there are companies that offer hosted LoRa network services.
Once you’ve set up your development board, connect it to your computer using a USB cable. Log in to your balena Cloud account and select the “Settings” tab. Enter the Ethernet MAC address (6 bytes) or EUI (8 bytes) of your gateway and click “Update device-keys”. The gateway will appear as connected on the TTN gateway page.
4. Connect Your LoRa Gateway to a Device
A LoRa Gateway is a critical component of an IoT network. It bridges communication between end-devices and a network server, and it is capable of receiving data from multiple sensors at once.
The number of end devices that a single gateway can support depends on several factors, including the data volume transmitted by the sensor and its transmission interval. It is also important to consider environmental factors, such as the distance between the gateway and the end device.
In most cases, a LoRa Gateway will be connected to a TTN (The Things Network) or independent LoRa Server, which will deduplicate the packets, process the payload and handle LoRa features like adaptive data rating. The gateway must also be registered with TTN or the LoRa Server. To do so, you will need a premium account with The Things Industries and paste the EUI of your gateway into the TTN Console. When you click on the “Register Gateway” button, your gateway will be configured and ready to receive messages from connected end devices. You will then be able to monitor the status of your network in the TTN Console.
5. Configure Your LoRa Gateway
You can test your gateway by running a command in the terminal window of your computer program (Cutecom, Hyperterminal, or Putty in Linux and Windows). This will send a message to your LoRa device. If your device receives this message it is connected to the network. You can also write to the LEDs on your development board to turn them on or off. On some boards, writing 0 turns the LEDs on and 1 turns them off.
To connect your gateway to the Loriot LoRaWAN network server, you must know its Ethernet MAC address. This is usually the same as its Wi-Fi MAC address, but you need to add 2 to the last hex character.
The hex value is found by going to the device page of your gateway and clicking “Manage Device”. You will see a “Gateway MAC” field near the bottom. Enter the MAC address in the field and click “Update”. Once you have updated the gateway, it should appear as connected on your Loriot account. You can find more information about the different types of gateways on the official LoRa Alliance website.