Iotlabs Exploring Lora Technology
Iotlabs Exploring Lora Technology
As defined by Semtech, LoRa is a wireless technology developed to create the low-power, wide-area
networks (LPWANs) required for machine-to-machine (M2M) and Internet of Things (IoT) applications.
The technology offers a very compelling mix of long range, low power consumption and secure data
transmission and is gaining significant traction in IoT networks being deployed by wireless network
operators.
In this lab, you will implement a prototype of LoRa communication between two wireless devices. This
enables you to get hands-on experience with LoRa, assess the radio performance, and prepare future
advanced prototypes and experimentations.
In order to design and implement experiments with LoRa, you will use the following devices:
Give the characteristics of the Arduino you are using: model, number of pins, type
of pins, memory sizes, etc.
Give the main characteristics of the LoRa shield from Dragino (www.dragino.com).
What type of Antenna are you using? Explain the corresponding characteristics.
Give an estimated cost of your devices.
RadioHead: The Packet Radio library for embedded microprocessors can be downloaded from
https://github.com/samerlahoud/RadioHead.
Arduino IDE: Specific OS versions can be downloaded from
https://www.arduino.cc/en/Main/Software.
Unzip the RadioHead library and copy it to your sketchbook library folder as detailed in
https://www.arduino.cc/en/Guide/Libraries.
wikiroute - http://wiki.lahoud.fr/
Last update: 2021/10/20 12:52 exploring_lora http://wiki.lahoud.fr/doku.php?id=exploring_lora
Make sure to restart your computer after the installation of Arduino IDE and
run the software as administrator.
1.3 Installation
Start by plugging the Dragino shields on the Arduino devices and mounting the antennas as shown in
Fig. 1.
Connect the two Arduino devices to USB ports on your computer. If this is the first time you use
Arduino IDE, make sure to install the necessary USB drivers by selecting Tools > Boards Manager
and installing Arduino AVR boards.
Now, you have to choose the Board type as Arduino/Genuino Mega 2560 or Arduino
Duemilanove or Diecimilia in the Tools menu and select the corresponding serial Port to
start programming your Arduino.
For Arduino Mega 2560, additional drivers for Microsoft Windows can be
installed from http://wch.cn/download/CH341SER_ZIP.html. For Arduino
Duemilanove, additional drivers can be installed from
https://www.ftdichip.com/Drivers/CDM/CDM21228_Setup.zip
2. Theoretical Study
In this section, you will perform a theoretical assessment of the performance of LoRa modulation. You
will later compare this theoretical results to the experimental ones as in a typical scientific study.
What is the relation between processing gain and spreading factor in LoRa
modulation?
How does the spreading factor impact the coverage of a LoRa transmitter?
What is the transmission bit rate for each of the following configurations of your
LoRa device? Explain your computation.
Configuration 1: channel bandwidth = 125 kHz, spreading factor = 7, coding
rate = 4/5
Configuration 2: channel bandwidth = 500 kHz, spreading factor = 7, coding
rate = 4/5
Configuration 3: channel bandwidth = 125 kHz, spreading factor = 12, coding
rate = 1/2
Compute the receiver sensitivity, assuming the following parameters: channel
bandwidth = 125 kHz, spreading factor = 7, coding rate = 4/5, bit error rate (BER)
target = 10-4, and receiver noise figure = 6 dB. Refer to this
article
to determine the mapping between the BER and the SNR.
Compare the computed sensitivity to that provided by the
Semtech Application Note AN1200.22
for the same parameters.
In the remainder of this lab, you will conduct measurements to validate the obtained theoretical
receiver sensitivity.
Download the
basic sketches
that implement a simple LoRa communication between two devices: a client and a server. Open the
sketches with Arduino IDE (it is preferable to run Arduino IDE as administrator). Make sure to choose
the correct Board and Port in the Tools menu.
Take a look at the source code in rf95_client.ino and rf95_server.ino. Particularly, the
following extract from the setup function configures the radio parameters of your LoRa devices:
Central frequency
Spreading Factor
Bandwidth
Coding Rate
Transmit power
rf95.setFrequency(frequency);
// Setup Power,dBm
rf95.setTxPower(13);
wikiroute - http://wiki.lahoud.fr/
Last update: 2021/10/20 12:52 exploring_lora http://wiki.lahoud.fr/doku.php?id=exploring_lora
In order to reduce collisions between simultaneous experiments, configure the central frequency of
your LoRa devices as indicated below:
Now you can compile and upload the client and server sketches on the two arduino devices,
respectively. On the serial interfaces, you should obtain similar results as in Fig. 2 and Fig. 3. The
client sends periodically a short packet towards the server. The server outputs the RSSI (received
power in dBm) for each received packet.
4. Performance Evaluation
In the following, you will design and implement a set of scenarios that enable to evaluate the
performance of the LoRa modulation. As you will deal with scientific assessment, you are required to
use scientific tools to show the results. You have the choice between gnuplot, matplotlib with Python,
and MATLAB. Take some time to become familiar with one of these software as you will be required to
use them in different occasions of your academic programme.
As we are in presence of variable radio conditions, some experiments should be repeated multiple
wikiroute - http://wiki.lahoud.fr/
Last update: 2021/10/20 12:52 exploring_lora http://wiki.lahoud.fr/doku.php?id=exploring_lora
times and results can be shown as probability distributions. Take a look at this excellent repository of
data visualisation tools https://www.data-to-viz.com.
In this section, you will measure the Time on Air (ToA) that is given by the time necessary to transmit
a packet on the radio interface. You will assess the impact of the spreading factor, bandwidth, coding
rate, and packet size on the ToA.
Start by implementing a function on the client that measures the time necessary for sending a
packet. You can have recourse to the micros() function available in the arduino libraries. Now, you can
modify one of the parameters (spreading factor, bandwidth, coding rate, packet size) and record the
impact on the ToA. Note well that you may need to repeat the experiment multiple times in order to
obtain the statistical distribution.
For example, the scenario for assessing the impact of the spreading factor on the ToA consists of
sending 100 packets for three different spreading factors e.g., 7, 9, and 10, and drawing the average
ToA or the distribution in a boxplot for comparing the results.
As for the theoretical computation of the ToA, you can refer to the the following documents :
The Semtech
specification
(section 4.1.1.6)
An explanatory video: https://www.youtube.com/watch?v=C_Rh5GSENA4
Various calculation tools available online: https://www.loratools.nl/#/airtime, Spreadsheet
Note that all messages sent and received by the RH_RF95 RadioHead driver we are using conform to
this packet format:
8 symbol PREAMBLE
Explicit header with header CRC (handled internally by the radio)
4 octets HEADER: (TO, FROM, ID, FLAGS)
0 to 251 octets DATA
CRC (handled internally by the radio)
Describe the scenarios you used for assessing the impact of the different
parameters on the ToA.
Join commented extracts of your code and raw data in attached files.
Visualise the experimental results by plotting the ToA as a function of each one of
the different parameters.
Analyze the obtained results and compare with the theoretical computations. You
can superpose the theoretical results and the experimental ones on the same
graph.
In this section, you will compute the impact of the packet arrival rate on the collision rate and
consequently the Packet Delivery Ratio (PDR).
Let us consider an ALOHA model for the random access in a LoRaWAN network.
What are the advantages of a random access in a wireless IoT context? What are
the shortcomings?
What is the maximum packet generation rate for each spreading factor (SF7 to
SF12)? Explain your answer.
In the following we consider N devices transmitting 50 bytes packets using SF7. The packet
generation rate is assumed to be equal to the maximum possible rate given the duty cycle limitation.
Compute the number of successful transmissions per hour for 50, 100, and 200
devices respectively. Comment the obtained results.
Plot the number of successful transmissions per hour as a function of the number
of devices for SF7 and SF12. Analyse the obtained figure and attach the simulation
code.
Plot the packet delivery ratio as a function of the number of devices for different
SFs. Give the details of your computation and the simulation code.
Plot the number of successful transmissions per hour per device as a function of
the number of generated packets per hour per device for 20 and for 100 devices.
Note well the duty cycle limitation.
5. Coverage Challenge
Start by identifying a set of three geographical locations or Test Points (TP). These TPs should be
astutely chosen to explore the limits of LoRa coverage. Then, you should implement a function on the
server that measures the ratio of successfully delivered packets or PDR (Packet Delivery Ratio). Now,
you should run the experiment for three different radio configurations: such configurations should
provide different reliability levels (high, medium, and low reliability).
wikiroute - http://wiki.lahoud.fr/
Last update: 2021/10/20 12:52 exploring_lora http://wiki.lahoud.fr/doku.php?id=exploring_lora
You are now required to establish a record of LoRa coverage. You can certainly unleash your scientific
imagination, but some rules must be followed to validate the record:
You can use Cloud RF or Radio Mobile online service to obtain information on the elevation, Fresnel
zone radiofresnel, and estimated path loss.
Compute the Fresnel zone for your transmission. Comment the result.
Provide the expression of the link budget and compute the received power using
two different path loss models (ITM, Line of sight) with Cloud RF.
Compare the received power obtained experimentally with the results of the online
simulators.
Prepare a short presentation (5 minutes pitch) to describe your experiment.
6. Grading
Exemplary Accomplished Developing Beginning
Students showed proper Students used Students improperly Students improperly
and justified use of techniques necessary for used some techniques used some techniques
techniques necessary engineering practice necessary for necessary for
Techniques for
for engineering practice without justification engineering practice engineering practice
Engineering
(such as numerical (such as numerical (such as numerical (such as numerical
Practice
methods, stochastic methods, stochastic methods, stochastic methods, stochastic
processes, statistical processes, statistical processes, statistical processes, statistical
analysis, etc.). analysis, etc.). analysis, etc.). analysis, etc.).
Students showed
Students showed skills Students showed limited Students showed no
advanced skills
necessary for skills necessary for skills necessary for
necessary for
Skills for engineering practice of engineering practice engineering practice
engineering practice
Engineering the Labs (such as (such as programming, (such as programming,
(such as programming,
Practice programming, drawing drawing and drawing and
drawing and
and manipulating manipulating manipulating
manipulating
equipment). equipment). equipment).
equipment).
Students showed
Students showed limited Students showed
advanced ability to Students showed no use
use of modern improper use of modern
properly use modern of modern engineering
engineering tools that engineering tools that
Engineering engineering tools that tools that are necessary
are necessary for the are necessary for the
tools are necessary for the for the Labs, such as
Labs, such as simulators, Labs, such as
Labs, such as simulators, software or
software or computer simulators, software or
simulators, software or computer tools.
tools. computer tools.
computer tools.
From:
http://wiki.lahoud.fr/ - wikiroute
Permanent link:
http://wiki.lahoud.fr/doku.php?id=exploring_lora
wikiroute - http://wiki.lahoud.fr/