A Sensor Network for the Internet of Things Integrated with a Bidirectional Backend

Total Page:16

File Type:pdf, Size:1020Kb

A Sensor Network for the Internet of Things Integrated with a Bidirectional Backend Degree Project Electrical Engineering July 2014 A sensor network for the Internet of Things Integrated with a bidirectional backend Linus Hobring Philip Söderberg Department of Communication Systems (DIKO) Blekinge Institute of Technology 371 79 Karlskrona Sweden This thesis is submitted to the Department of Communication Systems at Blekinge Institute of Technology in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering with emphasis on Telecommunication Systems. The thesis is equivalent to 20 weeks of full time studies. Contact Information: Authors: Linus Hobring and Philip Söderberg E-mail: linus{dot}hobring{at}gmail.com and philip{dot}soderberg{at}gmail.com External advisor: Ruwan Lakmal Silva University advisor: Markus Fiedler Department of communication Systems Department of Communication Systems Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 371 79 Karlskrona Fax : +46 455 38 50 57 Sweden ii ABSTRACT Internet of Things is rapidly evolving. This thesis includes a study of single-board computers suitable for machine-to-machine communication together with the developing process of a sensor network integrated with a bidirectional communication platform. Raspberry Pi was selected as the single-board computer used in the proposed system. The Message Queuing Telemetry Transport protocol was selected as main communication protocol to handle all exchange of information between the network and the bidirectional communication platform. It was selected because of its reliability, low bandwidth and publish/subscribe architecture. Decision-making procedures were implemented to work with both local sensor data and data from different Message Queuing Telemetry Transport streams, such as GPS data, used to calculate the distance between the user’s smart phone and the office to prepare the workstation, temperature sensors and ambient light sensors controlling Philips HUE light bulbs. The finished sensor network was design to work within office environments to prepare workstations and monitor the work climate. The number of sensors connected to the single- board computer has a major impact in the CPU usage. Measurements and calculations show that 17 connected physical sensors will cause a CPU usage of 96%. Keywords: IoT, M2M communication, MQTT, Sensor network and single-board computers. ACKNOWLEDGEMENTS This thesis work has been carried out at a large software company, which has chosen to remain anonyms, in Karlskrona Sweden in cooperation with Department of Communication Systems, Blekinge Institute of Technology (BTH), Karlskrona Sweden under supervision of Prof. Dr. Ing Markus Fiedler (BTH) and Ruwan Lakmal Silva. We especially want to thank Lakmal for his supervision and guidance during the thesis work. He has helped us to reach our goals and shown a great interest during all phases of the project. We would also like to thank Markus for his tutoring and expertise. Thank you, Linus Hobring, Philip Söderberg ii TABLE OF CONTENTS ABSTRACT ............................................................................................................................................ I ACKNOWLEDGEMENTS ................................................................................................................. II TABLE OF CONTENTS ................................................................................................................... III TABLES OF FIGURES ..................................................................................................................... IV NOTATION ........................................................................................................................................... V 1 INTRODUCTION ........................................................................................................................... 1 1.1 AIMS AND OBJECTIVES ............................................................................................................... 1 1.2 CONTENT OF THE THESIS ............................................................................................................ 3 2 BACKGROUND ............................................................................................................................. 4 2.1 INTERNET OF THINGS ................................................................................................................. 4 2.2 SINGLE-BOARD COMPUTERS ....................................................................................................... 5 2.2.1 Operating systems .............................................................................................................. 7 2.2.2 Programming language ...................................................................................................... 8 2.3 MESSAGE QUEUING TELEMETRY TRANSPORT ........................................................................... 9 2.4 MESSAGE QUEUING TELEMETRY TRANSPORT – SENSOR NETWORKS ......................................... 9 2.5 HTTP ......................................................................................................................................... 9 2.5.1 HTTP URL ......................................................................................................................... 9 2.5.2 GET .................................................................................................................................. 10 2.5.3 POST ................................................................................................................................ 10 2.6 API ........................................................................................................................................... 10 3 RELATED WORK ....................................................................................................................... 11 3.1 INTERNET OF THINGS ............................................................................................................... 11 3.1.1 IoT in the building domains ............................................................................................. 11 3.1.2 IoT in the health care domain .......................................................................................... 12 3.2 SENSOR NETWORKS .................................................................................................................. 12 3.2.1 Using Arduino and Raspberry Pi ..................................................................................... 12 3.3 MQTT QOS LEVEL .................................................................................................................. 13 3.4 SINGLE-BOARD COMPUTERS AND CLOUD SERVICES ................................................................. 14 4 RESEARCH METHODOLOGY ................................................................................................ 15 5 FUNDAMENTALS ....................................................................................................................... 16 5.1 GENERAL PURPOSE INPUT OUTPUT ........................................................................................... 16 5.2 INPUT/OUTPUT INTERFACES ..................................................................................................... 16 5.2.1 Inter-Integrated Circuit .................................................................................................... 16 5.2.2 One-wire ........................................................................................................................... 17 5.3 THREADED PROGRAMS ............................................................................................................. 17 5.3.1 Threads ............................................................................................................................. 17 5.3.2 Multithreading .................................................................................................................. 17 5.4 ADD-ON SOFTWARE ................................................................................................................. 17 5.4.1 PIGPIO ............................................................................................................................. 17 5.4.2 Mosquitto .......................................................................................................................... 18 5.4.3 Wiring Pi .......................................................................................................................... 18 5.4.4 Linux Apache MySQL PHP .............................................................................................. 18 5.4.5 Round Robin Database tool ............................................................................................. 18 5.4.6 Adafruit Python Library ................................................................................................... 18 5.4.7 I2C Detect ......................................................................................................................... 19 iii 6 SYSTEM ARCHITECTURE ....................................................................................................... 20 6.1 SYSTEM OVERVIEW .................................................................................................................. 20 6.1.1 Main Python script ........................................................................................................... 23 6.1.2 Threads ............................................................................................................................
Recommended publications
  • Munin Documentation Release 2.0.44
    Munin Documentation Release 2.0.44 Stig Sandbeck Mathisen <[email protected]> Dec 20, 2018 Contents 1 Munin installation 3 1.1 Prerequisites.............................................3 1.2 Installing Munin...........................................4 1.3 Initial configuration.........................................7 1.4 Getting help.............................................8 1.5 Upgrading Munin from 1.x to 2.x..................................8 2 The Munin master 9 2.1 Role..................................................9 2.2 Components.............................................9 2.3 Configuration.............................................9 2.4 Other documentation.........................................9 3 The Munin node 13 3.1 Role.................................................. 13 3.2 Configuration............................................. 13 3.3 Other documentation......................................... 13 4 The Munin plugin 15 4.1 Role.................................................. 15 4.2 Other documentation......................................... 15 5 Documenting Munin 21 5.1 Nomenclature............................................ 21 6 Reference 25 6.1 Man pages.............................................. 25 6.2 Other reference material....................................... 40 7 Examples 43 7.1 Apache virtualhost configuration.................................. 43 7.2 lighttpd configuration........................................ 44 7.3 nginx configuration.......................................... 45 7.4 Graph aggregation
    [Show full text]
  • Rrdtool – Perl Module • Net::Snmptrapd(Install It from CPAN by Root) • Netsnmp::Agent(Embedded on Net-Snmp) Requirement – SNMP Agent
    Homework 5 DNS、HTTPD、SNMP Requirements One dedicated domain name for yourself Setup DNS server with following records SOA, NS, MX Make them reasonable NS Delegation (with team mates) Dedicate a sub domain to each of your team mates Building a slave server for your team mate And a stub server for another team mate Updates should be synchronized Reverse resolution for your NAT 192.168.x.0/24 for each of team mates Requirements (Cont.) slave a.nctucs.net 140.113.a.a stub 192.168.0.1/24 b.nctucs.net c.nctucs.net 140.113.b.b 140.113.c.c 192.168.0.2/24 192.168.0.3/24 Requirements (Cont.) View Create view.example.csie.net A record: Queries from 192.168.0.0/24: view.example.csie.net A 192.168.0.1 Otherwise, get your normal ip Logging Record all records to /var/log/named.log Do log rotate Note: you will be asked for explaining the what does the log entry means in named.log Requirements (Cont.) SPF/DomainKeys record for your server Add resonable SPF/DomainKeys records Configure your mail system to support these feature SSHFP record for your server Make a reasonable setting Requirements (Cont.) Dynamic DNS update Your DNS should accept the update requests from 140.113.17.225 and your team mates You should know how to update a dns record Management Your DNS server should support TSIG and allow the connection from 140.113.17.225 Your DNS server should only allow the AXFR request from 140.113.17.225 Only allow recursion query from your team mates and 140.113.17.225 Appendix Use ldap as backend database dns/bind9-sdb-ldap http://www.openldap.org/ http://bind9-ldap.bayour.com/ SPF setup wizard http://old.openspf.org/wizard.html DKIMproxy http://dkimproxy.sourceforge.net HTTPD Requirements HTTPD apache, lighttpd, nginx, etc.
    [Show full text]
  • Synthesiology”, a New Academic Journal
    MESSAGES FROM THE EDITORIAL BOARD There has been a wide gap between science and society. The last three hundred years of the history of modern science indicates to us that many research results disappeared or took a long time to become useful to society. Due to the difficulties of bridging this gap, it has been recently called the valley of death or the nightmare stage (Note 1). Rather than passively waiting, therefore, researchers and engineers who understand the potential of the research should be active. To bridge the gap, technology integration (i.e. Type 2 Basic Research − Note 2) of scientific findings for utilizing them in society, in addition to analytical research, has been one of the wheels of progress (i.e. Full Research − Note 3). Traditional journals, have been collecting much analytical type knowledge that is factual knowledge and establishing many scientific disciplines (i.e. Type 1 Basic Research − Note 4). Technology integration research activities, on the other hand, have been kept as personal know-how. They have not been formalized as universal knowledge of what ought to be done. As there must be common theories, principles, and practices in the methodologies of technology integration, we regard it as basic research. This is the reason why we have decided to publish “Synthesiology”, a new academic journal. Synthesiology is a coined word combining “synthesis” and “ology”. Synthesis which has its origin in Greek means integration. Ology is a suffix attached to scientific disciplines. Each paper in this journal will present scenarios selected for their societal value, identify elemental knowledge and/or technologies to be integrated, and describe the procedures and processes to achieve this goal.
    [Show full text]
  • The Cacti Manual.Pdf
    The Cacti Manual Ian Berry Tony Roman Larry Adams J.P. Pasnak Jimmy Conner Reinhard Scheck Andreas Braun The Cacti Manual by Ian Berry, Tony Roman, Larry Adams, J.P. Pasnak, Jimmy Conner, Reinhard Scheck, and Andreas Braun Published 2017 Copyright © 2017 The Cacti Group This project is licensed under the terms of the GPL. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. All product names are property of their respective owners. Such names are used for identification purposes only and are not indicative of endorsement by or of any company, organization, product, or platform. Table of Contents I. Installation...................................................................................................................................................................................1 1. Requirements.....................................................................................................................................................................1 2. Installing Under Unix.......................................................................................................................................................2
    [Show full text]
  • Storage of Network Monitoring and Measurement Data
    Storage of Network Monitoring and Measurement Data A report submitted in partial fulfillment of the requirements for the degree of Bachelor of Computing and Mathematical Sciences at The University of Waikato by Nathan Overall c 2012 Nathan Overall Abstract Despite the limitations of current network monitoring tools, there has been little investigation into providing a viable alternative. Network operators need high resolution data over long time periods to make informed decisions about their networks. Current solutions discard data or do not provide the data in a practical format. This report addresses this problem and explores the development of a new solution to address these problems. Acknowledgements I would like to show my appreciation to the following persons who have made this project possible. Members of the WAND Network group for their continued support during the project, including my supervisor Richard Nelson. I would also like to give a special mention to Shane Alcock and Brendon Jones for their ongoing assistance to the project while they developed the WAND Network Event Monitor. DR. Scott Raynel for his support and advice throughout the project. The WAND network group and Lightwire LTD for providing the resources necessary to conduct the project. Contents List of Acronyms vi List of Figures vii 1 Introduction1 1.1 Network Operation.......................1 1.2 Overview of the Problem....................2 1.3 Goals...............................2 1.4 Plan of Action..........................3 2 Background4 2.1 Introduction...........................4 2.2 Round Robin Database.....................4 2.3 Tools using Round Robin Database (RRD)..........8 2.3.1 Smokeping...........................8 2.3.2 Cacti..............................9 2.4 The Active Measurement Project...............9 2.5 OpenTSDB..........................
    [Show full text]
  • Performance-Analyse in Großen Umgebungen Mit Collectd
    Performance-Analyse in großen Umgebungen mit collectd Performance-Analyse in großen Umgebungen mit collectd Sebastian tokkee\ Harl " <[email protected]> FrOSCon 2009 2009-08-22 Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Gliederung Was ist collectd? Wichtige Eigenschaften Wichtige Plugins Eigene Erweiterungen Uber¨ den Tellerrand Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Was ist collectd? I collectd sammelt Leistungsdaten von Rechnern I Leistungsdaten sind zum Beispiel: I CPU-Auslastung I Speichernutzung I Netzwerkverkehr I Daten werden erhoben, verarbeitet und gespeichert I H¨aufig: Darstellung als Graphen I Nicht verwechseln mit Monitoring! Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Kontakt I Homepage: http://collectd.org/ I Mailinglist: [email protected] I IRC: #collectd auf irc.freenode.net Web 2.0\: http://identi.ca/collectd I " Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Wichtige Eigenschaften Wichtige Eigenschaften I Daemon I Freie Software (gr¨oßtenteils GPLv2) I Portierbar (Linux, *BSD, Solaris, . ) I Skalierbar (OpenWrt, . , Cluster / Cloud) I Effizient (Default-Aufl¨osung: 10 Sekunden) I Modular (Uber¨ 70 Plugins) Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Wichtige Eigenschaften Wichtige Eigenschaften I Daemon I Freie Software (gr¨oßtenteils GPLv2) I Portierbar (Linux, *BSD, Solaris, . ) I Skalierbar (OpenWrt, . , Cluster / Cloud) I Effizient (Default-Aufl¨osung: 10 Sekunden) I Modular (Uber¨ 70 Plugins) Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Wichtige Eigenschaften Wichtige Eigenschaften: 10-Sekunden-Aufl¨osung Performance-Analyse in großen Umgebungen mit collectd Was ist collectd? Wichtige Eigenschaften Wichtige Eigenschaften I Daemon I Freie Software (gr¨oßtenteils GPLv2) I Portierbar (Linux, *BSD, Solaris, .
    [Show full text]
  • Emacs-W3m User's Manual
    This file documents emacs-w3m, an Emacs interface tow3m. This edition is for emacs-w3m version 1.4.567. Emacs-w3m User's Manual An Emacs interface to w3m for emacs-w3m version 1.4.567 The emacs-w3m development team Copyright c 2000-2014 TSUCHIYA Masatoshi Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL- ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this document; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. i Table of Contents Emacs-w3m User's Manual :::::::::::::::::::::::: 1 1 Preliminary remarks:::::::::::::::::::::::::::: 2 2 It's so easy to begin to use emacs-w3m ::::::: 3 2.1 What version of Emacs can be used? ::::::::::::::::::::::::::: 3 2.2 Using w3m: the reason why emacs-w3m is fast:::::::::::::::::: 3 2.3 Things required to run emacs-w3m ::::::::::::::::::::::::::::: 3 2.4 Installing emacs-w3m :::::::::::::::::::::::::::::::::::::::::: 5 2.5 Installing on non-UNIX-like systems :::::::::::::::::::::::::::: 6 2.6 Minimal settings to run emacs-w3m :::::::::::::::::::::::::::: 7 3 Basic usage :::::::::::::::::::::::::::::::::::::: 8
    [Show full text]
  • MRTG the Multi Router Traffic Grapher
    The following paper was originally published in the Proceedings of the Twelfth Systems Administration Conference (LISA ’98) Boston, Massachusetts, December 6-11, 1998 MRTG The Multi Router Traffic Grapher Tobias Oetiker Swiss Federal Institute of Technology, Zurich For more information about USENIX Association contact: 1. Phone: 510 528-8649 2. FAX: 510 548-5738 3. Email: [email protected] 4. WWW URL: http://www.usenix.org MRTG – The Multi Router Traffic Grapher Tobias Oetiker – Swiss Federal Institute of Technology, Zurich ABSTRACT This paper describes the history and operation of the current version of MRTG as well as the Round Robin Database Tool. The Round Robin Database Tool is a program which logs and visualizes numerical data in a efficient manner. The RRD Tool is a key component of the next major release of the Multi Router Traffic Grapher (MRTG). It is already fully implemented and working. Because of the massive performance gain possible with RRD Tool some sites have already started to use RRD Tool in production. Motivation MRTG logged its data to an ASCII file, rewriting it every five minutes, constantly consolidating it, so In Summer 1994, the De Montfort University in that the logfile would not grow over time. The logfile Leicester, UK, had one 64 kBit Internet link for more did only store slightly more data than was needed to than 1000 networked computers. As it was not possi- draw the graphs on the web page. The graphs were ble to get a faster Internet link for another year, it was converted to GIF format by piping a graph in PNM desirable to at least provide the users on campus with format to the pnmtogif tool from the PBM pack- current and detailed information about the status of the age.
    [Show full text]
  • Index Images Download 2006 News Crack Serial Warez Full 12 Contact
    index images download 2006 news crack serial warez full 12 contact about search spacer privacy 11 logo blog new 10 cgi-bin faq rss home img default 2005 products sitemap archives 1 09 links 01 08 06 2 07 login articles support 05 keygen article 04 03 help events archive 02 register en forum software downloads 3 security 13 category 4 content 14 main 15 press media templates services icons resources info profile 16 2004 18 docs contactus files features html 20 21 5 22 page 6 misc 19 partners 24 terms 2007 23 17 i 27 top 26 9 legal 30 banners xml 29 28 7 tools projects 25 0 user feed themes linux forums jobs business 8 video email books banner reviews view graphics research feedback pdf print ads modules 2003 company blank pub games copyright common site comments people aboutus product sports logos buttons english story image uploads 31 subscribe blogs atom gallery newsletter stats careers music pages publications technology calendar stories photos papers community data history arrow submit www s web library wiki header education go internet b in advertise spam a nav mail users Images members topics disclaimer store clear feeds c awards 2002 Default general pics dir signup solutions map News public doc de weblog index2 shop contacts fr homepage travel button pixel list viewtopic documents overview tips adclick contact_us movies wp-content catalog us p staff hardware wireless global screenshots apps online version directory mobile other advertising tech welcome admin t policy faqs link 2001 training releases space member static join health
    [Show full text]
  • RES Application Guide
    ATTENTION This is NOT the application form to access RES resources. This document has been created only as a guide showing the information needed to fill the application form online. All the applications must be presented through the online form available at https://www.bsc.es/res-intranet/. 1. General Information a) Activity Title b) Area (select): Astronomy, Space and Earth Sciences Life and Health Sciences Physics Engineering and Mathematics Homogeneous Chemistry Heterogeneous Chemistry and Solids 2. Research Project Description a) Is this a Test Activity? Yes / No b) Is this a Long Term Activity that will extend over two application periods? Yes / No c) Brief description of the Project If this Activity takes place in the context of a Scientific Research Project, give a brief description of the Project, including the reference of National or International grants which support it. Summarize the research in the context of the current state-of-the-art, including references if appropriate. (Maximum 5000 characters). d) Grant References e) Brief description of the Project (If this Activity takes place in the context of a Technology or Industrial Project) If this Activity takes place in the context of a Technology or Industrial Project, give a brief description of the Project, including the potential impact resulting from this activity, in measurable terms (potential for patent applications, competitive advance, prototypes, new products, economic impact, etc.). (Maximum 5000 characters). f) Specific Activity proposed Describe the specific Activity proposed. Discuss the need for Supercomputing facilities. Describe in detail the specific calculations you plan to do, and their relevance to the Research Project.
    [Show full text]
  • Dtwiki: a Disconnection and Intermittency Tolerant Wiki
    DTWiki: A Disconnection and Intermittency Tolerant Wiki Bowei Du Eric A. Brewer Computer Science Division Computer Science Division 445 Soda Hall 623 Soda Hall University of California, Berkeley University of California, Berkeley Berkeley, CA 94720-1776 Berkeley, CA 94720-1776 [email protected] [email protected] ABSTRACT which the users can participate in writing Wikipedia articles. The Wikis have proven to be a valuable tool for collaboration and con- popularity of “wikis” [4] as website content management software tent generation on the web. Simple semantics and ease-of-use make also speaks to the usefulness of the medium. Generally speaking, wiki systems well suited for meeting many emerging region needs wikis have proven to be an excellent tool for collaboration and con- in the areas of education, collaboration and local content genera- tent generation. tion. Despite their usefulness, current wiki software does not work Several aspects of wikis are interesting for the emerging regions well in the network environments found in emerging regions. For context. First, there is a great need in emerging regions for content example, it is common to have long-lasting network partitions due that is locally relevant. Local content can take a variety of forms, to cost, power and poor connectivity. Network partitions make a from a local translation of existing online material to the commu- traditional centralized wiki architecture unusable due to the un- nity knowledge bases. Most of the content on the web today is availability of the central server. Existing solutions towards ad- written in English and targeted towards in the industrialized world.
    [Show full text]
  • Ivoyeur Changing the Game, Part 2
    iVoyeur Changing the Game, Part 2 DAVE JOSEPHSEN Dave Josephsen is the Near the end of his poem “The Talking Oak,” Tennyson alludes to the oldest of the author of Building a pagan oracles: Jupiter at Dodona . It was quite different from the oracles that fol- Monitoring Infrastructure lowed it in that no temple, altar, or human contrivance was ever constructed there . with Nagios (Prentice It was merely an oak grove on an island in the Aegean Sea . The Selli tribal priests Hall PTR, 2007) and is senior systems who lived there could decipher the word of Jupiter himself from the sound of the engineer at DBG, Inc., where he maintains wind rustling the leaves of those sacred oak trees (some stories say wind-chimes a gaggle of geographically dispersed server were also employed) . farms. He won LISA ’04’s Best Paper award for I’d read Tennyson’s poem in high school but, that being pre-Google, I never under- his co-authored work on spam mitigation, and stood his reference to “that Thessalian growth” until I recently happened to read he donates his spare time to the SourceMage about the oracle at Dodona . The resolution of that long-forgotten enigma must GNU Linux Project. have made an impression on my subconscious, because I subsequently dreamt that [email protected] I visited that ancient oracular forest and heard the whisper of its long-dead deity . His message to me? “Your Web server is down ”. I often tell people, when the subject of my occupation arises, that I’m a plumber .
    [Show full text]