<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RIoT Board and Xtrinsic webserver</title><link>https://community.element14.com/products/devtools/single-board-computers/riotboard/w/documents/17740/riot-board-and-xtrinsic-webserver</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RIoT Board and Xtrinsic webserver</title><link>https://community.element14.com/products/devtools/single-board-computers/riotboard/w/documents/17740/riot-board-and-xtrinsic-webserver</link><pubDate>Mon, 23 Mar 2015 13:24:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5c0e606d-dac4-499c-9e55-2360817ba254</guid><dc:creator>Former Member</dc:creator><comments>https://community.element14.com/products/devtools/single-board-computers/riotboard/w/documents/17740/riot-board-and-xtrinsic-webserver#comments</comments><description>Current Revision posted to Documents by Former Member on 3/23/2015 1:24:45 PM&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;&lt;div class="toc"&gt;&lt;ul&gt;&lt;li&gt;&lt;ul&gt;&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_Preamble"&gt;Preamble&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_The_AllinOne_HTML_page"&gt;The All-in-One HTML page&lt;/a&gt;
&lt;ul&gt;&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_LED_Control"&gt;LED Control&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_Current_temp"&gt;Current temp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_Line_Graph"&gt;Line Graph&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_Images"&gt;Images&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a class="jive-link-anchor-small" href="#jive_content_id_Start_the_server_properly"&gt;Start the server properly&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p style="margin:0;"&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;I&amp;#39;m &lt;span style="font-size:10pt;line-height:1.5em;"&gt;going to guide you through the process of making &lt;/span&gt;&lt;a class="jive-link-external-small" href="http://www.element14.com/community/community/designcenter/single-board-computers/riotboard/blog/2014/08/22/riotboard-webserver-part1--introduction" style="font-size:10pt;line-height:1.5em;" target="_blank"&gt;Tushar&amp;#39;s Webserver&lt;/a&gt;&lt;span style="font-size:10pt;line-height:1.5em;"&gt; a single aesthetically pleasing html page that works every time straight from boot.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:10pt;line-height:1.5em;"&gt;Like This...&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/724x455/__key/communityserver-wikis-components-files/00-00-00-01-73/1732.contentimage_5F00_52902.png"&gt;&lt;img alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/1732.contentimage_52902.png-724x455.png?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=eYmukNuStCXeQJlil2eMxNbL67eWLLVYLN5xaegkh9k%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=FhV6zh5jb7seIE2080YCPA==" style="max-height: 455px;max-width: 724px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 id="jive_content_id_Preamble"&gt;Preamble&lt;/h2&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;So before we start I would like to say thanks to &lt;a class="jive-link-external-small" href="http://www.element14.com/community/people/tusharp/profile" target="_blank"&gt;Tushar&lt;/a&gt; for doing all the complicated C code and php for this project, You can see how to set that up in his &lt;a class="jive-link-external-small" href="http://www.element14.com/community/community/designcenter/single-board-computers/riotboard/blog/2014/08/22/riotboard-webserver-part1--introduction" target="_blank"&gt;4 part blog, here&lt;/a&gt;.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;In this blog we are going to bring the web server sections all together into one neat webpage and get everything to start properly on boot, so it runs completely headless every time you boot it up, no issues.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#ff0000;text-decoration:underline;"&gt;For this project you will need a working version of Tushar&amp;#39;s RIoT Board and Xtrinsic webserver, if you do not have it you can go to &lt;span style="color:#ff0000;text-decoration:underline;"&gt;&lt;a class="jive-link-external-small" href="http://www.element14.com/community/community/designcenter/single-board-computers/riotboard/blog/2014/08/22/riotboard-webserver-part1--introduction" target="_blank"&gt;Tushar&amp;#39;s blog&lt;/a&gt;&lt;/span&gt; and follow that.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#ff0000;font-size:10pt;"&gt;&lt;strong&gt;Note: All of the files I have used here are in the .zip at the bottom. Simply unzip it and copy the www folder to /var and the start.sh script to /etc/init.d then run the necassary linux code (about 15 lines up) for the start script and you are done.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="font-size:12pt;text-decoration:underline;"&gt;&lt;strong&gt;If you want to make it yourself, or simply want to know the changes I have made here they are.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;So you should &lt;strong&gt;&lt;em&gt;start&lt;/em&gt;&lt;/strong&gt; with something looking like this.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/545x361/__key/communityserver-wikis-components-files/00-00-00-01-73/8688.contentimage_5F00_52903.jpg"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/8688.contentimage_52903.jpg-545x361.jpg?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=M%2FtrHDWj3tdh32pRjh8gSxz2fDdG6vUpHTf%2BiiLyALc%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=X1YqCNOJcgHbn0Nr8WRIyw==" style="max-height: 361px;max-width: 545px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;and a few webpag&lt;span style="font-size:10pt;line-height:1.5em;"&gt;es that look fairly basic.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;But we want them to look like this&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/738x463/__key/communityserver-wikis-components-files/00-00-00-01-73/5545.contentimage_5F00_52904.png"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/5545.contentimage_52904.png-738x463.png?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=a%2BlFFoU%2FUUCe2hF1ryUL1pUwIKv3PNZVjuZXshoGCWI%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=UKELo4xmgEV0y7YDH/4Btg==" style="max-height: 463px;max-width: 738px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;So there are two parts to this. Firstly getting the html page up and running to get the single webpage that does everything, and secondly to get it to run automatically on boot.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 id="jive_content_id_The_AllinOne_HTML_page"&gt;&lt;span style="text-decoration:underline;"&gt;The All-in-One HTML page&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;Being the easiest and most straightforward of the two, we&amp;#39;ll start with this. Basically we will have an HTML page with a frame for each php page and a few extra things to make it look good.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;The design for the page is a basic 2x4 table with the logos and the description going across both columns and the graph going across across two rows, and a css script to make it more eye catching and exciting. If you don&amp;#39;t want to write your own html page I have included my script below, if you do want to write your own script below I strongly recommend using a table for the layout of your page and use iframes to display the php pages, this will allow you to write you page far faster and also make it easier to find the relevant piece of code if something goes wrong.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;HTML class=&amp;#39;main&amp;#39;&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;title&amp;gt;RIoTboard Demo&amp;lt;/title&amp;gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;css.css&amp;quot;&amp;gt;
  &amp;lt;table class=&amp;quot;main&amp;quot;&amp;gt;
  &amp;lt;tr class=&amp;quot;logo&amp;quot;&amp;gt;
  &amp;lt;td colspan=2 class=&amp;quot;logo&amp;quot;&amp;gt;
  &amp;lt;img src=&amp;quot;images/riotlogo.png&amp;quot; class=&amp;quot;riotlogo&amp;quot;&amp;gt;
  &amp;lt;img src=&amp;quot;images/e14logo.png&amp;quot; class=&amp;quot;e14logo&amp;quot;&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr class=&amp;quot;header&amp;quot;&amp;gt;
  &amp;lt;td colspan=2&amp;gt;
  &amp;lt;h1&amp;gt;RIoTboard demo with Xtrinsic sensor kit&amp;lt;/h1&amp;gt;
  &amp;lt;h4&amp;gt;Xtrinsic Sensor board demo using the RIotboard hosting a webserver. This system allows the user to view the current temperature as well as a graph of the temperatures in the past. The user can then toggle the LEDs on and off from the webpage.&amp;lt;/h4&amp;gt;
  &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr class=&amp;quot;main1&amp;quot;&amp;gt;
  &amp;lt;td class=&amp;quot;main11&amp;quot;&amp;gt;
  &amp;lt;h2&amp;gt;Current Temperature&amp;lt;/h2&amp;gt;
  &amp;lt;img src=&amp;quot;images/therm.png&amp;quot; height=40 class=&amp;quot;therm&amp;quot;&amp;gt;
  &amp;lt;iframe class=&amp;quot;currenttemp&amp;quot; src=&amp;quot;current_temper.php&amp;quot; frameborder=0 scrolling=&amp;quot;no&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;td class=&amp;quot;main12&amp;quot; rowspan=2&amp;gt;
  &amp;lt;h2&amp;gt;Temperature Graph&amp;lt;/h2&amp;gt;
  &amp;lt;iframe src=&amp;quot;line_graph.php&amp;quot; class=&amp;quot;linegraph&amp;quot; frameborder=0 scrolling=&amp;quot;no&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr class=&amp;quot;main2&amp;quot;&amp;gt;
  &amp;lt;td class=&amp;quot;main21&amp;quot;&amp;gt;
  &amp;lt;h2&amp;gt;User LED Control&amp;lt;/h2&amp;gt;
  &amp;lt;iframe src=&amp;quot;led_blink.php&amp;quot;class=&amp;quot;led_control&amp;quot; frameborder=0&amp;gt;&amp;lt;/iframe&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr class=&amp;quot;inf&amp;quot;&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/HTML&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;and the css script which is named css.css&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;html.main {
  background-image:url(&amp;quot;/images/background.png&amp;quot;);
  background-size:100% 100%;
  font-family:Arial, Helvetica, sans-serif;
  }
table.main{
  border:0;
  width:80%;
  margin-left:auto;
  margin-right:auto;
  }
td{
  border:1px solid black;
  }
img.riotlogo{
  width:40%;
  float:left;
  }
img.e14logo{
  width:40%;
  float:right;
  }
td.main11{
  width:20%;
  height:75px;
  }
td[class*=&amp;#39;main&amp;#39;]{
  vertical-align:top;
  }
iframe.currenttemp{
  position: relative;
  height:50px;
  top:-30px;
  right:-5px;
  }
iframe.linegraph{
  width:98%;
  height:85%;
  }
div.ledindicator{
  background-color:#000000;
  position:absolute;
  text-decoration:overline;
  right:100px;
  width:100px;
  }
img.therm{
  z-index:-1;
  height:40px;
  }
span.temp{
  font-family:Arial, Helvetica, sans-serif;
  display:block;
  }&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;"&gt;so that that&amp;#39;s pretty much it, I slightly edited the php pages as well.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 id="jive_content_id_LED_Control"&gt;LED Control&lt;/h3&gt;&lt;p style="margin:0;"&gt;&lt;em&gt;&lt;strong&gt;on.php&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;off.php&lt;/strong&gt;&lt;/em&gt; (which run when you press the on or off button for the LED) now change the&lt;em&gt;&lt;strong&gt; led.png&lt;/strong&gt;&lt;/em&gt; image (which is the light bulb) so that the it shows whether the LED is on/off. Also I changed &lt;strong&gt;&lt;em&gt;led_blink.php&lt;/em&gt;&lt;/strong&gt;, which displays the buttons and runs the on and off scripts, so that it displays the &lt;em&gt;&lt;strong&gt;led.png&lt;/strong&gt;&lt;/em&gt; image next to the buttons.&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/208x138/__key/communityserver-wikis-components-files/00-00-00-01-73/5040.contentimage_5F00_52905.png"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/5040.contentimage_52905.png-208x138.png?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=y%2Bw0sh7yeGB7pEjeIXBJ0p39WdjkMsbw44tJdbqllQM%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=rhlAFgFVGyt4uoRWTodzKw==" style="max-height: 138px;max-width: 208px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/209x138/__key/communityserver-wikis-components-files/00-00-00-01-73/8272.contentimage_5F00_52906.png"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/8272.contentimage_52906.png-209x138.png?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=X%2FOqT5qxSM9eoXILz5MC%2BzSCXce%2BWQljgBqdAkqLmOQ%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=QHMy3suinJ4YN1iGVBtq5A==" style="max-height: 138px;max-width: 209px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 id="jive_content_id_Current_temp"&gt;Current temp&lt;/h3&gt;&lt;p style="margin:0;"&gt;The&lt;strong&gt;&lt;em&gt; current_temp.php&lt;/em&gt;&lt;/strong&gt; file I changed so that it showed the °C symbol and the font is the same as the rest of the page by reference &lt;strong&gt;&lt;em&gt;css.css&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;img loading="lazy" alt="image" class="migration-embeded-object" src="#https://www.element14.com/community/docs/DOC-71689/l/riot-board-and-xtrinsic-webserver"  /&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 id="jive_content_id_Line_Graph"&gt;Line Graph&lt;/h3&gt;&lt;p style="margin:0;"&gt;&lt;strong&gt;&lt;em&gt;Line_graph.php&lt;/em&gt;&lt;/strong&gt; has been changed a fair bit. I got rid of the title and the box to make it more simple and cleaner. I put a SQL query in that deletes all data that is older than 15 mins, so that the Pchart library doesn&amp;#39;t get overwhelmed by data (I left it running when I went to lunch, came back refreshed and the php just didn&amp;#39;t load, took me ages to work out that the pchart library has a 30s time-out for drawing the graph), you can change the kill time for data but bear in mind that data is taken every second so 15 mins of data is still 900 points of data being plotted. As you can see I have had a little problem with the X-Axis of the graph, the pchart library prints the label from every data point, and I haven&amp;#39;t yet found a way to make it tell that the label is a time and then label the axis neatly without overlaps.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;The PHP SQL query I used was&amp;nbsp; mysql_query( &amp;quot;delete from sensordata where time&amp;lt;date_add(now(),interval -15 minute)&amp;quot;);&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a href="https://community.element14.com/resized-image/__size/436x237/__key/communityserver-wikis-components-files/00-00-00-01-73/6138.contentimage_5F00_52907.png"&gt;&lt;img loading="lazy" alt="image" src="https://community-storage.element14.com/communityserver-components-secureimagefileviewer/communityserver/wikis/components/files/00/00/00/01/73/6138.contentimage_52907.png-436x237.png?sv=2016-05-31&amp;amp;sr=b&amp;amp;sig=3flODHcf2v1i70zou7mIflrnrFCxcpjBGL6yfxmimgk%3D&amp;amp;se=2026-06-12T23%3A59%3A59Z&amp;amp;sp=r&amp;amp;_=9LyHCWhyJ+QYRoCh24OhXg==" style="max-height: 237px;max-width: 436px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 id="jive_content_id_Images"&gt;Images&lt;/h3&gt;&lt;p style="margin:0;"&gt;I have added a few images all in a folder called images, keeps it neat. the first one is the background, I have set it to be used in the main html page and to be stretched so that the borders are 10% of the page each. I have also added a picture of the logos that are at the top of the page. There is also therm.png which is the thermometer for the current temperature. Finally there is BI, and &lt;strong&gt;&lt;em&gt;led.png. on.png&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;off.png&lt;/em&gt;&lt;/strong&gt; are fixed images of the bulb on and the bulb off. Everytime the on or off button is pressed then the necessary image of &lt;strong&gt;&lt;em&gt;on&lt;/em&gt;&lt;/strong&gt; or&lt;strong&gt;&lt;em&gt; off.png&lt;/em&gt;&lt;/strong&gt; is copied into &lt;strong&gt;&lt;em&gt;led.png&lt;/em&gt;&lt;/strong&gt; to be displayed. Probably not the neatest or most efficient way to do it, but it&amp;#39;s easy and simple.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h2 id="jive_content_id_Start_the_server_properly"&gt;&lt;span style="text-decoration:underline;"&gt;Start the server properly&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin:0;"&gt;One of the main problems I had when I first did Tushar&amp;#39;s server was that a lot of the permissions reset every boot meaning that you had to enter a few lines of code every time you rebooted. So that had to change. My preferred method for stuff like this is to make a custom script that runs on boot and in it are the commands that I need. To do this you need to make a script in &lt;strong&gt;&lt;em&gt;start.sh&lt;/em&gt;&lt;/strong&gt; I always call mine &lt;strong&gt;&lt;em&gt;start.sh&lt;/em&gt;&lt;/strong&gt; so it is easy to find, and in it I put all the chmod commands I needed.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;make the script&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;sudo vi /etc/init.d/start.sh&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;In the script type&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/bash
sudo chmod -R 755 /var/www/
sudo chmod 777 /var/www/images/led.png
sudo chmod 777 /sys/class/leds/user_led/brightness&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;"&gt;this allows everything in the www folder to be read and executed by Apache but not written, exactly what we need.&lt;/p&gt;&lt;p style="margin:0;"&gt;It also then allows Apache to change&amp;nbsp; led.png so that the led indicator works properly.&lt;/p&gt;&lt;p style="margin:0;"&gt;Finally and most importantly it allows Apache to change the brightness file for the user LED allowing them to run it on and off. THIS NEEDS TO HAPPEN EVERY BOOT ELSE IT DOES RESET.&lt;/p&gt;&lt;p style="margin:0;"&gt;The chmod commands other than the brightness one simply ensure that the settings are correct on boot.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;one of the other problems I was having was getting the c code to run on boot, if it doesn&amp;#39;t then the Xtrinsic temperature isn&amp;#39;t read and nothing is updated. I had a problem compiling the c code I edited to make it run without asking whether you wanted to debug or not so the command here just passes the value 0 for the user input, this disables debugging. &amp;quot;yes 0 | sudo /var/www/xtrinsic_current_temp &amp;amp;&amp;quot;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;I also put in a command that reset led.png back to the off image every boot to be accurate to the led.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;the final start.sh script should look like this&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#!/bin/bash
sudo chmod -R 755 /var/www/
sudo chmod 777 /var/www/images/led.png
sudo chmod 777 /sys/class/leds/user_led/brightness
sudo cp /var/www/images/off.png /var/www/images/led.png
yes 0 | sudo /var/www/xtrinsic_current_temp &amp;amp;&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;save the file with ESC+SHIFT+: then type wq enter&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;so now we need to tell the board to run our script on boot.This is very simple, and only needs two lines of code.&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sudo schmod +x /etc/init.d/start.sh&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;"&gt;makes the script executable&lt;/p&gt;&lt;p style="margin:0;"&gt;and then&lt;/p&gt;&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;sudo update-rc.d start.sh defaults 99&lt;/pre&gt;&lt;/p&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p style="margin:0;"&gt;tells the board to run the script on boot.&lt;/p&gt;&lt;p style="margin:0;"&gt;The second line will throw up a couple of errors as it isn&amp;#39;t actually headed correctly, but it will still run just as we need it to. If you want to header it correctly you can find the info in /etc/init.d/README&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;That should be everything. Just reboot the board and load up your internet browser on your PC and load your boards I.P. address. You should now have a fully working single html page. Test out the features by heating the xtrinsic with you hands or clicking the led buttons. The graph will refresh every time you load your page.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;If I manage to get the graph to auto reload every minute or get the graph&amp;#39;s x-axis looking ok then I will update the blog.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;Or you can download the Full image, with everything pre configured, by clicking the button below.&lt;/p&gt;&lt;p style="margin:0;font-size:13.3333339691162px;"&gt;&lt;span style="font-size:10pt;"&gt;&lt;a href="https://dl-web.dropbox.com/get/riotboard%20demo%20webserver%20SD.7z?_subject_uid=363255464&amp;amp;w=AAA5nRUaYhHKKQW2JTvF-aJzpFnod5ZbciWjiWX14G66zQ&amp;amp;dl=1" rel="nofollow ugc noopener" target="_blank"&gt;&lt;img loading="lazy" alt="image" height="76" src="http://8b00dabafb79df8fd29d-df819fbfa20aed079fcbd3a835f9ccad.r13.cf1.rackcdn.com/gfr%20download.png" style="height:76.0921658986175px;width:172px;" width="172"  /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;em&gt;&lt;strong&gt;Any problems? Just ask.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;em&gt;&lt;strong&gt;Any suggestions? Please please please comment and share.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;div class="migration-injected-attachments"&gt;&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;table style="border:0;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&lt;span class="_se_attachment" id="attid_https://www.element14.com/community/api/core/v3/attachments/159146"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-01-73/single_5F00_webpage_5F00_RIoT_5F00_server.zip"&gt;community.element14.com/.../single_5F00_webpage_5F00_RIoT_5F00_server.zip&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>