What is Peer-To-Peer (P2P) LoRa Communication?
LoRaWAN is a networking protocol built on LoRa hardware that allows for long-range wireless data transmission in large-scale Internet of Things (IoT) applications. LoRaWAN networks are built on a star-on-star topology that enables dense and reliable connections between devices. However, did you know that you can also make use of peer-to-peer connections using LoRa (P2P LoRa Communications) to make even better use of your IoT systems? Well, join us today to find out exactly how!
This article will cover the following content and more!
- Recap: What is LoRa & LoRaWAN?
- What is P2P LoRa Communication?
- Benefits of P2P LoRa Communication
- P2P LoRa Communication: Product Recommendations
- How to Set Up P2P LoRa Communication
Recap: What is LoRa & LoRaWAN?
LoRa, which is short for Long Range, is one of the major long-range and low-power wireless communication systems developed by Semtech Corporation. While LoRa & LoRaWAN are commonly mistaken to be the same thing, they represent different components of a LoRa-based communication system.
LoRa is a radio frequency carrier signal based in the physical (PHY) layer that converts the data it receives to signals. On the other hand, LoRaWAN is a protocol located in the Media Access Control (MAC) layer that promotes LR signals to wider applications.
In simple terms, you can understand LR to be a type of hardware that supports long-range wireless communication, whereas LoRaWAN refers to a network protocol based on LoRa.
Together, LoRa & LoRaWAN allow long-range, low-power applications to be built for IoT, enabling wireless transmission over distances of up to 15km! They are suitable for a variety of application environments, amongst other benefits and features shown below!
Supported by a diverse ecosystem of hardware and software developers, network providers and industry associations, as well as the LoRa Alliance®, LR technologies are increasingly accepted and easier to implement worldwide. Hence, anyone choosing to get started with LoRaWAN can expect to rely on extensive documentation and community support with platforms like The Things Network (TTN).
What is P2P LoRa Communication?
To understand the unique value proposition of LoRaWAN P2P Communication, we first have to understand the network architecture of LoRaWAN, which consists of four major components:
- End Nodes – Represents edge devices or sensors
- Gateway – Collects or concentrates data from several end nodes
- Network Server – Consolidates data from gateways for upload to application server
- Application Server – Processes or displays consolidated data
End nodes contain sensors that collect valuable information to be transmitted to the cloud. This is done by broadcasting LR data packets to nearby LoRaWAN gateways, which then forward the data to the cloud. Since all gateways in range of the transmitting end node receive the data, this creates a star-on-star topology which promotes dense interconnectivity and reliability in LoRaWAN networks, shown below:
P2P LR Communication refers to LR communications that occur directly between end node devices (peer-to-peer), instead of those that occur between an end node and the gateway. This communication uses the same long-distance LR modulation between the two devices, and enables numerous possibilities with LR technology!
For example, the Grove Wio E5 module can be used to enable P2P communication easily on any kind of IoT device!
Benefits of P2P LoRa Communication
The design of the LoRaWAN network architecture has its own purpose and benefits, which we’ve discussed in depth here. Nonetheless, P2P in LoRaWAN allows end nodes to communicate directly without the use of a gateway, which brings several benefits.
1. Increase the Range of LoRaWAN Coverage
In some areas, the full LoRaWAN infrastructure may be unavailable or unfeasible to set up. By linking multiple end nodes together, we can create a chain topology that extends the range of the LoRaWAN with a limited additional cost!
2. Reduce Costs of Using LR for IoT
Although LoRaWAN gateways are relatively affordable, small-scale applications may benefit from bypassing the use of an additional device to save further costs. This is a great advantage for beginners who are just getting started and want to simply experiment with LoRa.
3. Increased Flexibility with LoRaWAN Networks
Did you know that end nodes engaged in P2P LR communication can continue to interface with nearby LoRaWAN Gateways? When used together, P2P connections can be used to further reinforce the LoRaWAN network, providing greater operational reliability.
P2P LoRa Communications: Product Recommendations
There are many options for edge devices that can serve as LoRaWAN end nodes. At Seeed, we are committed to delivering industrial-grade IoT products that will help you build high-performance and reliable IoT systems. If you’re in the market for LoRaWAN products to use in P2P LoRa communication, you’ll definitely want to check out the following recommendations, from Dev kit to the very own LoRa Modules!
Wio-E5 Development Kit
The Wio-E5 Development Kit consists of the Wio-E5 Development board, an antenna, a USB Type C Cable and a 2*AA 3V Battery Holder. The Wio-E5 Dev Board is embedded with the Wio-E5 STM32WLE5JC module with LoRaWAN protocol compatibility on the global frequency band. In addition, it supports various data protocols and interfaces, such as full GPIOs, RS-485 and Grove!
Product Features:
- Ultra-low power consumption and high performance
- Easy testing and rapid prototyping
- Full GPIOs that lead out to rich interfaces, including RS-485, Grove, and etc.
- Global LoRaWAN® and LR frequency plan supported
- Long-distance transmission range to 10km (ideal value in open area)
If you’re keen to pick up the Wio-E5 Development Kit, visit the Seeed Online Store now!
Wio-E5 Mini (STM32WLE5JC) Dev Board
The Wio-E5 Mini Dev Board is the younger brother of the Wio-E5 Dev Board, featuring the same STM32WLE5JC module. With a smaller size, the Wio-E5 Mini Dev Board does not have Grove compatibility, but still features full GPIOs for UART, ADC, SPI, I2C, etc. For rapid testing and building of small-sized LR device and application prototyping, the Wio-E5 Mini is a great choice!
Product Features
- Full GPIOs led out from the Wio-E5 STM32WLE5JC
- Global LoRaWAN® and LR frequency plan supported
- Long-distance transmission range to 10km (ideal value in open area)
- Mini and compact size, suitable for rapid testing and building small size prototype
- Convenient RESET and BOOT buttons on board
Visit the Seeed Online Store to learn more about the Wio-E5 Mini Dev Board!
Grove – Wio-E5 (STM32WLE5JC)
If you want to build an LR End Node solution with an SBCs like the popular Raspberry Pi 4, or a microcontroller like the Wio Terminal, the Wio-E5 Grove module will be your best bet. Featuring full LoRaWAN capabilities in the modular simplicity of the Grove ecosystem, the Grove Wio-E5 lets you bring your existing devices into your LoRaWAN network with just a few simple steps!
Core Features:
- Wio-E5 (STM32WLE5JC) embedded
- Support LoRaWAN protocol on EU868/US915 frequency band
- Ultra-long transmitting range up to 10km (Ideal value in open space)
- Easy control by AT command via UART connection
- Rapid prototyping with plug-and-play Grove interfaces
- Ultra-low power consumption and high performance
Visit the Seeed Online Store to learn more about the Grove Wio-E5 Module today!
Wio-E5 & Wio-E5-LE (STM32WLE5JC) LoRa Module
For those who want to custom design your LoRa-powered PCBAs, I highly recommend checking out our STM32WLE5JC-powered LoRa modules: the Wio-E5 and Wio-E5-LE, which are the world-first combo of LoRa RF and MCU integrated in one single tiny module! Coming with CE, FCC, TELEC certifications, and built-in AT Command, these two modules are production-ready to scale up your LoRa products.
Highlight features:
- STMicroelectronics’ STM32WLE5JC embedded
- Built-in AT command & ST SDK for further development
- Ultra-low power consumption down to 26 mA In transmit mode
- Equipped with a variety of GPIO interfaces (UART, I2C, and ADC) for peripherals expansion
- Ultra-long transmitting range up to 10km (Ideal value in open space)
Visit the Seeed Online Store to learn more about the Wio-E5 LoRa Module today!
Note: A full LoRaWAN system will require four key components: End nodes, gateway, network server and application server. For our full list of products for each category, please visit their corresponding links!
- LoRa Modules
- LoRa Dev Boards & Dev Kits
- LoRa Sensor Nodes (Devices)
- LoRa Gateways
- LoRa Accessories
- Industrial-grade LoRaWAN Products for Outdoor Applications
Tutorial: How to Set Up P2P LR Communication
In this section, learn how you can set up a simple application that uses P2P LR communication between two end node devices!
Required Materials
This tutorial will use the following materials, so pick them up if you want to follow along!
The Seeeduino Lotus is an Arduino-compatible board that combines the best of the Seeeduino and the Grove Base Shield. With the Grove ecosystem, hardware prototyping is made plug-and-play simple and convenient without the need for complicated wiring or soldering!
Hardware Setup
Plug each LR Radio module into the D5 socket of each Seeeduino Lotus, like shown below. That’s it!
Software Setup
Step 1: Download the software library here. For detailed instructions on installing libraries, see here.
This library supports devices which use AVR / SAMD / STM32F4 chips but they each require some setup for Serial communication. Since the Seeeduino Lotus uses an AVR chip, we define software Serial as SSCOM (PC connection) and hardware Serial to communicate with the Grove LR Radio module.
Step 2: In the Arduino IDE, navigate to File > Examples > Grove_LoRa_433MHz_and_915MHz_RF-master.
Step 3: For the first Seeeduino Lotus, open the rf95_client example and upload the code. To upload, navigate to Tools > Board, choose “Seeeduino Lotus” and select the respective serial port before clicking on the Upload button. This device will be our sender, and will transmit “Hello World” every second via P2P LR communication.
Step 4: For the second Seeeduino Lotus, open the rf95_server example and upload the code. This device will be our receiver, and will print out the data that it receives. Additionally, it will send an acknowledgement message back to our transmitting device!
Note: If you are using the Grove – LR Radio 868MHz module instead, take care to change this portion of code as follows:
//rf95.setFrequency(434.0);
rf95.setFrequency(868.0);
Step 5: Review the results by opening the serial monitor to see P2P LR communication in action!
Summary
That concludes today’s article! LoRaWAN and its network architecture are helping to make progress in numerous applications of large scale, long range IoT. However, P2P LoRa communication is still an extremely useful supplement for different scenarios! Where possible, a combination of both LoRaWAN and P2P LoRa networking will provide you with a flexible arsenal to tackle any real world problems!
If you are keen to learn more about LoRa & LoRaWAN, the following resources may interest you:
- How to Enable LR and LoRaWAN on Arduino and Raspberry Pi
- LoRa & LoRaWAN: Vertical Solutions for the Real World
- Edge AI – What is it and What can it do for Edge IoT?
- What is Industry 4.0? – Technologies of the Fourth Industrial Revolution
Please direct me to a BLINK example program running on the Lora-e5 mini so that I can get started with the Lora-E5.