<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ed&#039;s World</title>
	<atom:link href="http://www.jellard.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jellard.co.uk</link>
	<description>Bringing data into real life in a meaningful way</description>
	<lastBuildDate>Wed, 10 Mar 2010 10:49:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MythTweet &#8211; Twitter MythTV recordings</title>
		<link>http://www.jellard.co.uk/2010/03/mythtweet-twitter-mythtv-recordings/</link>
		<comments>http://www.jellard.co.uk/2010/03/mythtweet-twitter-mythtv-recordings/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 21:32:39 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[mythtv]]></category>
		<category><![CDATA[mythTweet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=164</guid>
		<description><![CDATA[In the move to put as much of my house onto twitter as possible, MythTV was the next victim.  I&#8217;d previously made a PHP script that sent MSN alerts, but now I don&#8217;t use MSN, it needed a revamp.

I knocked up a small PHP script that grabs the backend status, finds what is being [...]]]></description>
			<content:encoded><![CDATA[<p>In the move to put as much of my house onto twitter as possible, MythTV was the next victim.  I&#8217;d previously made a PHP script that sent MSN alerts, but now I don&#8217;t use MSN, it needed a revamp.</p>
<p><img src="http://www.jellard.co.uk/wp-content/uploads/2010/03/Screenshot-1.png" alt="MythTweet" /></p>
<p>I knocked up a small PHP script that grabs the backend status, finds what is being recorded or watched, compares with the previous run, and sends a message to twitter using wget.</p>
<p>To use it, grab the <a href="http://www.jellard.co.uk/wp-content/uploads/2010/03/mythTweet.phps">script</a>, change the username/password variables, chmod +x it, and then add it to your &#8220;Startup Applications&#8221; or equivalent if you&#8217;re not using Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2010/03/mythtweet-twitter-mythtv-recordings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handwritten post-it notes generated from Google Calendar</title>
		<link>http://www.jellard.co.uk/2010/02/handwritten-post-it-notes-generated-from-google-calendar/</link>
		<comments>http://www.jellard.co.uk/2010/02/handwritten-post-it-notes-generated-from-google-calendar/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 20:44:26 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scouts]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=186</guid>
		<description><![CDATA[ I&#8217;ve recently created a new website for my scout group, Highfield Scouts, and have put up a google calendar.  More out of a challenge than a real need, I&#8217;ve knocked up a script that uses the Google Data API for PHP to query my calendar feed, grab the next event, and make a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2010/02/scouts4.jpg" style="float: left; margin: 10px;" alt="Scouts" /> I&#8217;ve recently created a new website for my scout group, <a href="http://www.highfieldscouts.org.uk">Highfield Scouts</a>, and have put up a google calendar.  More out of a challenge than a real need, I&#8217;ve knocked up a script that uses the <a href="http://code.google.com/apis/calendar/data/1.0/developers_guide_php.html">Google Data API for PHP</a> to query my calendar feed, grab the next event, and make a fake handwritten postit note.  The script runs every hour to keep the images up to date.</p>
<p>I&#8217;ve made a little markup system so that the whole postit can be a link, and the time and location can be overridden (child protection malarky &#8211; can&#8217;t just put a time and location for some things!)</p>
<p>It&#8217;s all written in PHP, using the GD graphics features to put the text on a background image.  If you&#8217;re interested in the code, comment, and I&#8217;ll give it to you (if you link to me!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2010/02/handwritten-post-it-notes-generated-from-google-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing Firefox to access local javascript files</title>
		<link>http://www.jellard.co.uk/2010/02/allowing-firefox-to-access-local-javascript-files/</link>
		<comments>http://www.jellard.co.uk/2010/02/allowing-firefox-to-access-local-javascript-files/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 11:43:23 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=177</guid>
		<description><![CDATA[If you have HTML/javascript files sitting on your harddisk and you want to open them in firefox and actually use the javascript, you need to change one simple setting.
First, go to about:config (just type it in the address bar and hit enter)
Then filter for &#8220;origin&#8221;.
Change &#8220;security.fileuri.strict_origin_policy&#8221; to false.
You should now be able to use local [...]]]></description>
			<content:encoded><![CDATA[<p>If you have HTML/javascript files sitting on your harddisk and you want to open them in firefox and actually use the javascript, you need to change one simple setting.</p>
<p>First, go to about:config (just type it in the address bar and hit enter)</p>
<p>Then filter for &#8220;origin&#8221;.</p>
<p>Change &#8220;security.fileuri.strict_origin_policy&#8221; to false.</p>
<p>You should now be able to use local javascript files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2010/02/allowing-firefox-to-access-local-javascript-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Google mail number of unread emails script</title>
		<link>http://www.jellard.co.uk/2010/01/improved-google-mail-number-of-unread-emails-script/</link>
		<comments>http://www.jellard.co.uk/2010/01/improved-google-mail-number-of-unread-emails-script/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 12:20:17 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ambient light]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=173</guid>
		<description><![CDATA[Since writing &#8220;Get number of unread posts from google mail&#8221;, I realised that I didn&#8217;t care about a lot of emails that I get on a regular basis, things like ebuyer emails, stock-market alerts etc.  I only want to be notified when I&#8217;ve got emails from real people.
By applying a &#8220;Newsletters&#8221; label on GMail [...]]]></description>
			<content:encoded><![CDATA[<p>Since writing <a href="http://www.jellard.co.uk/2009/11/get-number-of-unread-posts-from-google-mail/">&#8220;Get number of unread posts from google mail&#8221;</a>, I realised that I didn&#8217;t care about a lot of emails that I get on a regular basis, things like ebuyer emails, stock-market alerts etc.  I only want to be notified when I&#8217;ve got emails from real people.</p>
<p>By applying a &#8220;Newsletters&#8221; label on GMail to all automated messages by filtering messages, I can now see how many unread emails I have, then subtract the number of unread newsletters I have, and flash the ambient light that number of times.</p>
<p>Grab <a href="/wp-content/uploads/getGoogleMail.sh">getGoogleMail.sh</a>, change the usernames and passwords, and change &#8220;Newsletters&#8221; to whatever your google label is.  Then use the $count variable to do whatever you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2010/01/improved-google-mail-number-of-unread-emails-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hampshire Twittering Traffic-Jams &#8211; SMS alerts &#8211; @hants_motorway</title>
		<link>http://www.jellard.co.uk/2010/01/hampshire-twittering-traffic-jams/</link>
		<comments>http://www.jellard.co.uk/2010/01/hampshire-twittering-traffic-jams/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 09:17:54 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[hants_motorway]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=130</guid>
		<description><![CDATA[Something that drives me nuts is every so often there&#8217;ll be an accident on the M3 or M27 and the entire surrounding area will be flooded with people trying to avoid the deadlock, only to find they&#8217;re on a tiny road with thousands of other people.  Yes, I could check the traffic websites each [...]]]></description>
			<content:encoded><![CDATA[<p>Something that drives me nuts is every so often there&#8217;ll be an accident on the M3 or M27 and the entire surrounding area will be flooded with people trying to avoid the deadlock, only to find they&#8217;re on a tiny road with thousands of other people.  Yes, I could check the traffic websites each morning, or do some intelligent parsing of traffic RSS feeds, but the first option requires effort before 9am (not going to happen), and the second option is never going to be reliable enough &#8211; it&#8217;d be too hard to programmatically determine how bad the conditions on the road really are.</p>
<p><a href="http://twitter.com/hants_motorway"><img src="http://www.jellard.co.uk/wp-content/uploads/2010/01/hants_motorway1.png" alt="Twitter feed" /></a></p>
<p><span id="more-130"></span></p>
<p>What I really want is a text message telling me which junctions on the M27 and M3 are delayed and roughly what their speed are.  While I don&#8217;t actually use the motorways to get to work, if they&#8217;re gridlocked, the surrounding country-roads tend to also be gridlocked, so this should work.  My house already texts me thanks to twitter, so that part of the system is easy, and has the bonus of other people can use it.</p>
<p>After discovering a site that gives average speeds between junctions, cogs started to whir.  Unfortunately the site doesn&#8217;t provide a nice feed, but that wasn&#8217;t going to stop me.</p>
<p>A few hours of Java hacking later, <a href="http://twitter.com/hants_motorway">@hants_motorway</a> was born.</p>
<p>Every 20 minutes, between 7am-10am and 4pm-7pm, the speeds of each junction between J2-J12 on M27 and J4-J14 on M3 are recorded in a database, and compared against the speed of that junction at that time in the previous month.  If it is less than 45%, it assumes there&#8217;s a delay and puts a message on Twitter.  When the list of junctions delayed change, or the delays end, another message is put on Twitter.</p>
<p>I&#8217;ve setup my personal account (<a href="http://twitter.com/ejellard">@ejellard</a>) to follow @hants_motorway and to text me each update.</p>
<p>I&#8217;m hoping that this means that those driving from the Southampton area to some location near Winchester won&#8217;t have to sit in stupid amounts of traffic.  I obviously can&#8217;t guarantee it&#8217;s accuracy, and no doubt my house will have a power-cut or network outage the one day it would be useful, but it shouldn&#8217;t give false-positives (or negatives, depending which way you look at it).  Let me know what you think, and if there are any better ways of doing this.</p>
<p><a name="graph"></a><br />
And purely because I can, here&#8217;s an &#8220;interesting&#8221; graph of road speeds of different junctions along the M3:<br />
<img src="http://chart.apis.google.com/chart?cht=r&#038;chs=400x400&#038;chdl=J1|J10|J11|J12|J2|J3|J4|J4A|J5|J6|J7|J8|J9&#038;chd=t:64,66,69,60,60,69,68,65,68,69,69,68,68,69,69,69,69,66,68,68,67,70,67,68,64|63,63,62,61,62,65,65,54,34,34,46,65,67,67,68,68,68,66,67,68,68,67,66,65,63|63,62,61,60,62,65,64,49,35,38,51,65,66,66,67,67,65,63,65,67,66,66,65,65,63|64,62,61,63,63,66,65,48,38,44,61,66,67,66,66,66,66,63,65,67,66,67,66,66,64|67,70,70,68,68,68,68,61,49,41,51,67,69,69,68,66,68,63,63,63,68,70,70,69,67|62,62,62,64,66,67,66,47,41,43,61,68,68,69,69,69,68,65,66,69,69,68,67,65,62|62,62,62,64,66,67,66,46,41,43,62,69,68,69,69,69,68,66,67,69,69,68,67,65,62|69,67,69,68,69,70,69,55,44,49,66,69,70,70,70,70,69,67,68,70,70,69,69,69,69|68,67,64,66,68,69,70,69,68,69,70,69,70,70,70,70,70,69,69,70,69,69,69,69,68|68,67,64,66,68,69,70,69,69,70,70,69,70,70,70,70,70,69,69,70,69,69,69,69,68|66,64,64,63,64,66,67,65,67,69,69,69,69,69,70,69,69,69,69,70,69,69,67,68,66|64,62,62,63,65,66,67,64,67,68,68,69,69,69,69,69,69,68,69,69,69,69,68,67,64|64,62,63,63,65,67,67,64,66,67,67,68,69,69,69,69,69,68,69,69,69,68,68,67,64&#038;chco=0000FF,00FF00,00FFFF,FF0000,FF00FF,FFFF00,000088,008800,008888,880000,880088&#038;chxt=x&#038;chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23" alt="M3 Roadspeeds" /></p>
<p>And the M27:<br />
<img src="http://chart.apis.google.com/chart?cht=r&#038;chs=400x400&#038;chdl=J10|J11|J12|J2|J3|J4|J5|J7|J8|J9&#038;chd=t:67,64,65,64,61,62,66,61,42,59,67,66,68,68,68,68,68,63,65,68,67,67,68,68,67|65,64,62,61,60,62,66,58,49,62,67,67,68,68,68,68,68,64,65,68,67,67,67,66,65|64,64,62,61,62,63,64,60,58,61,63,64,64,64,65,65,64,59,61,65,64,64,65,63,64|65,64,63,63,65,67,68,67,68,69,69,69,69,69,69,69,69,68,69,69,69,68,67,67,65|65,62,62,62,64,66,68,66,62,64,68,68,68,69,69,69,69,68,69,68,68,68,66,66,65|63,60,59,59,60,63,66,63,56,58,66,66,67,67,67,68,67,65,66,67,65,65,64,63,63|67,65,62,63,61,62,65,64,58,61,69,67,68,66,67,68,64,56,65,69,68,68,68,67,67|67,65,62,63,61,62,65,64,58,61,69,67,68,66,67,68,64,56,65,69,68,68,68,67,67|66,66,63,62,62,63,65,64,58,58,69,69,69,69,69,69,67,59,63,69,69,68,68,68,66|67,66,64,64,63,64,67,65,59,61,68,69,69,69,69,69,67,62,64,69,68,68,68,68,67&#038;chco=0000FF,00FF00,00FFFF,FF0000,FF00FF,FFFF00,000088,008800,008888,880000,880088&#038;chxt=x&#038;chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23" alt="M27" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2010/01/hampshire-twittering-traffic-jams/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating an Ambilight mood light for your television</title>
		<link>http://www.jellard.co.uk/2009/12/creating-an-ambilight-mood-light-for-television/</link>
		<comments>http://www.jellard.co.uk/2009/12/creating-an-ambilight-mood-light-for-television/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:01:58 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ambilight]]></category>
		<category><![CDATA[BlinkM]]></category>
		<category><![CDATA[boblight]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=120</guid>
		<description><![CDATA[In the struggle to find more cool things to do with the arduino, I thought I&#8217;d do what someone on twitter had done, make an &#8220;Ambilight&#8221;, an ambient light behind your TV that colours whatever is behind your TV the same colour as the average colour on your screen &#8211; pretty cool!  Some Philips TV [...]]]></description>
			<content:encoded><![CDATA[<p>In the struggle to find more cool things to do with the arduino, I thought I&#8217;d do what someone on twitter had done, make an &#8220;Ambilight&#8221;, an ambient light behind your TV that colours whatever is behind your TV the same colour as the average colour on your screen &#8211; pretty cool!  Some Philips TV have this, but I&#8217;m not willing to spend extra on that (and I have a TV).  I read <a href="http://geekswithblogs.net/kobush/Default.aspx">Szymon Kobalczyk&#8217;s Blog</a> and thought I&#8217;d give it a whirl.  Currently I&#8217;m using one of my existing BlinkMs, but I&#8217;ve ordered two RGB LED strips and the necessary (hopefully) components from farnell.</p>
<p>The core idea is:</p>
<ul>
<li>Run &#8220;Boblightd&#8221;, which monitors the screen (excuse the pun) and calculates the average colour, passing it to a program that sends the message via serial to&#8230;</li>
<li>An arduino listening for colours, and changes the colour of the BlinkM/RGB LED strip accordingly</li>
</ul>
<p>This is the result of mine on my computer monitor, looks much better in real life (skip to 30-40s for best demo).  Will be even better when the RGB LED strip arrives &#8211; that&#8217;ll be going behind my 42&#8243; TV downstairs.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/uG-n-HkXHG4&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/uG-n-HkXHG4&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<span id="more-120"></span><br />
<strong>Installing Boblightd on Ubuntu Karmic</strong></p>
<p>Installing Boblightd wasn&#8217;t quite so straightforward as I&#8217;d hoped as it requires a whole bunch of dependencies, and on my two machines, it needed a different bunch (despite both being the most up to date Ubuntu Karmic).  For some reason, the boblightd webserver is blocking my IP address (not a static IP address) but fortunately, downloads still work &#8211; I&#8217;m using <a href="http://www.xs4all.nl/~loosen/boblight/boblight-1.3.tar.gz">version 1.3</a></p>
<p>First, the dependencies:</p>
<p>sudo apt-get install libx11-dev libxpm-dev x11proto-xext-dev libxext-dev libx11-dev libxrender-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev libportaudio-dev mesa-common-dev</p>
<p>Then, run ./configure, make and sudo make install</p>
<p>Grab my <a href="http://www.jellard.co.uk/wp-content/uploads/2009/12/popen.conf" target="_blank">config file</a> and change the script location to wherever you will be putting the following script.</p>
<p><strong>The Perl Script</strong></p>
<p>Boblightd runs a specified program, and prints three floats to stdin, space separated, and then a new line, and repeats.  This perl script is one loop that gets the standard in, splits it on the space, converts the floats to ints, and then to hex, and then writes it to the serial port (after checking it is different from the last one, just to save arduino processing time).  Change ttyUSB1 to wherever your arduino is.</p>
<pre>#!/usr/bin/perl -w
use Device::SerialPort qw( <img src='http://www.jellard.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ARAM :STAT 0.07 );
use Time::localtime;
my $PORT = "/dev/ttyUSB1";

my $ob = Device::SerialPort-&gt;new($PORT);
$ob-&gt;baudrate(115200);
$ob-&gt;write_settings;
open(SERIAL, "+&lt;$PORT");
$lastOutput = "";
while (1) {
        $in = &lt;STDIN&gt;;
        @rgb = split(/ /, $in);
        $r = int($rgb[0] * 255);
        $g = int($rgb[1] * 255);
        $b = int($rgb[2] * 255);

        $rHex = sprintf("%02X", $r);
        $gHex = sprintf("%02X", $g);
        $bHex = sprintf("%02X", $b);

        $output = "$rHex$gHex$bHex\n";
        if ($lastOutput ne $output) {
                print SERIAL $output;
                print $output;
                $lastOutput = $output;
        }
}</pre>
<p>If you haven&#8217;t already got Device::SerialPort, run these (as root):</p>
<p>perl -MCPAN -e shell</p>
<p>install Device::SerialPort</p>
<p><strong>The Arduino Code</strong></p>
<p>The Arduino code is very simple, hacked from the BlinkM Tester example.  Remember to Sketch &gt; Add File and include the BlinkM_funcs.h file before trying to run this.  Change blinkm_addr to the address of your BlinkM (probably 0&#215;09).</p>
<p><code> </code></p>
<pre>#include "Wire.h"
#include "BlinkM_funcs.h"
#define BLINKM_ARDUINO_POWERED 0
byte blinkm_addr = 0x01;
#include
char serInStr[30];

void setup()
{
  BlinkM_begin();
  delay(100);
  Serial.begin(115200);
  BlinkM_stopScript( blinkm_addr );
  BlinkM_setRGB( blinkm_addr, 0,0,0);
}

void loop()
{
  if( readSerialString() ) {
     byte r = toHex( serInStr[0],serInStr[1] );
     byte g = toHex( serInStr[2],serInStr[3] );
     byte b = toHex( serInStr[4],serInStr[5] );
     BlinkM_setRGB( blinkm_addr, r,g,b);
  }
}
#include
uint8_t toHex(char hi, char lo)
{
  uint8_t b;
  hi = toupper(hi);
  if( isxdigit(hi) ) {
    if( hi &gt; '9' ) hi -= 7;
    hi -= 0x30;
    b = hi&lt;&lt;4;
    lo = toupper(lo);
    if( isxdigit(lo) ) {
      if( lo &gt; '9' ) lo -= 7;
      lo -= 0x30;
      b = b + lo;
      return b;
    }
  }
  return 0;
}
uint8_t readSerialString()
{
  if(!Serial.available()) {
    return 0;
  }
  delay(5);
  int i = 0;
  while (Serial.available()) {
    serInStr[i] = Serial.read();
    i++;
  }
  serInStr[i] = 0;
  return i;
}</pre>
<p><strong>Putting it all together</strong></p>
<p>Upload the arduino code.</p>
<p>Run boblightd -c popen.conf</p>
<p>Run boblight-X11</p>
<p>And now watch a movie, simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2009/12/creating-an-ambilight-mood-light-for-television/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web based photo galleries &#8211; the unusable and the reasonable</title>
		<link>http://www.jellard.co.uk/2009/11/web-based-photo-galleries-the-unusable-and-the-reasonable/</link>
		<comments>http://www.jellard.co.uk/2009/11/web-based-photo-galleries-the-unusable-and-the-reasonable/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 23:22:37 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[photo gallery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scouts]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=112</guid>
		<description><![CDATA[So, after yesterday&#8217;s Pinewood Derby with funky racing traffic lights, I looked for a simple, quick photo album tool to display the photos, and stumbled on Piwigo, which looked reasonable and the whole &#8220;Simple powerful&#8221; philosophy seemed to match what I wanted.  So, I downloaded the single php installer script, which automagically downloads the latest [...]]]></description>
			<content:encoded><![CDATA[<p>So, after yesterday&#8217;s Pinewood Derby with funky <a href="http://www.jellard.co.uk/2009/11/scout-racing-lights-naturally-arduino-powered/">racing traffic lights</a>, I looked for a simple, quick photo album tool to display the photos, and stumbled on <a href="http://piwigo.org/" target="_blank">Piwigo</a>, which looked reasonable and the whole &#8220;Simple powerful&#8221; philosophy seemed to match what I wanted.  So, I downloaded the single php installer script, which automagically downloads the latest version and installs everything.  So far, so good.</p>
<p>Now to actually create an album.  Yes, pretty easy. Upload a file, not so easy, but doable.  Get that file to be shown &#8211; next to impossible.  This is the worlds most convoluted software I have ever seen!  To get a photo to be shown, you first have to syncronise, then go and create thumbnails &#8211; but wait, by default the synchronise does a dummy run, so go back and tick a tick-box.  Grr, really not usable.  So, I tried looking at the documentation (which goes against my beliefs of websites should never, ever, need any help &#8211; they should be usable) and even that is appauling!  It&#8217;s a wiki with a very poor navigation structure (if there is any structure), so impossible to find anything useful.  Turn to the forums to find others having the same problem, and being told to read the instructions&#8230;</p>
<p>Right, rant over, software uninstalled.</p>
<p><a href="http://www.plogger.org/" target="_blank">Plogger</a> was the next on the list, the demo looked clean and simple &#8211; just what I needed (PHP/MySQL based).  Installed it in a couple of minutes, saw a test album had been created for me so uploaded a photo and job done &#8211; it was there!  Then spent the next hour cropping and adjusting the photos, uploaded them, and bob&#8217;s your uncle, I have a nice and simple photo gallery for the scouts!  The styling is very minimal, it&#8217;s designed to be part of a larger site, although there is one style that&#8217;s a little less minimal which I&#8217;ve gone for as there&#8217;s no &#8220;larger site&#8221; for this.</p>
<p>So steer clear of piwigo, and let me know if you have any recommendations&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2009/11/web-based-photo-galleries-the-unusable-and-the-reasonable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scout racing lights &#8211; naturally arduino powered!</title>
		<link>http://www.jellard.co.uk/2009/11/scout-racing-lights-naturally-arduino-powered/</link>
		<comments>http://www.jellard.co.uk/2009/11/scout-racing-lights-naturally-arduino-powered/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 22:23:22 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ambient light]]></category>
		<category><![CDATA[BlinkM]]></category>
		<category><![CDATA[scouts]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=101</guid>
		<description><![CDATA[Inspired by techcobweb&#8217;s SlotCarDuino, the night before our scout group&#8217;s &#8220;Pinewood Derby&#8221; (cars made by the kids from a block of wood race down a track, powered by gravity), I decided to make a traffic-light system, and an indicator to say which car one (as there&#8217;s sometimes a debate)!
So, in between power cuts (6 days on [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by techcobweb&#8217;s <a href="http://techcobweb.wordpress.com/2009/09/02/slot-car-challenge/">SlotCarDuino</a>, the night before our scout group&#8217;s &#8220;Pinewood Derby&#8221; (cars made by the kids from a block of wood race down a track, powered by gravity), I decided to make a traffic-light system, and an indicator to say which car one (as there&#8217;s sometimes a debate)!</p>
<p>So, in between power cuts (6 days on the trot of less than 8hrs of power per day), with only a few hours of awake time before the event, I dismantled my home automation system (no loss, given there&#8217;s barely any power for the heating) and connected up the breadboard, ambient lights and a couple of wires that will act as trip wires.  As there are no pull-down resistors, and I have absolutely no components, the trip-wire is connected to ground and then digital pin 3.  Running digitalWrite(3, HIGH); enables the pull-up resistor, so whenever the circuit is complete (i.e. car hasn&#8217;t driven through the wire) it reads 0.</p>
<p>The way I made the trip-wire was to stick one wire over the track, and rest it in a small uninsulated loop of wire.  A quick trip to the scout hut proved this worked, although was in serious need of some debouncing as the vibrations on the track caused the wire to jump around a little.</p>
<p><a href="http://www.jellard.co.uk/wp-content/uploads/2009/11/RaceSwitch.jpg"><img width="277" height="300" src="http://www.jellard.co.uk/wp-content/uploads/2009/11/RaceSwitch-277x300.jpg" class="attachment-medium" alt="Simple but reasonable effective race switch" title="Race Switch" /></a></p>
<p>The main loop of the code is very simple, it reads the two trip wire readings, and if one changes it increments a winning counter.  If that counter is more than 7000 (fairly random number that seems to work), it turns that lane&#8217;s ambient light green.  After that happens, when the next trip wire is broken, the appropriate light goes red.</p>
<p>I stole the one component I did have, a switch, from the B&amp;Q ambient light, and wired that up in a similar way to the trip wires.  At the start of the loop, it checks this value to see if it has changed (the button is a normal switch, not a temporary push-button), and if it has changed (after some debouncing), it resets some variables, checks the trip-wires have been reconnected (and if not, flash the appropriate light), then runs the red-amber-green starting sequence.</p>
<p>The kids seemed to like it, and other than the odd dodgy connection, and a particularly streamlined car going under the wire, it worked perfectly!!</p>
<p>Next year will be a little more high-tech as I&#8217;ll change the trip-wires to some kind of optical sensor, and possibly have one at the start of the race so we can display track times, speeds etc.  May even make an automatic releaser, we shall see&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2009/11/scout-racing-lights-naturally-arduino-powered/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ambient Light and Arduino boxed up and ready to rumble</title>
		<link>http://www.jellard.co.uk/2009/11/ambient-light-and-arduino-boxed-up-and-ready-to-rumble/</link>
		<comments>http://www.jellard.co.uk/2009/11/ambient-light-and-arduino-boxed-up-and-ready-to-rumble/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:30:30 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[AM comms]]></category>
		<category><![CDATA[ambient light]]></category>
		<category><![CDATA[BlinkM]]></category>
		<category><![CDATA[central heating ctrl]]></category>
		<category><![CDATA[current cost]]></category>
		<category><![CDATA[home easy]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=99</guid>
		<description><![CDATA[One bitsbox order and a trip to buy some deodorant later, and my arduino is boxed up, and ambient light has a stand!

The cap off an addidas deoderant can makes a nice enough base for the orb from a B&#38;Q disco lamp (no link as can&#8217;t find it online).  I soldered the ends of some [...]]]></description>
			<content:encoded><![CDATA[<p>One bitsbox order and a trip to buy some deodorant later, and my arduino is boxed up, and ambient light has a stand!</p>
<p><a href="http://www.jellard.co.uk/wp-content/uploads/2009/11/IMG_4495.JPG"><img class="attachment-medium" title="Ambient Light and Box" src="http://www.jellard.co.uk/wp-content/uploads/2009/11/IMG_4495-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p>The cap off an addidas deoderant can makes a nice enough base for the orb from a B&amp;Q disco lamp (no link as can&#8217;t find it online).  I soldered the ends of some CAT5 to the BlinkM, and left the other ends loose to be shoved into the arduino.</p>
<p><a href="http://www.jellard.co.uk/wp-content/uploads/2009/11/IMG_4500.JPG"><img class="attachment-medium" title="The insides" src="http://www.jellard.co.uk/wp-content/uploads/2009/11/IMG_4500-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p>As I&#8217;ve got an arduino and ethernet shield, I went for the second <a href="http://www.bitsbox.co.uk/boxes.html">largest ABS box</a> and even then, I had to break off the screw connectors on one side so that the plugs could stick through the outside.  I soldered the AM receiver and transmitter onto a small piece of stripboard (also from bitsbox), added a couple of wires for aerials (with a knot in each to prevent someone pulling it out the circuit).  So that&#8217;s pretty much the finished product, what a shame!  I will add a thermometer to it so it can become a thermostat in another room &#8211; eventually this&#8217;ll go in the sitting room, so will have the current cost meter producing one temperature reading from the kitchen, this one in the sitting room, and have just ordered another arduino for my bedroom&#8217;s ambient light/thermometer/development board.</p>
<p>The java code has been working nicely, turning the heating on and off via the hacked home-easy plug!  I sent a text from my phone to turn the heating on, very proud of actually finding a use for it as I was stuck in traffic but had friends coming round so the heating would have cut out at 5.30 (it heats up til 5.30, then waits for movement) &#8211; only to find there was a street power cut that has lasted 3 days (intermittently)!  So, if the power holds up a little longer, I should get a tweet tomorrow telling me how long the central heating was on for, fingers crossed!</p>
<p>So, time to write the web interface, pretty dull <img src='http://www.jellard.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2009/11/ambient-light-and-arduino-boxed-up-and-ready-to-rumble/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Home Easy Interrupts everything!</title>
		<link>http://www.jellard.co.uk/2009/11/home-easy-interrupts-everything/</link>
		<comments>http://www.jellard.co.uk/2009/11/home-easy-interrupts-everything/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 18:06:57 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[AM comms]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[home easy]]></category>

		<guid isPermaLink="false">http://www.jellard.co.uk/?p=91</guid>
		<description><![CDATA[Ok, so all the parts of the arduino code work fine &#8211; just not all at the same time! The setup is as follows:
An interrupt procedure gets the home easy (HE) signal, and sends it to a callback function.  This converts the sender/recipient/state into strings, and then publishes the data to MQTT.  Problem with this [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so all the parts of the arduino code work fine &#8211; just not all at the same time! The setup is as follows:</p>
<p>An interrupt procedure gets the home easy (HE) signal, and sends it to a callback function.  This converts the sender/recipient/state into strings, and then publishes the data to MQTT.  Problem with this is it takes time, and may be interrupted by the next HE signal.  This problem is exaggerated by the HE motion detectors, which send about 15 on/off messages one after the other.   When this happens, MQTT is interrupted and it leaves the arduino in a very strange state &#8211; loop() is paused, and nothing happens until it receives another HE signal, which kicks the arduino back into action &#8211; but by that time, any signals like &#8220;turn off the central heating&#8221; will be lost, so my energy efficient house becomes boiling hot!</p>
<p>So, after lots of hitting my head against a wall, my solution is to add the data to a global &#8220;string&#8221;, and then in the loop() method, to read this string, split it up into the MQ topic and the data to send to it, and then send it.  I have found the WString library crashes the arduino, so it&#8217;s all done by manipulating individual characters in the array.  Really missing the simplicity of Java!</p>
<p>And there are more problems&#8230;</p>
<p><span id="more-91"></span>If the arduino receives a message via MQTT at the &#8220;same&#8221; time as it receives a message via HE, the MQTT message gets lost.  Doh.  I can&#8217;t think of a guaranteed way around this problem as there&#8217;s no way of knowing when either will happen.  Fortunately the fix should be done server-side, so it&#8217;s easier to do more complex things (Java).</p>
<p>What I&#8217;ve settled for is to also queue up messages to send to the arduino into a ConcurrentLinkedQueue.  I also store the timestamp of the last message received via MQTT notifying me of a HE signal.  A thread then sits waiting for a message to be put on the queue.  If there is one, and the last received HE signal timestamp is more than 10 seconds ago, it sends the message.  It then waits a few seconds and checks that there hasn&#8217;t been a more receent HE signal received &#8211; if there was, it waits and resends, and loops until there aren&#8217;t any HE signals 10s either side of sending.</p>
<p>So, by queueing everything at each end, I think I&#8217;ve found a reasonable solution to messages getting lost.  I guess I could add some handshaking in, but that&#8217;s for another time.  Very glad I use Java for my day-job, this C stuff is horrible!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jellard.co.uk/2009/11/home-easy-interrupts-everything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
