Tonghao Lorawan
Tonghao Lorawan
Tonghao Lorawan
Abstract—Reliable image transmission using LoRa in IoT hop mechanisms are required for larger deployment areas.
monitoring systems is considered to be challenging due to The range limitations of these personal WSN technologies
insufficient LoRa data rate and payload size. Existing approaches have prompted much interest in low-power wide-area network
transmit an image in a sequence of packets each of which
is individually acknowledged. This approach results in a long (LPWAN) technologies, and in particular LoRa.1 LoRa-based
image transmission time due to the time spent waiting for IoT systems have been used in a variety of agricultural
the many individual acknowledgements. The acknowledgement applications, for example smart irrigation [7], soil moisture
traffic also inflates network load. To facilitate LoRa-based image monitoring [8], rice field management [9], and provision of
transmission in agricultural monitoring IoT systems, this paper intelligent agricultural services [10].
proposes a new reliable delivery protocol, Multi-Packet LoRa
(MPLR), for transmission of large messages, such as images, Application of IoT systems to the monitoring of crop
in LoRa networks. The proposed protocol is implemented and growth has the potential to increase the efficiency of both
evaluated using a LoRa testbed network. crop breeding and production. However, this requires improved
In point-to-point experiments with a single sender/receiver capabilities for collection of image data. For example in the
pair, MPLR reduced image transmission time by an average P2 IRC project,2 researchers are developing crop monitoring
of 24% in scenarios with no packet loss, and by averages of
30%, 42%, and 49% in scenarios with 2%, 5%, and 10% loss and data analysis tools to assist crop breeders. A current focus
rate, respectively. When multiple LoRa nodes send images to in this project concerns collection/analysis of images from
a single gateway, high channel utilization and an unacceptable field test plots. This has motivated our investigation of the
collision probability can be experienced with the standard LoRa possible use of LoRa for image collection.
MAC ALOHA protocol. In experiments with between 5 and 20
nodes, MPLR in conjunction with a channel reservation protocol
Image transmission using LoRa is challenging. Due to the
can successfully send more images and reduce the maximum limited data rate and payload size, LoRa takes at least 498
successful image transmission time between 2 and 7 times, seconds to transmit a 1 MB image, using its peak physical
compared to stop-and-wait packet transmission with ALOHA. layer data rate. This incurs a high energy cost, as well as
high network load that could result in a high collision rate
Index Terms—LoRa, Wireless Sensor Network, Internet of
using the standard LoRa MAC ALOHA protocol. Furthermore,
Things, reliable transport, agricultural IoT systems
in some jurisdictions, such as in Europe, there are frequency
band duty cycle limits that must be considered [11]. (In other
I. I NTRODUCTION
jurisdictions, such as in Canada and the US, other restrictions
The Internet of Things (IoT) has been explored as an apply to the frequency band used for LoRa but these do not
effective technology for improving agricultural production prevent long-duration or frequent transmissions [11] [12].)
management and maintenance [1] [2]. By deploying small Pham proposed a carrier sense medium access (CSMA)
battery-powered devices with sensors in agricultural fields, protocol adapted to LoRa networks to avoid packet collisions
data such as temperature, moisture, and soil nutrient levels for image data and transmitted small images through LoRa
can be periodically collected. Each sensed data value can [13]. Jebril et al. demonstrated the concept of point-to-point
then be sent back to a gateway and eventually uploaded to image transmission using LoRa at a variety of locations and
a server for users to access. Such systems have also greatly showed that image transmission can be done with delivery
lowered the cost of agricultural management and reduced times varying between 1 and 14 minutes depending on the
human intervention [3]. spreading factor [14]. To the best of our knowledge, no
The use of wired networks on remote agricultural land is research has attempted to improve LoRa-based image trans-
typically not feasible, due to the lack of reliable network and mission by replacing the standard LoRa stop-and-wait reliable
power infrastructure. Personal wireless sensor network (WSN) delivery protocol with a protocol tailored for large messages.
technologies such as 6LoWPAN [2] and ZigBee [1] [4] [5]
have been used in agricultural IoT applications, but these have 1 https://www.semtech.com/lora
between the LoRa node and the gateway. The node first sends
a SYN packet to request connection establishment with the
gateway on the control channel. If the request packet is not
received by the gateway, the node will sleep for a random time
Fig. 3: Connection management: sender/receiver before its next connection attempt. When the gateway receives
the request packet, it assigns a data channel and indicates
it in the acknowledgement packet. After the gateway replies,
(rate of correctly received packets). With MPLR, only request
it will immediately switch to the assigned data channel and
packets from other nodes could possibly interfere with the
wait for the confirmation from the node. The node will also
data transmission of a node that has established a connection
switch to the assigned data channel after receiving the SYN-
with the gateway, assuming that the gateway does not accept
ACK correctly and send an ACK as well.
multiple concurrent connections on the same channel. It is,
however, possible to eliminate even these collisions by using
a data channel distinct from the control channel.
We therefore design and implement a data channel reser-
vation protocol. Our current gateway only supports listening
on a single channel at once, and so our protocol need not
support multiple active data channels. However, our approach
is easily generalized for scenarios in which the gateway
hardware supports concurrent use of multiple channels. Such
a generalization is potential future work. As shown in Figure
4, an idle gateway continuously listens for request packets
on the control channel. When the gateway receives a request
packet, it pseudo-randomly selects a channel to use as the data
channel and informs the requesting node of its choice.3 Then
both gateway and node will switch from the control channel to Fig. 5: Data channel reservation: node and gateway
the target data channel and perform the transmission described
in the previous section. When the transmission is complete, To ensure that the node does not begin transmission before
the gateway will return to the control channel and wait for the gateway is ready to begin receiving on the data channel,
a new request. Note that any new requests that are made on the gateway will send a READY packet to indicate that it
the control channel while the gateway is listening to the data is prepared to start receiving data. After the node receives
channel will not be received and will not interfere with the the READY packet, it can begin the data transmission. The
data channel communication. Other devices will not send any whole process is a 4-way handshake connection, but using
packets on any channel other than the control channel until two different channels.
the gateway answers their request. IV. E XPERIMENTAL M ETHODOLOGY
The data channel selection is not made in an entirely random
fashion, since the gateway will avoid choosing channels on In this section, the image compression approach is de-
which a high loss rate has been experienced. When a particular scribed, and the hardware devices and device settings used in
channel is in use as the data channel, the gateway monitors the experiments are introduced. In addition, the experimental
the packet loss rate on that channel. Such an approach can plan and topology are discussed.
avoid the use of channels that may be used by other devices A. Image Compression
in the receiver range or have other reliability issues.
Figure 5 shows an example of data channel reservation Images can provide specific information for breeders and
producers, such as flowering time and flower density. They
3 In scenarios where frequency hopping is employed, the ”data channel” in can also provide the physical status of the remote IoT system,
our description here would actually correspond to a sequence of channels. such as camera/sensor positioning, or physical impediments
that affect image capture, like weather conditions or wildlife
interference. This can be useful for directing system opera-
tion. For example, a rainstorm may change the desired data
collection parameters for a period of minutes/hours; a human
operator or automated adaptation system could change the
frequency of image capture or soil moisture reading.
In many such use cases, images can be greatly compressed
without impacting their usefulness. In our experiments we
use images from a field-deployed camera that generates a (a) Quality: 95, Size: 113 KB (b) Quality: 50, Size: 28 KB
3280x2464 full-resolution image of 5.8 MB. We use Pillow,4 a
Python imaging library, to resize the image to 480x320 pixels,
as might be sufficient for a monitoring application, and to
apply JPEG compression. An image quality parameter can be
passed to the compression algorithm to indicate the degree of
compression, which is on a scale from 1 (most compression) to
95 (least compression). This parameter can be tuned depending
on application requirements.
To illustrate the impact of different settings for the image
quality parameter, Figure 6 shows results from applying com- (c) Quality: 25, Size: 18 KB (d) Quality: 10, Size: 9 KB
pression to a resized 480x320 pixel image from a canola field. Fig. 6: Image quality and size comparison
Each subfigure only shows a 160x120 portion from the centre
of the image to allow easier visual comparison. The caption TABLE II: LoRa configuration
for each subfigure gives the corresponding value for the image Name Value
quality parameter as well as the resulting size of the image in Spreading Factor 7, 8, 9, 10, 11
kilobytes. With quality 50 and 25, there is little loss in quality, Bandwidth 500, 250, and 125 kHz
and the size is reduced to 28 KB and 18 KB, respectively. Coding Rate 4/5
Implicit Header Mode false
Significant image distortion is noticeable when the image Preamble 8
quality is 10, but this quality may be acceptable in some Output Power 15 dBm
applications. Thus, by using JPEG compression, a 480x320
resized image compressed to 113 KB (highest quality) can be
converted into an image of only 28 KB, 18 KB, or 9 KB, with D. Deployment and Experimental Parameters
quality parameter settings of 50, 25, and 10, respectively, with We conducted two types of experiments to evaluate image
only small to moderate loss of quality. transmission in LoRa, namely point-to-point experiments with
just a single sender and receiver, and experiments using a star
B. Devices
topology. In all experiments, the maximum MPLR batch size
Our agricultural monitoring IoT system uses the Raspberry was chosen as 40 packets.
Pi (RPI) to sense field data and control the camera. We use the 1) Point-to-point Transmission: We placed two LoRa de-
Dragino LoRa hat5 designed for RPI. This LoRa module is an vices at a fixed distance in the lab, using different combina-
SX1276 chip-based transceiver6 and the data communication tions of spreading factor and bandwidth to evaluate the feasi-
is done through the serial peripheral interface. As mentioned bility and compare the performance of the image transmission
in the previous section, this transceiver is only capable of of MPLR and stop-and-wait transmission. The first set of
listening on one channel at a time. The only difference between point-to-point experiments was performed with no packet loss.
gateway and node in our scenario is that the gateway has an The next set of experiments introduced artificial packet loss of
Ethernet connection. The field-deployed camera used is the 2% to 10%. In actual IoT system deployments, packet loss may
Brinno TLC200 Pro. be caused by noise from the environment and transmissions
C. LoRa Configuration from other devices using the same frequency ranges. We tested
all combinations of spreading factor and bandwidth, except
The LoRa parameter settings used in our experiments are for the three lowest data rate combinations, and repeated each
listed in Table II. The output power is set to 15 dBm in all our measurement 5 times.
experiments, and the performance through a range of power 2) Transmission in a Star Network: We conducted 4 trials
levels will be examined in future studies. To implement the of 125 minutes each, for image transmission using MPLR
stop-and-wait protocol, we add packet headers and enforce in conjunction with our data channel reservation protocol,
acknowledgements in LoRa’s physical layer communication. and image transmission using stop-and-wait in conjunction
4 https://pillow.readthedocs.io/en/stable/ with ALOHA. For each trial, a LoRa gateway is placed in
5 http://www.dragino.com/products/lora/item/106-lora-gps-hat.html the corner of a 200x300 metre test area to receive data and
6 https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1276 we placed 5, 10, 15 and 20 LoRa nodes randomly in the
test area. All devices used a spreading factor of 8 and a with a maximum of 56% and minimum of 8.8%. This reduc-
bandwidth of 250 kHz. In each trial, each node generated tion in transmission time allows for more spreading factor and
an image transmission task every 5 minutes. If an image bandwidth options when using MPLR, while maintaining an
transmission had not completed before a new task at that node economical operation time and power consumption.
was generated, the new task was queued. Image transmission When packet loss is introduced, both protocols degrade, but
statistics were obtained from the device log. The reception of in different manners. We repeated the point-to-point transmis-
packets at the gateway was stopped after 125 minutes, even if sion experiments by adding different artificial packet loss rates
there were image transmission tasks queued at nodes. Due to to evaluate the change in the transmission time of the 9 KB
the length of the test, we did not perform multiple replications, image for both protocols. Experiments were run with packet
but consider the transmission of 25 images (125 / 5) per node loss rates of 2%, 5%, and 10%. Table IV gives the transmission
sufficient to ensure measurement reliability. times averaged over 5 measurements for each protocol and
parameter setting. Using MPLR, transmission time increases
E. Performance Metrics
by a percentage only a little greater than the packet loss
For the point-to-point experiments, the performance metric percentage, since packet losses indicated in each BVACK do
we consider is the average image transmission time. For the not require a timeout for detection, and since packet loss rarely
experiments using a star topology, we examine the distribu- increases the number of batches used to transmit an image
tion of the image transmission time, the number of packet (just the size of the last batch). A significant increment is
collisions, the number of successfully transmitted images, and observed when using stop-and-wait, as each packet loss leads
inter-node fairness. to a timeout and retransmission. The reductions in transmission
V. E VALUATION time when using MPLR, averaged over all bandwidth and
spreading factor settings, were 30%, 42%, and 49%, for packet
A. Point-to-point Transmission
loss rates of 2%, 5%, and 10%, respectively.
We first ran point-to-point experiments with no packet loss
and the average transmission times are reported in Table III. TABLE IV: Transmit times (secs) packet loss (9 KB image)
To allow easier visual comparison of these results as well as (a) MPLR: 2% Loss (b) Stop-and-wait: 2% loss
the results in Table IV, table entries with average transmission BW 500 BW 250 BW 125 BW 500 BW 250 BW 125
SF7 5.09 9.95 19.66 SF7 11.00 16.35 28.13
times between 40 and 60 seconds are shown with light grey SF8 8.82 17.39 34.53 SF8 16.14 24.49 44.50
shading, and those with times exceeding 60 seconds are shown SF9 16.09 31.04 61.84 SF9 23.85 39.98 79.73
SF10 28.01 55.78 SF10 36.55 67.56
with dark grey shading. SF11 50.78 SF11 63.54
5, 10, 15, and 20 nodes, respectively. Note that the image from 125 minutes, due to congestion and corresponding packet
the first node to successfully reserve the data channel is always loss; the gateway receives all images in the network using
delivered after about 17 seconds, with transmissions from MPLR+channel reservation.
other competing nodes then being delayed. When using stop- Similarly, when the number of nodes in the network is
and-wait+ALOHA, the average transmission time increases increased to 15 and 20, when using MPLR+channel reser-
greatly when the number of nodes in the network grows, due vation the gateway receives 334 and 353 images, respectively,
to collisions among data packets. Even if only 5 nodes are in while with stop-and-wait+ALOHA the number of delivered
the network, using stop-and-wait+ALOHA requires an average images remains at approximately 120. With MPLR+channel
of 132 seconds to send an image, about 2 times longer than reservation, the network reaches a plateau more gradually
MPLR+channel reservation. than with stop-and-wait+ALOHA. Although this transmission
In the case of 5 nodes, the transmission time for the last frequency is much higher than the anticipated frequency of
image to be successfully received at the gateway was about demand in actual projects, it allows us to determine the
133 seconds when using MPLR+channel reservation, but was capacity when using MPLR+channel reservation.
about 250 seconds with stop-and-wait+ALOHA. Scaling up to
the 20 node scenario, the last image to be successfully received
when using MPLR+channel reservation, within the 125 minute
experiment duration, had a transmission time of about 35
minutes (since in this scenario there is substantial queueing of
the transmission tasks), while the last image to be successfully
received when using stop-and-wait+ALOHA had a transmis-
sion time of about 74 minutes. With 10 nodes, stop-and-
wait+ALOHA was over 7 times slower than MPLR+channel
reservation (1850 vs. 250 seconds).
Figure 8 shows a comparison of the average number of
packet collisions during a single image transmission. As
the number of nodes in the network increases, the number
of packet collisions increases with both methods. However,
MPLR+channel reservation produced fewer packet collisions
under the same number of LoRa nodes.
Figure 9 depicts the number of images received by the LoRa Fig. 9: Successful image transmissions
gateway for each network size. Since an image transmission
task is generated at each node every 5 minutes in these The image delivery fairness performance difference be-
experiments, the gateway should receive in total 125, 250, tween MPLR+channel reservation and stop-and-wait+ALOHA
375, and 500 images, respectively. When there are only 5 is presented in Figure 10. As the number of nodes increases
nodes in the network, the gateway always receives 125 images. beyond 5, they are differentially affected by the added traffic
When the number of LoRa nodes in the network is increased and potential congestion. With stop-and-wait+ALOHA and 20
to 10, only 114 images are successfully received using stop- nodes, one node is limited to one successful image trans-
and-wait+ALOHA, prior to the experiment termination after mission. This is 25% of the median for this configuration,
indicating there are other factors that influence which nodes study is to apply the multi-packet LoRa protocol to a multi-
suffer most from collision. hop LoRa network. Although LoRa has a long transmission
Under MPLR+channel reservation, the distribution of the distance, its signal is easily blocked by obstacles and uneven
number of images successfully delivered for each node is topography that is likely in a general deployment environment.
considerably more condensed. 50% of the nodes are no more Multi-hop transmission can solve the issue of signal blocking
than 2 images off from the median with 20 nodes and the and further extend the range of the LoRa network.
range is even tighter for 15 nodes. The most extreme outlier R EFERENCES
for the 20-node scenario can still deliver 13 images (72% of
[1] J. Li and Y. Zhang, “Design and accomplishment of the real-time
the median). tracking system of agricultural products logistics process,” in 2010
International Conference on E-Product E-Service and E-Entertainment,
Henan, China, Nov 2010, pp. 1–4.
[2] Z. Suryady, M.H.M. Shaharil, K.A. Bakar, R. Khoshdelniat, G.R.
Sinniah, and U. Sarwar, “Performance evaluation of 6LoWPAN-based
precision agriculture,” in ICOIN 2011, Barcelona, Spain, Jan. 2011, pp.
171–176.
[3] Y. Gu and T. Jing, “The IoT research in supply chain management of
fresh agricultural products,” in AIMSEC 2011, Dengleng, China, Aug
2011, pp. 7382–7385.
[4] G. Sahitya, N. Balaji, C. D. Naidu, and S. Abinaya, “Designing a
wireless sensor network for precision agriculture using ZigBee,” in
2017 IEEE 7th International Advance Computing Conference (IACC),
Hyderabad, India, Jan. 2017, pp. 287–291.
[5] K. V. de Oliveira, H.M. Esgalha Castelli, S.J. Montebeller, and T.G.
Prado Avancini, “Wireless sensor network for smart agriculture using
ZigBee protocol,” in 2017 IEEE First Summer School on Smart Cities
(S3C), Natal, Brazil, Aug. 2017, pp. 61–66.
[6] I. Howitt and J. A. Gutierrez, “IEEE 802.15.4 low rate - wireless
personal area network coexistence issues,” in IEEE Wireless Communi-
cations and Networking, New Orleans, LA, Mar. 2003, pp. 1481–1486.
[7] W. Zhao, S. Lin, J. Han, R. Xu, and L. Hou, “Design and implementation
Fig. 10: Inter-node fairness of smart irrigation system based on LoRa,” in 2017 IEEE Globecom
Workshops (GC Wkshps), Singapore, Singapore, Dec. 2017, pp. 1–6.
[8] J. O. Payero, A. M. Nafchi, R. Davis, and A. Khalilian, “An Arduino-
based wireless sensor network for soil moisture monitoring using
VI. C ONCLUSION AND F UTURE W ORK Decagon EC-5 sensors,” Open Journal of Soil Science, vol. 07, no.
In this paper, we proposed a lightweight reliable delivery 10, pp. 288–300, 2017.
[9] T. Hirata, K. Terada, M. Toyota, Y. Takada, K. Matsumoto, and M. S.
protocol called MPLR for image transmission in LoRa to en- Tanaka, “Proposal of a power saving network for rice fields using LoRa,”
able remote image monitoring in our agricultural IoT system. in GCCE 2017, Nagoya, Japan, Oct. 2017, pp. 1–4.
MPLR batches data packet transmissions and uses bit-vector [10] Y. Ma and J. Chen, “Toward intelligent agriculture service platform with
LoRa-based wireless sensor network,” in IEEE ICASI, Chiba, Japan,
acknowledgements so as to greatly reduce the number of Apr. 2018, pp. 204–207.
required acknowledgement packets and the time spent waiting [11] D. Castells-Rufas, A. Galin-Pons, and J. Carrabina, “The regulation
for them. To avoid packet collision caused by congestion, data of unlicensed sub-GHz bands: Are stronger restrictions required for
LPWAN-based IoT success?,” CoRR, vol. abs/1812.00031, 2018.
channel reservation is used so that the request packet and data [12] Innovation, Science and Economic Development Canada, “Digital
packet can be transmitted on different channels to ensure the Transmission Systems (DTSs), Frequency Hopping Systems (FHSs) and
sustained successful data transmission rate. Licence-Exempt Local Area Network (LE-LAN) Devices,” 2017.
[13] C. Pham, “Robust CSMA for long-range LoRa transmissions with image
The results show that using MPLR for image transmission sensing devices,” in 2018 Wireless Days (WD), Dubai, United Arab
in point-to-point communication can reduce the time by an Emirates, Apr. 2018, pp. 116–122.
[14] A.H. Jebril, A. Sali, A. Ismail, and M.F.A. Rasid, “Overcoming
average of 24%. When packet loss was introduced, the average limitations of LoRa physical layer in image transmission,” Sensors
transmission time is at least 30% improved over stop-and-wait (Basel), vol. 18, no. 10, 3257, pp. 1–22, Sept. 2018.
and as much as 49% improvement is experienced (for 10% [15] M. Centenaro, L. Vangelista, A. Zanella, and M. Zorzi, “Long-range
communications in unlicensed bands: the rising stars in the IoT and
packet loss). In the star network experiments, a shorter aver- smart city scenarios,” IEEE Wireless Communications, vol. 23, no. 5,
age transmission time was experienced with MPLR+channel pp. 60–67, Oct. 2016.
reservation, and there is no increase in delivery time of the [16] P. S. Cheong, J. Bergs, C. Hawinkel, and J. Famaey, “Comparison
of LoRaWAN classes and their power consumption,” in 2017 IEEE
first image with increased network density. Compared with Symposium on Communications and Vehicular Technology (SCVT),
stop-and-wait+ALOHA method, MPLR+channel reservation Leuven, Belgium, Nov. 2017, pp. 1–6.
achieves a higher fairness among the participating nodes. [17] A. Augustin, J. Yi, T. Clausen, and W.M. Townsley, “A study of LoRa:
Long range & low power networks for the Internet of Things,” Sensors
For future work, we plan to test MPLR+channel reservation (Basel), vol. 16, no. 9, 1466, pp. 1–22, Sept. 2016.
in a broader area to further evaluate its performance. In [18] M. R. Seye, B. Gueye, and M. Diallo, “An evaluation of LoRa coverage
deployments over large areas, error rates can be expected to be in Dakar Peninsula,” in IEEE IEMCON, Vancouver, Canada, Oct. 2017,
pp. 478–482.
significant. Experiments in such settings can provide additional [19] M. R. Seye, M. Diallo, B. Gueye, and C. Cambier, “COWShED:
insight into the impact of LoRa parameter values and the value Communication within white spots for breeders,” in IEEE ICIN, Paris,
for the maximum MPLR batch size. Also, another ongoing France, Feb. 2019, pp. 1–4.