Thesis BLE 5
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN ELECTRICAL ENGINEERING, SECOND CYCLE, 30 CREDITS , IoT Readiness of BLE 5: Evaluation, Implementation and Improvements HERGILS ÞÓRÐARSON KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE KTH Royal Institute of Technology School of Electrical Engineering and Computer Science Degree project in Embedded Systems IoT Readiness of BLE 5: Evaluation, Implementation and Improvements Author: Hergils Þórðarson Supervisor: Johanna Nordlöf, Tritech Yuan Yao, KTH Examiner: Prof. Zhonghai Lu, KTH Abstract The rapid enhancement of low-power short range wireless connectivity has been a driving factor of the pervasive adoption of Internet-of-Things (IoT). However, the lack of universal standard for such technologies causes compatibility issues and slows down innovation. The Bluetooth Low Energy (BLE) protocol has become the leading protocol that is most likely to be adopted as the standard over other compatible technologies and thus has to be studied thoroughly and all characteristics evaluated. Several major enhancements were introduced in the release of BLE 5 which makes the technology instantly more attractive in wider range of use cases than before. These enhancements bring additional complexity into the BLE architecture while allowing for more flexibility and configuration varieties to optimize each use case. This thesis attempts to evaluate the benefits of new features in BLE for a specific device developed by Tritech Technologies and the possibility of utilizing several features to improve wireless performance. Additionally, the technology architecture is deeply studied, challenges in implementation identified and operational characteristics measured. Results of the literature review discusses how the scalability of BLE has significantly improved, new features provide more flexibility making the technology more attractive for all IoT and finally recommends further work in order to have a single standard when operating low-powered wireless communication. Moreover, test results of power consumption, possible range and throughput are summarized showing that the new features can bring significant benefits to certain products but massive drawbacks might occur in form of power consumed if not carefully implemented. To point out some notable test results acquired in this project, double the energy utility was achieved by utilizing high speed physical layer (PHY) in high throughput operation that reached data transfer rate of 1.37 MB/s. Using long range PHY with coding scheme of eight symbols per bit reached roughly 1 km range in Line-of-Sight (LoS) and improvement from about half-house to nearly full-house coverage. Furthermore, a method of dynamically switching PHYs was implemented and concluded not suitable for such an application due to high added power consumption. Keywords— Bluetooth Low Energy, BLE 5, Internet of Things, Wireless Communica- tion Referat Den snabba förbättringen av trådlös kommunikation med låg energiförbrukning har präglat utvecklingen av Internet-of-Things (IoT). Bristen på en universell stan- dard för sådan teknik orsakar kompatibilitetsproblem och kan hämma innovation. Protokollet för Bluetooth Low Energy (BLE) har kommit att bli det ledande pro- tokoll som förmodligen kommer att antas som standarden över andra kompatibla teknologier och måste därför granskas noggrant och alla dess egenskaper utvärderas. Flera anmärkningsvärda förbättringar introducerades i utgåvan av BLE 5 vilket omedelbart gör tekniken mer attraktiv i ett större användningsområde än tidigare. Dessa förbättringar ger ytterligare komplexitet i BLE-arkitekturen, samtidigt som detta möjliggör mer flexibilitet och konfigurationsvarianter för att optimera varje användningsfall. Denna rapport försöker att utvärdera fördelarna med nya funktioner i BLE för en specifik produkt som utvecklats av Tritech Technologies och möjligheten att utnyttja flera funktioner för att förbättra den trådlösa anslutningen. Protokollarkitekturen är dessutom granskad, utmaningar i genomförandet identifierade och operativa egen- skaper uppmätta. Resultaten från litteraturöversikten diskuterar hur skalbarheten hos BLE har förbättrats avsevärt, hur nya funktioner bidrar till flexibilitet vilket gör tekniken mer attraktiv för all typ av IoT och slutligen rekommenderar vidare arbete för att kunna uppnå en standard för trådlös kommunikation med låg energiförbrukn- ing. Dessutom sammanfattas testresultatet av strömförbrukning, möjlig räckvidd och datahastighet, vilket visar att de nya funktionerna kan ge betydande fördelar för vissa produkter men att nackdelar kan förekomma i form av strömförbrukning om den inte är noggrant genomförd. BLE 5 jämfördes med tidigare versioner och resultaten från denna jämförelse visade på att fördubblad energy utility kunde up- pnås genom att använda ett Physical Layer (PHY) med höghastighetsegenskaper och dataöverföringshastighet på 1.37 MB/s. Då ett PHY med lång räckvidd och datakodning på åtta symboler per bit användes kunde en räckvidd på cirka 1 km siktlinje uppnås och en förbättring kunde ses i en tvåplansvilla där täckningen ökat från cirka halva byggnaden till nästan hela byggnaden. Dessutom utvecklades en metod för att dynamiskt byta PHY under användning, och slutsatsen visade att denna metod ej är lämplig för den produkt som utreddes på grund av den ökade energiförbrukningen som då uppstod. Nyckelord— Bluetooth Low Energy, BLE 5, Internet of Things, Trådlösa kommunika- tioner Acknowledgment I want to start by expressing my gratitude to my supervisor, Johanna Nordlöf, for providing me with guidance, helpful feedback and inspiration throughout the process. On the same note, I want to thank all colleagues at Tritech for a warm welcome from beginning, sharing ideas and resources, and in general making the project work fun and memorable. I would like to thank Prof. Zhonghai Lu at KTH to take on the responsibility of examining this project and his helpful feedback. Finally I want to thank my family, especially my girlfriend Högna, for their support and encouragement through my studies. Stockholm, November 2018 Hergils Þórðarson Contents Abbreviations xvii 1. Introduction1 1.1. Background . .1 1.1.1. Bluetooth . .2 1.1.2. Bluetooth Low Energy . .3 1.1.3. Company Background . .4 1.2. Problem . .5 1.3. Purpose . .6 1.4. Goals . .6 1.5. Method . .6 1.6. Sustainability and Ethics . .7 1.7. Delimitations . .8 1.8. Outline . .8 2. Theoretical Background9 2.1. Bluetooth Fundamentals . 10 2.2. BLE Architecture . 11 2.2.1. Physical Layer . 12 2.2.2. Link Layer . 14 2.2.3. Host-Controller Interface . 16 2.2.4. Logical Link Control and Adaptation Protocol (L2CAP) . 17 2.2.5. Security Manager . 18 2.2.6. Attribute Protocol (ATT) . 18 2.2.7. Generic Attribute Profile (GATT) . 19 2.2.8. Generic Access Profile (GAP) . 20 2.3. BLE Operation . 21 2.3.1. Connectionless Mode . 23 2.3.2. Connected Mode . 25 2.3.3. Topology . 26 2.4. Packet Format . 27 2.4.1. Advertising Channel PDU . 28 2.4.2. Data Channel PDU . 29 2.5. BLE 5 Major Enhancements . 30 2.5.1. Increased Speed . 30 2.5.2. Increased Range . 31 ix Contents 2.5.3. Advertising Extension . 32 2.6. Theoretical performance . 33 2.6.1. Throughput . 33 2.6.2. Power Consumption . 35 2.6.3. Covering Range . 35 2.7. Related Work . 37 3. Methods 39 3.1. Research Methodology . 39 3.1.1. Philosophical Assumptions . 40 3.1.2. Research Method . 40 3.2. Preparation . 41 3.2.1. Hardware Description . 41 3.2.2. Software Description . 43 3.3. Measurements . 44 3.4. Data Analysis . 46 4. Implementation 47 4.1. Product Background . 47 4.2. Software Application . 48 4.2.1. Central Device . 48 4.2.2. Peripheral Device . 49 4.3. Evaluation Plan . 51 4.3.1. Power Measurements . 51 4.3.2. Data Throughput Measurements . 53 4.3.3. Range Measurements . 53 4.4. Competing technology . 55 4.4.1. Zigbee . 55 4.4.2. Thread . 57 4.4.3. ANT/ANT+ . 57 4.4.4. Comparison Discussion . 58 5. Results 61 5.1. Power Consumption Results . 61 5.2. Throughput Results . 65 5.3. Range Results . 66 6. Summary and Conclusion 69 6.1. Implementation Challenges . 69 6.2. IoT Readiness of BLE 5 . 70 6.2.1. Scalability . 71 6.2.2. Low Power Characteristics . 71 6.2.3. Range & Throughput . 72 6.3. Conclusion . 73 x Contents 6.4. Future works . 75 Bibliography 77 A. Additional Test results 83 A.1. Power profile breakdown . 83 xi List of Figures 2.1. Typical range vs. throughput for various wireless technologies. .9 2.2. Bluetooth Core Specifications release highlights [11]. 10 2.3. BLE protocol stack. 11 2.4. BLE channel division. 12 2.5. Link Layer state machine. Adopted from [14, Fig. 1.1]. * M and S denotes master and slave respectively. 15 2.6. Link Layer bit stream processing on LE 1M and LE 2M. Adapted from [14, Fig. 3.1] . 16 2.7. Link Layer bit stream processing on LE Coded. Adapted from [14, Fig. 3.2] . 16 2.8. L2CAP structure. Adapted from [16]. 17 2.9. Example of GATT Profile hierarchy. 20 2.10. Example of connectionless mode. Advertiser broadcasting short non- connectable packets containing useful data, while Scanner listens. 24 2.11. Example of simplified BLE connection establishment. 25 2.12. Five different BLE topology examples. Adapted from [13, Fig 4.2]. 26 2.13. Packet format for LE Uncoded PHYs. 27 2.14. Packet format for LE Coded PHY. 28 2.15. Advertising channel PDU structure. 28 2.16. Data channel PDU structure. 29 2.17. Simplified data transfer mode using connections. 34 2.18. Relationship of path loss and distance. 36 3.1. Summary of research methods used in various parts of the project. 41 4.1. FSM describing basic Central Device functionality. 49 4.2. FSM describing basic Peripheral Device functionality. *Three ad- vertising sets used when BLE 5 is utilized, one for each option of connecting(LE1M, LECoded S=2, LECoded S=8). 50 4.3. Jumper removal on Launchpad for clean BLE power measurements. 52 4.4. Test points indicated in test area.