{"id":171,"date":"2017-04-11T20:54:58","date_gmt":"2017-04-11T20:54:58","guid":{"rendered":"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/?p=171"},"modified":"2018-12-08T07:32:18","modified_gmt":"2018-12-08T07:32:18","slug":"website-home-page","status":"publish","type":"post","link":"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/04\/11\/website-home-page\/","title":{"rendered":"Website Home Page"},"content":{"rendered":"<p>Right, let&#8217;s get some code for our website. The following wget shell command will fetch the files for a skeleton website from the project&#8217;s code repository, and place them in your html web content directory.<\/p>\n<pre>wget -r -nH --cut-dirs=4 --reject \"index.html*\" -P \/var\/www\/html\/ -i \/var\/www\/html\/manifest1.txt http:\/\/www.warrensoft.co.uk\/home-hub\/manifests\/website\/manifest1.txt<\/pre>\n<p>The key files are <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/home.php\" target=\"_blank\" rel=\"noopener noreferrer\">home.php<\/a>, <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/login.php\" target=\"_blank\" rel=\"noopener noreferrer\">login.php<\/a>, <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/logout.php\" target=\"_blank\" rel=\"noopener noreferrer\">logout.php<\/a>, <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/signIn.php\" target=\"_blank\" rel=\"noopener noreferrer\">signIn.php<\/a> and <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/auth.inc\" target=\"_blank\" rel=\"noopener noreferrer\">auth.inc<\/a>. A bunch of other javascript scripts and css styles will also be downloaded, which are needed for the website. There is a lot of code in this project, so I won&#8217;t go into detail about every file, but essentially home.php provides the menu structure based on the jQuery accordion. This is what you should see if you point your browser to <a href=\"http:\/\/home-hub\/home.php\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/home-hub\/home.php<\/a> and login.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-176\" src=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/HomepageMenu-150x150.png\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/HomepageMenu-150x150.png 150w, https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/HomepageMenu-100x100.png 100w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/p>\n<p>login, logout, signIn and auth provide the authentication framework, in conjunction with the Users table in the database. The skeleton database already has the hub user &#8216;pi&#8217; set up as an administrator, with the password &#8216;raspberry&#8217; . We can use this login to complete most of the tasks in upcoming posts, but you should change the password as soon as possible!. \u00a0Each of the menu items, when selected, reads in the relevant feature file. The only file provided in this first skeleton website download is <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/website\/html\/statistics.php\" target=\"_blank\" rel=\"noopener noreferrer\">statistics.php<\/a><\/p>\n<p>The Statistics page provides tables of technical data such as sensor values, actuator states, alert states, maximum\/minimum values, queued messages and system information. We have implemented this first, so we have a simple view of our sensor values, but there are many other ways to view data which we will implement in later posts.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-178 size-medium\" src=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/StatsAngleSensor-300x56.png\" alt=\"\" width=\"300\" height=\"56\" srcset=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/StatsAngleSensor-300x56.png 300w, https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/04\/StatsAngleSensor.png 725w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The skeleton database has one sensor pre-configured, the Sinewave Angle <em>virtual<\/em> sensor, but as we have no controller software running it is stuck at its last reading. \u00a0This is our next task.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Right, let&#8217;s get some code for our website. The following wget shell command will fetch the files for a skeleton website from the project&#8217;s code repository, and place them in your html web content directory. wget -r -nH &#8211;cut-dirs=4 &#8211;reject &#8220;index.html*&#8221; -P \/var\/www\/html\/ -i \/var\/www\/html\/manifest1.txt http:\/\/www.warrensoft.co.uk\/home-hub\/manifests\/website\/manifest1.txt The key files are home.php, login.php, logout.php, signIn.php and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/04\/11\/website-home-page\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Website Home Page&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-hub-software-website"],"_links":{"self":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":18,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/171\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}