Lontar - Template LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 140 Performance Analysis of Point-to-Point LoRa End Device Communication Yosefine Triwidyastuti Program Studi Teknik Komputer, Fakultas Teknologi dan Informatika, Universitas Dinamika Raya Kedung Baruk 98 Surabaya, Indonesia yosefine@dinamika.ac.id Abstract LoRa is an emerging communication technology that can be used in any field. Many types of research have analyzed LoRa network using a gateway and several end devices to many monitoring applications. However, the communication performance between LoRa end devices only has not been evaluated. This research tested a LoRa communication between two end devices in a point-to-point topology. From the experiment results with various payload lengths, the optimum payload is only 48 bytes with the default module configuration. Longer payload resulted in a decreased performance. Thus, this research implemented a waiting protocol that can increase the Packet Reception Ratio of 100-byte payload from 49.87% to 97.52%. Keywords: LoRa End Device, Internet of Things, point-to-point communication, payload length, waiting protocol 1. Introduction LoRa is a new long-range communication technology in the field of the Internet of Things (IoT), among Radio Frequency Identification (RFID) [1] and WIFi [2-3]. LoRa allows users to transmit data to a long-distance node with the compensation of a low data rate. Its specification describes that LoRa can transmit data with a maximum data rate of 37.5 kbps [4]. The configuration of LoRa’s parameters such as spreading factor (SF), bandwidth (BW) and Code Rate (CR) determines the data rate (Rb) and coverage range. A higher spreading factor yields a longer range and slower data rate [5]. The relation between these parameters and the data rate is shown in (1). CR BW SFR SFb  2 (1) Because of the long-range specification for up to 10 km, LoRa is widely used in many monitoring applications. The module is designed in small size and it consumes low power, so it can be used in moderate mobility. Many types of research implement this LoRa technology in smart cities, such as for health [6-7], monitoring [8-10] or metering [11-12]. Normally, LoRa network consists of end devices, gateways, and a network server as shown in Figure 1. End devices send data to a network server through gateways [2,5,10,13-14]. End devices perform the physical layer process and gateways act as repeaters that can collect all data from different end devices. End devices and gateways are connected through wireless links with LoRa modulation, whereas gateways and network servers are usually connected through a wired link or 3G/4G link. The access, flow, and network control is provided by gateways and server. In the market, the price of LoRa gateway is expensive, which is around 3.5 million rupiahs, while LoRa end device only costs 150 thousand rupiahs [15]. Thus, we test a LoRa network that only consists of end devices without any gateway or server. With the elimination of gateways, the installation cost could be highly reduced. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 141 Figure 1. Typical LoRa Network This paper analyzes the performance of LoRa end-device communication with various payload lengths. Many researches had analyzed the LoRa performance between the end device and gateway [5,13-14,16]. Nonetheless, the performance of LoRa communication between end devices has never been analyzed. Due to the gateway elimination, the link budget between the transmitter and receiver would be different. The communication improvement in this research is the implementation of waiting time to compensate for the gateway absence in LoRa end device communication. The waiting time in this flow control procedure can maintain the communication performance because the protocol controls the data flow in the transmitter node according to the receiver process without excessive delay. The state of the art of this study is the performance analysis of communication using LoRa end devices only without any gateway. The experiments measured the Packet Reception Ratio (PRR) in various distances and payload lengths. This preliminary study provides the basis to explore LoRa more deeply. A self-designed waiting protocol in LoRa end devices is also implemented to enhance LoRa end device communication. The next sections in this paper are organized as follows. Section 2 describes the methods applied in this paper. Section 3 discusses the results obtained from various experiments. Section 4 concludes the paper. 2. Research Methods This research used LoRa end devices from HopeRF-RFM9x LoRa Module which transmits at a frequency of 915 MHz. The module is the closest frequency module to the Radio Frequency band of the Non-cellular Low Power Wide Area in Indonesia that is from 920 MHz to 923 MHz [17]. The test experiments were located in an indoor environment using a default helical antenna and without a gateway, so the distance range only covers inside the campus building (lower than 100 meters). The end device module has 14 pins that can be connected to a microcontroller. In this research, each end device is connected to an Arduino Nano as shown in Figure 2. The DIO (Digital Input/Output) pins in LoRa module such as DIO 0, DIO 1 and reset were connected to D2, D3 and D5 pin of Arduino Nano respectively. Meanwhile, the NSS (Number Slave Select), MOSI (Master Out Slave In), MISO (Master In Slave Out) and SCK (Serial Peripheral Interface Clock) pins were connected to D10, D11, D12 and D13 pin in Arduino Nano respectively. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 142 Figure 2. Arduino Nano and LoRa End Device Connection Figure 3. Block Diagram of Point-to-Point Communication This research used a point-to-point communication, in which one transmitter node sent data to a receiver node. The block diagram of the research is shown in Figure 3. The packet transmission was controlled by Arduino Nano and the packets were sent and received by LoRa end device modules. The experiments were conducted in several conditions in the indoor environment to analyze the wireless communication performance of LoRa end device. The flowchart of the LoRa simple protocol is shown in Figure 4. The transmitter node sends packets with fixed length and combined with the packet’s recorded time. Figure 4a shows the transmission process that is conducted repeatedly until the node power is off. First, the transmitter forms a fixed-length packet and then records its time. It combines the recorded time at the end of the packet string. Then it initiates a packet beginning process, and prints the packet string into the LoRa end device module. After the transmitter finishes printing the packet, it ends the LoRa packet. This transmission procedure then returns to the packet forming process. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 143 (a) (b) Figure 4. Flowchart of LoRa Simple One Way Communication Protocol; (a) Transmitter Node; (b) Receiver Node Figure 4b shows the reception process. First, the microcontroller activates the LoRa begin process and then detects the received packets. If there is a received packet, the microcontroller initiates the reading process for all bytes in the received packet. If there is no received packet, the microcontroller continues the packet detection process again. This packet reception process is also conducted repeatedly until the receiver power is off. To compensate for the gateway elimination, this research implemented a waiting time to control the data flow. The flowchart of the transmitter waiting protocol is shown in Figure 5. After the transmitter node sends one packet, it initiates the timer to 2000 milliseconds and counts the timer down while checking for a received packet. If the transmitter has received a packet under 2000 milliseconds, then the transmitter continues directly to send the next packet, without waiting for the timer to end. If until the waiting time runs out, the transmitter continues to send the next packet and considers the previous packet is lost. This waiting protocol can maintain the reception process in the receiver node because the transmitter will not send the next packet until it receives the feedback from the receiver or the timer runs out. The waiting protocol is different from the previous simple one-way communication protocol. In the simple one way communication, the transmitter never waits for feedback from the receiver and it continues sending packets after finishing sending the previous packet. It does not take into consideration whether the receiver has received the packet or not. The waiting time between each packet in the waiting protocol can be different. It depends on the process in the receiver node and the packet’s round trip. When there is no loss in the wireless environment, the waiting time could reach a minimum value. However, when there is a packet loss, the waiting time will reach its maximum value, which is 2000 milliseconds. This flexible waiting time is the major advantage of the waiting protocol. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 144 Figure 5. Flowchart of Waiting Protocol in Transmitter Node The flowchart of the receiver node is shown in Figure 6. The waiting protocol requires the receiver to send a feedback packet directly right after it finishes receiving a packet. The feedback packet is built from the received packet combined with the recorded time. This feedback packet is used by the transmitter as a requirement before it sends another packet. The reception and transmission process in each transmitter and receiver node confirms a two- way communication between LoRa end devices. Thus, a wireless communication network could be built with LoRa end devices solely, because each LoRa end device can send and receive a packet. 3. Results and Discussions 3.1. The Performance of Simple One-Way Communication In this first experiment, the LoRa end-device performance is evaluated using a simple one-way communication protocol. The experiments were conducted several times for three minutes each using different packet lengths. The communication performance was analyzed especially by its PRR, which is calculated from the ratio of the number of received packets and the number of sent packets. The result of this simple one-way communication is shown in Table 1. The experiment also recorded the average Received Signal Strength Indicator (RSSI), Signal-to- Noise Ratio (SNR), and Time-on-Air (ToA) of the received packets in the receiver node. ToA indicates the duration time that is required for a packet to be transferred from the transmitter to the receiver. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 145 Figure 6. Flowchart of Waiting Protocol in Receiver Node Table 1. Performance of Simple One-Way Communication From the experiments, the average RSSI and SNR are similar for different payload lengths. The SNR value in one room environment stays roughly the same. However, the node distance Node Distance Payload Packet Number PRR (%) RSSI (dBm) SNR ToA (ms) 3 meters 10 bytes 4287 99.84 -42.34 9.63 49.24 3 meters 20 bytes 2868 99.79 -42.20 10.09 67.23 3 meters 45 bytes 2022 99.85 -42.04 9.74 91.13 3 meters 46 bytes 1912 99.90 -43.65 9.47 96.66 3 meters 47 bytes 1912 99.79 -43.86 10.01 97.28 3 meters 48 bytes 1912 98.12 -42.39 9.49 97.30 3 meters 49 bytes 1911 72.42 -42.85 9.49 97.76 3 meters 50 bytes 1812 51.38 -42.78 9.84 103.21 3 meters 51 bytes 1812 50.11 -43.96 9.68 103.29 3 meters 52 bytes 1812 49.89 -42.48 9.79 103.80 6 meters 10 bytes 4286 99.88 -55.49 9.48 49.88 6 meters 20 bytes 2870 99.90 -53.13 9.94 67.42 6 meters 45 bytes 2023 99.60 -53.29 9.54 91.87 6 meters 46 bytes 1912 99.63 -54.26 9.44 97.16 6 meters 47 bytes 1913 99.48 -52.83 9.72 97.29 6 meters 48 bytes 1913 98.69 -54.34 9.51 97.67 6 meters 49 bytes 1911 68.18 -54.52 9.65 97.80 6 meters 50 bytes 1813 51.57 -54.56 9.73 103.00 6 meters 51 bytes 1812 49.83 -52.90 9.52 103.67 6 meters 52 bytes 1811 49.42 -53.54 9.77 104.13 LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 146 affects the RSSI value. The RSSI value is around -42 dBm for three-meter node distance, while the six-meter node distance decreases the RSSI value until around -54 dBm. The different payload length has effects on the number of the sent packet and the transmission time. Longer payload resulted in fewer packet numbers that can be transmitted and the longer Time-on-Air. The minimum ToA is 49.24 ms to transmit a 10-byte packet with a 3-meter distance range. From the experiment results, a unique pattern is shown in the PRR performance. For packets having a payload length less than or equal to 48 bytes, the PRR value is above 98%. On the other side, for the packets having the payload more than 48 bytes, the PRR is decreased by half. The degraded condition of longer payload is caused by the First In First Out (FIFO) size that is fixed to 64 bytes [4]. Thus, the LoRa end device could not receive longer packets in continuous time. It needs extra time to wait for the shift register reads all bytes and store long packet string in the buffer. The optimum payload length is 48 bytes according to the optimum PRR value that can be achieved. This condition is due to the long preamble and header that is always added on each packet. Every LoRa packet comprises three elements, which are a preamble, header, and the data payload. By analyzing the PRR value for various payload lengths, the optimum data rate (Rb) can be evaluated from (2). N is the number of packets that can be transmitted, PL is the payload length and t is the time duration, which is three minutes or 180 seconds. t PLN R b 8  (2) With the optimum payload length of 48 bytes, the achieved data rate is around 4 kbps. This experimental result provides the maximum payload length that should be noticed in planning IoT applications using only default LoRa end devices, while other researches only provide the communication performance between LoRa gateway and LoRa end devices [5,13]. 3.2. The Performance of Waiting Protocol In the second experiment, the waiting time was implemented in several conditions. The experiments were conducted in different rooms on the same floor of the campus building. The sketch of the experiment location is depicted in Figure 7. The distance of rooms ranges between 20 meters to 60 meters. Between Room 1 and Room 5, there are a student room, elevators, and stairs that make significant obstacles for wireless communication. Figure 7. Floor Plan for the Experiments LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 147 The results of the indoor experiments are shown in Table 2. In these experiments, the average value of PRR and ToA was calculated to analyze the LoRa end-device performance. Each experiment was conducted for three minutes. Various payload lengths from 10 bytes to 100 bytes were also analyzed for each experiment location, so a comparison can be obtained for the communication performance of the waiting protocol. Table 2. Performance of Waiting Protocol Figure 8. PRR Comparison Using Waiting Protocol From the experiments, the longer payload resulted in a long time to travel back and forth. To transmit a 10-byte packet, LoRa needs approximately 99 ms. Meanwhile, to send a tenfold packet length, LoRa needs around 730 ms. This trend is similar for different node locations. A good and stable performance of waiting protocol can be shown in the high and constant PRR value. The implementation of the waiting protocol could increase the PRR value significantly until above 97% for the maximum distance of 45 meters. However, when the transmitter and receiver are separated by about 60 meters, the LoRa end device could not maintain good PRR. Thus, the distance of over 45 meters is not recommended for LoRa indoor communication. Node Location Distance Payload PRR (%) ToA (ms) From R2 to R1 13 meters 10 bytes 99.72 98.82 From R2 to R1 13 meters 20 bytes 98.97 164.34 From R2 to R1 13 meters 40 bytes 99.30 307.91 From R2 to R1 13 meters 100 bytes 99.59 727.83 From R3 to R1 21 meters 10 bytes 99.83 98.85 From R3 to R1 21 meters 20 bytes 99.08 164.00 From R3 to R1 21 meters 40 bytes 99.12 307.92 From R3 to R1 21 meters 100 bytes 99.17 729.44 From R5 to R1 30 meters 10 bytes 99.67 98.95 From R5 to R1 30 meters 20 bytes 98.87 165.23 From R5 to R1 30 meters 40 bytes 98.74 308.61 From R5 to R1 30 meters 100 bytes 97.52 729.23 From R4 to R5 45 meters 10 bytes 99.06 99.00 From R4 to R5 45 meters 20 bytes 99.61 165.98 From R4 to R5 45 meters 40 bytes 97.70 307.96 From R4 to R5 45 meters 100 bytes 98.33 729.38 From R4 to R6 60 meters 10 bytes 74.61 99.15 From R4 to R6 60 meters 20 bytes 64.99 166.35 From R4 to R6 60 meters 40 bytes 50.00 308.03 From R4 to R6 60 meters 100 bytes 35.15 731.31 LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 148 The PRR comparison between the simple one-way communication and the waiting protocol implementation is shown in Figure 8. For this comparison experiment, the transmitter node was placed in Room 5 and the receiver was in Room 1. A significant difference is found in the experiment using 100-byte packets. The PRR value of the simple one-way communication is only 49.87%, while the PRR value using the waiting protocol can achieve 97.52%. This paper demonstrates that a simple waiting protocol could increase the PRR value for long packets, while other researches only provide communication performance for 20-byte and 40-byte packets [13]. The significant improvement with the waiting protocol is due to the implementation of more idle time to wait for the receiver node to finish saving the long packet into its 64-byte FIFO. 4. Conclusion This research has conducted several experiments to analyze the point-to-point communication performance using LoRa end device modules. In the simple one-way communication, the optimum payload length is 48 bytes to obtain PRR above 98%. The waiting protocol can compensate for the reception of a longer packet by implementing an idle time to wait for the receiver to finish reading all packet data. The waiting protocol can increase the PRR value for a 100-byte packet from 49.87% to 97.52%. This research has found that the maximum indoor distance with obstacles is 45 meters to achieve PRR above 97%. However, this maximum distance is only applied for point-to-point communication. A multipoint communication over LoRa end devices should be more explored to maximize the LoRa technology for IoT. Acknowledgment The author would like to thank the Ministry of Research, Technology and Higher Education for the research grant based on contract number 113 / SP2H / LT / DRPM / 2019. The author would also like to thank Musayyanah for the help and support in conducting the experiments. References [1] Dewa Agung Krishna Arimbawa P., I Ketut Gede Darma Putra and I Made Sukarsa, “Library System Using Radio Frequency Identification (RFID) and Telegram Bot API” Lontar Komputer, vol. 9, no. 1, pp. 40-51, 2018. [2] M. C. Krutwig, B. Kolmel, A. D. Tantau and K. Starosta, “Standards for Cyber-Physical Energy Systems – Two Case Studies from Sensor Technology” Applied Sciences, vol. 9, no. 3, p. 435, 2019. [3] D. Sasmoko and D. Bachtiar, “Intelligent Baby Box Based on IoT to Observe Room Temperature and Baby Crying” Lontar Komputer, vol. 9, no. 3, pp. 114-123, 2018. [4] Semtech Corporation, SX1276/77/78/79 Datasheet, Revision 4, March 2015. [5] 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, vol. 16, no. 9, p. 1466, 2016. [6] P. A. Catherwood, D. Steele, M. Little, S. McComb and J. McLaughlin, “A Community- Based IoT Personalized Wireless Healthcare Solution Trial” IEEE Journal of Translational Engineering in Health and Medicine, vol. 6, pp. 1-13, 2018. [7] F. Wu, J-M Redoute and M. R. Yuce, “WE-Safe: A Self-Powered Wearable IoT Sensor Network for Safety Applications Based on LoRa” IEEE Access, vol. 6, pp. 40846-40853, 2018. [8] M. Petric, J. Vandendriessche, C. Marsboom, T. Matheussen, E. Ducheyne and A. Touhafi, “Autonomous Wireless Sensor Networks in an IPM Spatial Decision Support System” Computers, vol. 8, no. 2, p. 43, 2019. [9] C. Ebi, F. Schaltegger, A. Rust and F. Blumensaat, “Synchronous LoRa Mesh Network to Monitor Processes in Underground Infrastructure” IEEE Access, vol. 7, pp. 57663-57677, 2019. LONTAR KOMPUTER VOL. 10, NO. 3 DECEMBER 2019 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2019.v10.i03.p02 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 149 [10] S. Rinaldi, M. Pasetti, E. Sisinni, F. Bonafini, P. Ferrari, M. Rizzi and A. Flammini, “On the Mobile Communication Requirements for the Demand-Side Management of Electric Vehicles” Energies, vol. 11, no. 5, p. 1220, 2018. [11] J. C. Ferreira, J. A. Afonso, V. Monteiro and J. L. Afonso, “An Energy Management Platform for Public Buildings” Electronics, vol. 7, no. 11, p. 294, 2018. [12] M. C. Tome, P. H. J. Nardelli and H. Alves, “Long-range Low-power Wireless Networks and Sampling Strategies in Electricity Metering” IEEE Transactions on Industrial Electronics, vol. 66, no. 2, pp. 1629-1637, 2019. [13] R. Sanchez-Iborra, J. Sanchez-Gomez, J. Ballesta-Viñas, M-D Cano and A. F. Skarmeta, "Performance Evaluation of LoRa Considering Scenario Conditions" Sensors, vol. 18, no. 3, p. 772, 2018. [14] R. El Chall, S. Lahoud and M. El Helou, “LoRaWAN Network: Radio Propagation Models and Performance Evaluation in Various Environments in Lebanon” IEEE Internet of Things Journal, vol. 6, no. 2, pp. 2366-2378, 2019. [15] A. Ciuffoletti, “Low-Cost IoT: A Holistic Approach” Journal of Sensor and Actuator Networks, vol. 7, no. 2, p. 19, 2018. [16] S. Hosseinzadeh, M. Almoathen, H. Larijani and K. Curtis, “A Neural Network Propagation Model for LoRaWAN and Critical Analysis with Real-World Measurements” Big Data and Cognitive Computing, vol. 1, no. 1, p. 7, 2017. [17] Ministry of Communication and Informatics, “Persyaratan Teknis Alat dan/atau Perangkat Telekomunikasi Low Power Wide Area” Regulation of the General Director of Resources and Devices of Post and Informatics, no.3, 2019.