Vietnam National University Ho Chi Minh City Ho Chi Minh City University of Technology Faculty of Computer Science and Engineering ——————– * ——————— Thesis graduation Developing A LoRaWAN-based Testbed for IoT Applications Committee : Computer Engineering Supervisor : Dr. Pham Hoang Anh Reviewer : A/Prof. Pham Quoc Cuong Students : Nguyen Duy Tinh - 1852797 Ho Hoang Thien Long - 1852161 Doan Anh Tien - 1852789 Ho Chi Minh City, Sep 2022 TRƯỜNG ĐẠI HỌC BÁCH KHOA CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA KH & KT MÁY TÍNH Độc lập - Tự do - Hạnh phúc ---------------------------- Ngày 16 tháng 9 năm 2022 PHIẾU CHẤM BẢO VỆ LVTN (Dành cho người hướng dẫn/phản biện) 1. Họ và tên SV: Hồ Hoàng Thiên Long MSSV: 1852161 Ngành: Kỹ thuật Máy tính Đoàn Anh Tiến MSSV: 1852789 Ngành: Kỹ thuật Máy tính Nguyễn Duy Tịnh MSSV: 1852797 Ngành: Kỹ thuật Máy tính 2.
Đề tài: Developing A LoRaWAN-based Testbed for IoT Applications 3. Họ tên người hướng dẫn/phản biện: Phạm Quốc Cường 4. Tổng quát về bản thuyết minh: Số trang: Số chương: Số bảng số liệu Số hình vẽ: Số tài liệu tham khảo: Phần mềm tính toán: Hiện vật (sản phẩm) 5. Tổng quát về các bản vẽ: - Số bản vẽ: Bản A1: Bản A2: Khổ khác: - Số bản vẽ vẽ tay Số bản vẽ trên máy tính: 6.
Những ưu điểm chính của LVTN: - students almost fulfilled the basic requirements of the topic - students wrote a good report, although there are some typos. - students published a paper at an international conference based on the results of the thesis 7. Những thiếu sót chính của LVTN: - The testbed is not quite developed. For example, there is no way to test a new system automatically.
- Students seem only to develop an IoT-based system and test the system instead of developing a testbed. Đề nghị: Được bảo vệ Bổ sung thêm để bảo vệ Không được bảo vệ 9. 3 câu hỏi SV phải trả lời trước Hội đồng: - It seems that the proposed system is an IoT-based air quality monitoring system instead of a testbed as requirement. Could you please explain this mismatch? - How can a new IoT-based system be tested? 10.
Đánh giá chung (bằng chữ: giỏi, khá, TB): Good Điểm: 9/10 Ký tên (ghi rõ họ tên) Phạm Quốc Cường Commitment We certify that we worked on the project and wrote this thesis entirely on our own and that it has not been presented in whole or in part in any prior application for a degree. Unless otherwise stated by reference or credit, the work presented is entirely our own. Ho Hoang Thien Long, Nguyen Duy Tinh, Doan Anh Tien 1 Acknowledgements This thesis has completely reached its result thanks to the continuous efforts of the three members, the support and encouragement of our lecturers, friends and families. We would like to express our sincere attitude to those who have helped us throughout the study, research and during working on the thesis.
First and foremost, we would like to give our warmest thanks to our super- visor, Dr. Pham Hoang Anh, who has always supported us with not only crucial equipment to carry on the thesis but also immense knowledge and guidance so we could follow the right direction. He continually motivated us and gave us a chance to embrace a very interesting work which was composed from a lot of knowledge that we have learnt in our university life. He has always been a caring, patient teacher who supports us to adjust the work and this thesis throughout different modifications.
It was an honor for us to work with him and to gain experience under his supervision. Besides our supervisor, we would like to thank all councilors at the Thesis Defense date for their insightful comment and advice so we could refine our work in a better way. We would also like to give our appreciation to all of the teachers in the Faculty of Computer Science and Engineering, in particular, and all of the teachers at Ho Chi Minh City University of Technology in general, for their dedication to teaching and assisting us in grasping the core knowledge and understanding the role of an engineer. We also want to thank all of our friends for guiding and assisting us during our times at the university.
Finally, We would like to express our gratitude to our parents, who always create good conditions for our growth and encourage us when we have challenges in both studies and life. Ho Hoang Thien Long, Nguyen Duy Tinh, Doan Anh Tien 2 Abstracts This thesis proposes, studies and examines an approach on Developing A LoRaWAN-based Testbed for IoT Applications, including hardware and software components regarding LoRaWAN network architecture specification, allowing end- users to be able to monitor, control and validate their LoRaWAN network and wide range of end-devices before any actual deployment in a flexible manner. Additionally, the proposed testbed employs an efficient and reliable mechanism for status synchronization between a physical control device and a web-app-based control device to reduce the uplink packet loss rate as well as uplink frequency for saving power. The experimental results show that the packet loss rate is proportional to the distance between the gateway and end-devices, and is affected by building walls, obstacles, and hardware capabilities.
Moreover, leveraging a network server and MQTT broker with high availability and scalability enables our proposed testbed to possibly accommodate up to 1000 users accessing the web application deployed on a VPS with a dual-core CPU and 2GB RAM without failure. Parts of this thesis have been accepted and presented at an international con- ference as follows: Hoang Thien Long Ho, Anh Tien Doan, Duy Tinh Nguyen, and Hoang-Anh Pham, "A LoRaWAN based IoT Testbed for Performance Investigation," in Proceedings of 37th International Technical Conference on Circuits/Systems, Computers, and Communications (ITC-CSCC), July 2022.org/) 3 Contents Commitment 2 Acknowledgements 3 Abstracts 4 List of Figures 11 List of Table 13 Terms 14 1 Introduction 1 1.1 Purpose and Motivation .2 Scope and Objectives .3 Structure of Thesis. 4 2 Background and Methodologies 5 2.1 Challenges for contemporary agriculture .1 Overview of wireless network technologies .1 LoRa Radio Modulation .1 General network architecture .3 Confirmed data message .4 End-device classes .5 Advantages and disadvantages .5 Metadata and time-series data .6 Relational database in IoT application .7 RS-485 & Modbus RTU. 28 3 The proposed LoRaWAN-based Testbed 31 3.1 Solution proposal structure .2 Hardware-dependent infrastructure .1 RS-485 - LoRa controller integration .3 Software-based infrastructure .3 Web Server & Web Application .4 Application Server access control .2 LoRaWAN control synchronization .1 End-device types .2 RS-485 - LoRa controller integration .2 RS-485 - LoRa converter .3 Slaves and other components .4 Software-based infrastructure .2 Database Management System .3 Web Server & Web Application .4 Application Server access control .2 LoRaWAN control synchronization .1 LoRa/LoRaWAN coverage capability testing .2 Web Server load tolerance testing .1 RS-485 - LoRa integration capability .2 Control synchronization capability .3 Web Server capability .4 User interface usability .5 Capability of validating various LoRaWAN deployments .1 Test Deployment in Urban Environment.
135 7 List of Figures 1.1 Number of Internet of Things (IoT) connected devices worldwide from 2019 to 2030 .1 Unmodulated signal and modulate signal in time-frequency rela- tionship .2 Network stack of LoRaWAN [1] .3 A typical LoRaWAN Network Architecture .7 Advantages of a LoRaWAN network deployment [1] .8 Traditional client-server model .9 pub/sub model .10 MQTT on TCP/IP stack .11 MQTT connection establishment .12 MQTT topic structure .13 A complex topic organization represented as a tree .14 Modbus RTU and RS-485 representation on OSI stack .16 A differential signalling example .17 The data frame format used in Modbus RTU .18 The format of one transmitted byte. 30 8 List of Figures 3.1 The proposed LoRaWAN-based Testbed overall architecture .2 Our solution proposal structure .3 The proposed RS-485 - LoRa integration system architecture .4 The proposed Physical controller firmware design .5 The proposed Physical controller hardware block diagram .6 The flowchart of sending 1 command running on each Master .7 Application topics hosted on the Streaming Broker .8 EER diagram for LoRaWAN-based Testbed Application .9 Web Application Sitemap .10 Authentication sequence diagram .11 CRUD sequence diagram .12 Sensor widget execution sequence .13 Controller widget execution sequence .14 Overall uplink testing phases .15 Overall downlink testing phases .16 The format and example of clientid .17 Two phases of the Access Control mechanism illustrated via se- quence diagrams .18 The state machine describes the behaviors of a virtual control device (switch or button) .19 Four possible scenarios for synchronizing the status of physical and virtual control devices .1 The schematic of the Central MCU board .2 The schematic of the Button Matrix board .3 The PCB bottom view of the Central MCU board .4 The PCB bottom view of the Button Matrix board .5 The UART - RS-485 mutual conversion circuit .6 The flowchart of RS-485 handler task .7 The interface of the Dragino RS485-LN. 77 9 List of Figures 4.8 three-phase process to read data from Slaves .9 Relay 4 channels RS-485/Modbus RTU developed and manufac- tured by Vietnic .10 Full topic tree representation of all topics provided by TTS .11 An example of 2 MQTT clients subscribing to the 2 downlink topics of the Network Server created by EMQ X .12 EMQ X Rule engine with uplink and downlink examples .13 Mapping model for Testbed Application .14 MVC model applied in Web Server .15 Authentication Pages Flow .16 Dashboard page UI .17 Dashboard dropdown and Add board action .18 Configure board and Delete board actions .19 Add widget action .20 Delete widget action .23 Push Button Widget .24 Toggle Button Widget .25 Uplink testing metric evaluator .26 A phase diagram expresses the PLR computation of uplink testing 101 4.27 A phase diagram expresses the RSSI computation of uplink testing 102 4.28 Downlink testing metric evaluator .29 A phase diagram expresses the PLR computation of downlink testing103 4.30 A phase diagram expresses the RSSI computation of downlink testing104 4.31 A phase diagram expresses the RTT computation of downlink testing105 4.32 A phase diagram expresses the RESP computation of downlink testing .33 Device page UI .34 Add widget action. 108 10 List of Figures 4.35 Add widget action .36 User page UI .37 Language conversion feature .39 An actual example of a control synchronization scenario from phys- ical device terminal view .40 An actual UI corresponding to each state of the virtual button .1 B4 building in indoor measurements.
118 (a) B4 building in reality. 118 (b) B4 building longitudinal cross-section .2 A4 building in reality .3 Indoor experimental results of uplink coverage in bar chart repre- sentation .4 Indoor experimental results of control synchronization in bar chart representation .5 Map of uplink measurements in outdoor environment .6 Outdoor experimental results of uplink coverage in chart represen- tation .7 Map of downlink measurements in outdoor environment .8 Outdoor experimental results of downlink coverage in chart repre- sentation .9 Stress test result on Login page with incremental virtual users .10 Stress test result on Application pages with incremental virtual users130 11 List of Tables 2.1 3 commonly-used wireless technologies .2 MAC message types used in LoRaWAN 1.3 Comparison among 3 devices classes A, B and C .1 Signal descriptions of Physical controller illustrated in Figure 3.2 Description of the topic levels in Figure 3.3 Description of an AC record .4 The AC records for any end-user that own the device dev_id .1 A list of device types and their sensing data .2 The commonly used command provided by device manufacturer .3 A list of RESTful APIs descriptions .4 A list of web API implementation complexity on Web Server side .5 A list of web API implementation complexity on Web Application side 90 4.