{"id":64,"date":"2016-02-25T22:57:19","date_gmt":"2016-02-25T22:57:19","guid":{"rendered":"http:\/\/jaerder.videmogroup.org\/blog\/?p=64"},"modified":"2016-02-25T22:57:19","modified_gmt":"2016-02-25T22:57:19","slug":"the-quest-for-a-home-monitoring-system-part-1","status":"publish","type":"post","link":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/2016\/02\/25\/the-quest-for-a-home-monitoring-system-part-1\/","title":{"rendered":"The quest for a Home Monitoring System : Part 1"},"content":{"rendered":"<h1>The quest for a Home Monitoring System : Part 1<\/h1>\n<h2>General Architecture<\/h2>\n<p>For a long , long time I wanted to have a system to monitor, and perform data collection, on my home.<br \/>\nA modular system where I could gather data from indoor and outdoor temperatures to local power consumption.<\/p>\n<figure id=\"attachment_65\" aria-describedby=\"caption-attachment-65\" style=\"width: 1604px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-65 size-full\" src=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture.png\" alt=\"CasaMonit Initial Architecute proposal\" width=\"1604\" height=\"604\" srcset=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture.png 1604w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture-300x113.png 300w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture-768x289.png 768w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture-1024x386.png 1024w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/architecture-3x1.png 3w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption id=\"caption-attachment-65\" class=\"wp-caption-text\">CasaMonit Initial Architecture proposal<\/figcaption><\/figure>\n<p>The system is meant to be designed in such manner that the server side\u00a0is fully abstracted from the sensor module side, more sensors modules may be implemented on different hardware platforms. There can be as many sensor modules as required, connected on a single Ethernet network.<\/p>\n<p>&nbsp;<\/p>\n<h2>Sensor Module Hardware (Prototype)<\/h2>\n<figure id=\"attachment_68\" aria-describedby=\"caption-attachment-68\" style=\"width: 1515px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-68\" src=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule.jpg\" alt=\"Prototype Hardware Sensor Module\" width=\"1515\" height=\"981\" srcset=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule.jpg 1515w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule-300x194.jpg 300w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule-768x497.jpg 768w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule-1024x663.jpg 1024w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/prototype_hw_sensormodule-2x1.jpg 2w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption id=\"caption-attachment-68\" class=\"wp-caption-text\">Prototype Hardware Sensor Module<\/figcaption><\/figure>\n<p><!--more--><\/p>\n<p>An Arduino is being\u00a0used as base, in order to allow for the construction of a fast prototype. Data is sent to the server via TCP\/IP, by a HTTP GET request.<br \/>\nThe Ethernet shield used is based on the MIcrochip&#8217;s ENC 28J60\u00a0Ethernet controller. \u00a0The\u00a0<a href=\"https:\/\/github.com\/ntruchsess\/arduino_uip\" target=\"_blank\">UIPEthernet<\/a> library was used, as it is a drop-in replacement for the standard Arduino Ethernet library, with support for DHCP, and DNS, \u00a0which is a huge plus, in order to integrate the sensor modules into my home network.<br \/>\nThe current prototype is connected to a 1-wire temperature sensor (a\u00a0DS18B20).<\/p>\n<h2>Server Side<\/h2>\n<h3>Hardware<\/h3>\n<p>The server should be able to run in any hardware capable of running a <a href=\"https:\/\/en.wikipedia.org\/wiki\/LAMP_(software_bundle)\" target=\"_blank\">lamp stack<\/a>.<\/p>\n<h3>Sensor Module to data base interface<\/h3>\n<p>In order to exchange information between the sensor modules and the server over tcp\/ip one of the following approaches were considered:<\/p>\n<ul>\n<li>Write an application running on the server that is capable of accepting and managing several simultaneous connections from several sensor modules. Its a more lengthy and harder approach.<\/li>\n<li>Use an already established method that can already do that is described above, but without having to write a native application from scratch.<\/li>\n<\/ul>\n<p>The method for implementing a communication method that satisfied the above criteria was to use a php script. It solves the concurrency issue, as well as its far more simple to implement.<\/p>\n<h3>Data Base Design<\/h3>\n<figure id=\"attachment_76\" aria-describedby=\"caption-attachment-76\" style=\"width: 920px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-76\" src=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/EER-Diagram.png\" alt=\"Initial EER Diagram Proposal.\" width=\"920\" height=\"590\" srcset=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/EER-Diagram.png 920w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/EER-Diagram-300x192.png 300w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/EER-Diagram-768x493.png 768w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/EER-Diagram-2x1.png 2w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption id=\"caption-attachment-76\" class=\"wp-caption-text\">Initial EER Diagram Proposal.<\/figcaption><\/figure>\n<p>The initial diagram described above does not take into account that one sensor module may have more than one sensor attached (some of my requirements changed mid development).<br \/>\nThe monitoring system must also have a catalog of the sensor modules and sensor types.<\/p>\n<h3>Front end and back end<\/h3>\n<p>As of 25th of February, I&#8217;m still undecided about the implementation, but both the back end and front end will be probably built with <a href=\"http:\/\/getbootstrap.com\/\" target=\"_blank\">bootstrap<\/a> and php.<\/p>\n<h2>Current status<\/h2>\n<p>As of today, the sensor module is already capable of sending data via Ethernet via HTTP GET method described\u00a0above, into a lamp stack installed on the development machine.<\/p>\n<figure id=\"attachment_79\" aria-describedby=\"caption-attachment-79\" style=\"width: 647px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-79\" src=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/proto_table.png\" alt=\"Prototype table. The system is already capable of recording sensor data into a database table.\" width=\"647\" height=\"382\" srcset=\"https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/proto_table.png 647w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/proto_table-300x177.png 300w, https:\/\/jaerder.videmogroup.org\/blog\/wp-content\/uploads\/2016\/02\/proto_table-2x1.png 2w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><figcaption id=\"caption-attachment-79\" class=\"wp-caption-text\">Prototype table. The system is already capable of recording sensor data into a database table.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>To be continued&#8230;..<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The quest for a Home Monitoring System : Part 1 General Architecture For a long , long time I wanted to have a system to monitor, and perform data collection, on my home. A modular system where I could gather data from indoor and outdoor temperatures to local power consumption. The system is meant to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/2016\/02\/25\/the-quest-for-a-home-monitoring-system-part-1\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The quest for a Home Monitoring System : Part 1&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13,14],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-development","category-software"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":13,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaerder.videmogroup.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}