TY - GEN AU - Bahga, Arshdeep AU - Madisetti, Vijay TI - Internet of things : : a hands-on approach SN - 9780996025515 U1 - 004.692 PY - 2014/// PB - Arshdeep Bahga and Vijay Madisetti KW - N1 - CONTENTS I INTRODUCTION & CONCEPTS 17 1 Introduction to Internet of Things 19 1 Introduction 20 1.1.1 Definition & Characteristics of loT 22 2 Physical Design of loT 23 1 Things in loT 23 2 loT Protocols 23 1.3 Logical Design of loT 29 1 loT Functional Blocks 29 2 loT Communication Models 30 3 loT Communication APIs 32 1.4 loT Enabling Technologies 35 1 Wireless Sensor Networks 35 2 Cloud Computing 36 3 Big Data Analytics 37 4 Communication Protocols 37 5 Embedded Systems 38 1.5 loT Levels & Deployment Templates 38 1 loTLevel-1 39 2 loT Level-2 40 3 loT Level-3 41 4 loTLevel-4 42 5 loT Level-5 43 6 loT Level-6 44 2 Domain Specific loTs 47 1 Introduction 48 2 Home Automation 48 1 Smart Lighting 48 2 Smart Appliances 48 3 Intrusion Detection 49 4 Smoke/Gas Detectors 50 2.3 Cities 50 1 Smart Parking 50 2 Smart Lighting 50 3 Smart Roads 50 4 Structural Health Monitoring 51 5 Surveillance 51 6 Emergency Response 52 2.4 Environment 52 1 Weather Monitoring 52 2 Air Pollution Monitoring 52 3 Noise Pollution Monitoring 53 4 Forest Fire Detection 53 5 River Floods Detection 54 2.5 Energy 54 1 Smart Grids 54 2 Renewable Energy Systems 55 3 Prognostics 55 2.6 Retail 56 1 Inventory Management 56 2 Smart Payments 56 3 Smart Vending Machines 56 2.7 Logistics 57 1 Route Generation & Scheduling 57 2 Fleet Tracking 58 3 Shipment Monitoring 58 4 Remote Vehicle Diagnostics 59 2.8 Agriculture 59 1 Smart Irrigation 59 2 Green House Control 59 2.9 Industry 60 1 Machine Diagnosis & Prognosis 60 2 Indoor Air Quality Monitoring 61 2.10 Health & Lifestyle 62 1 Health & Fitness Moniloring 62 2 Wearable Electronics 63 3 loTandM2M 65 1 Introduction 66 2 M2M 66 3 Difference between loT and M2M 67 4 SDN and NFV for loT 69 1 Software Defined Networking 69 2 Network Function Virtualization 73 4 loT System Management with NETCONF-YANG 79 1 Need for loT Systems Management 80 2 Simple Network Management Protocol (SNMP) 81 4.2.1 Limitations of SNMP 81 3 Network Operator Requirements 82 4 NETCONF 83 5 YANG 84 6 loT Systems Management with NETCONF-YANG 91 4.6.1 NETOPEER 93 II DEVELOPING INTERNET OF THINGS 97 loT Platforms Design Methodology 99 1 Introduction 100 2 loT Design Methodology 100 1 Step 1: Purpose & Requirements Specification 100 2 Step 2: Process Specification 101 3 Step 3: Domain Model Specification 102 4 Step 4: Information Model Specification 103 5 Step 5: Service Specifications 103 6 Step 6: loT Level Specification 105 7 Step 7: Functional View Specification 106 8 Step 8: Operational View Specification 109 9 Step 9: Device & Component Integration 111 10 Step 10: Application De/elopment 111 3 Case Study on loT System for Weather Monitoring 111 4 Motivation for Using Python 115 6 loT Systems - Logical Design using Python 121 1 Introduction 122 2 Installing Python 123 3 Python Data Types & Data Structures 123 1 Numbers 123 2 Strings 125 3 Lists 126 4 Tuple 127 5 Dictionaries 128 6 Type Conversions 129 6.4 Control Flow 129 1 if 129 2 for 130 3 while 131 4 range 131 5 break/continue 131 6 pass 132 5 Functions 132 6 Modules 135 7 Packages 137 8 File Handling 138 9 Date/Time Operations 140 10 Classes 141 11 Python Packages of Interest for loT 144 1 JSON 144 2 XML 145 3 HTTPLib & URLLib 147 4 SMTPLib 149 7 loT Physical Devices & Endpoints 153 1 What is an loT Device 154 7.1.1 Basic building blocks of an loT Device 154 2 Exemplary Device: Raspberry Pi 155 3 About the Board 155 4 Linux on Raspberry Pi 156 7.5 Raspberry Pi Interfaces 162 1 Serial 162 2 SPI 162 3 I2C 162 7.6 Programming Raspberry Pi with Python 162 1 Controlling LED with Raspberry Pi 162 2 Interfacing an LED and Switch with Raspberry Pi 164 3 Interfacing a Light Sensor (LDR) with Raspberry Pi 166 7.7 Other loT Devices 167 1 pcDuino 167 2 BeagleBone Black 168 3 Cubieboard 168 8 loT Physical Servers & Cloud Offerings 171 1 Introduction to Cloud Storage Models & Communication APIs 172 2 WAMP - AutoBahn for loT 172 3 Xively Cloud for loT 176 4 Python Web Application Framework - Django 179 1 Django Architecture 180 2 Starting Development with Django 180 5 Designing a RESTful Web API 188 6 Amazon Web Services for loT 193 1 Amazon EC2 193 2 Amazon AutoScaling 196 3 Amazon S3 199 4 Amazon RDS 199 5 Amazon DynamoDB 202 6 Amazon Kinesis 204 7 Amazon SQS 206 8 Amazon EMR 209 8.7 Sky Net loT Messaging Platform 211 9 Case Studies Illustrating loT Design 217 1 Introduction 218 2 Home Automation 218 1 Smart Lighting 218 2 Home Intrusion Detection 226 9.3 Cities 237 9.3.1 Smart Parking 237 9.4 Environment 247 1 Weather Monitoring System 247 2 Weather Reporting Bot 263 3 Air Pollution Monitoring 266 4 Forest Fire Detection 270 5 Agriculture 275 9.5.1 Smart Irrigation 275 6 Productivity Applications 278 9.6.1 loT Printer 278 III ADVANCED TOPICS 283 10 Data Analytics for loT 285 1 Introduction 286 2 Apache Hadoop 292 1 MapReduce Programming Model 292 2 Hadoop MapReduce Job Execution 292 3 MapReduce Job Execution Workflow 294 4 Hadoop Cluster Setup 295 3 Using Hadoop MapReduce for Batch Data Analysis 301 10.3.1 Hadoop YARN 303 4 Apache Oozie 311 1 Setting up Oozie 311 2 Oozie Workflows for loT Data Analysis 312 5 Apache Spark 320 6 Apache Storm 325 10.6.1 Setting up a Storm Cluster 326 7 Using Apache Storm for Real-time Data Analysis 330 1 REST-based approach 330 2 WebSocket-based approach 337 10.8 Structural Health Monitoring Case Study 342 11 Tools for loT 351 1 Introduction 352 2 Chef 352 11.2.1 Setting up Chef 354 11.3 Chef Case Studies 355 1 Multi-tier Application Deployment 355 2 Hadoop Cluster 360 3 Storm Cluster 368 4 Puppet 372 5 Puppet Case Study - Multi-tier Deployment 374 6 NETCONF-YANG Case Studies 377 1 Steps for loT device Management with NETCONF-YANG 378 2 Managing Smart Irrigation loT System with NETCONF-YANG 379 3 Managing Home Intrusion Detection loT System with NETCONF-YANG 392 11.7 loT Code Generator 405 Appendix-A - Setting up Raspberry Pi 413 Appendix-B - Setting up Ubuntu VM 419 Appendix-C - Setting up Django 432 Bibliography 440 Index 441 ER -