<?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>Hacking With Gum &#187; Boxee</title>
	<atom:link href="http://hackingwithgum.com/tag/boxee/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackingwithgum.com</link>
	<description>A Hardware Hacking Blog</description>
	<lastBuildDate>Tue, 23 Mar 2010 00:47:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Building A Boxee Remote Control</title>
		<link>http://hackingwithgum.com/2009/09/28/building-a-boxee-remote-control/</link>
		<comments>http://hackingwithgum.com/2009/09/28/building-a-boxee-remote-control/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 02:22:36 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Routers]]></category>
		<category><![CDATA[TV]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Boxee]]></category>
		<category><![CDATA[IR]]></category>
		<category><![CDATA[Remote Control]]></category>
		<category><![CDATA[WRT54G]]></category>

		<guid isPermaLink="false">http://hackingwithgum.com/?p=234</guid>
		<description><![CDATA[After configuring my Boxee server to distribute video through the coax cabling in my house, I needed a way to control the Boxee server from other rooms. I built a remote control system that uses an ATMega328 microcontroller and a Linksys WRT54G to read IR codes from standard TV remote controls and relay them over [...]]]></description>
			<content:encoded><![CDATA[<p>After configuring my Boxee server to <a href="http://hackingwithgum.com/2009/06/01/building-a-boxee-tv-station/">distribute</a> video through the coax cabling in my house, I needed a way to control the Boxee server from other rooms.</p>
<p>I built a remote control system that uses an ATMega328 microcontroller and a Linksys WRT54G to read IR codes from standard TV remote controls and relay them over the WiFi network to a Python script running on the Boxee server.</p>
<div id="boxee_remote.flv"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<p><script type="text/javascript">
var sd = new SWFObject('https://media.dreamhost.com/mediaplayer.swf','mpl','550','443','8');
sd.addParam('allowscriptaccess','always');
sd.addParam('allowfullscreen','true');
sd.addVariable('height','433');
sd.addVariable('width','550');
sd.addVariable('file','http://hackingwithgum.com/wp-content/uploads/2009/09/boxee_remote.flv');
sd.write('boxee_remote.flv');
</script></p>
<p>Here&#8217;s how it works:</p>
<ol>
<li>An IR receiver is attached to an ATMega328 microcontroller (Arduino), which reads the IR codes from standard TV remote(s).</li>
<li>The microcontroller is also connected to the serial port of a WRT54GSv4, which is connected as a client to my WiFi network.</li>
<li>When the microcontroller receives an IR code, it pipes the code through netcat to a Python script running on the Boxee server.</li>
<li>The Python script finds the keyboard key in its lookup table that corresponds to the received IR code and then simulates that key press using the <a href="http://linux.die.net/man/1/xte">xte</a> utility.</li>
</ol>
<p><span id="more-234"></span></p>
<p>The IR receiver is a TSOP1738 which was pulled out of a broken DirectTV box that had been thrown away. Most IR receivers from old VCRs / DVD players  / whatever should also work:</p>
<div id="attachment_254" class="wp-caption aligncenter" style="width: 202px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/tsop1730.jpg"><img class="size-full wp-image-254" title="TSOP1738" src="http://hackingwithgum.com/wp-content/uploads/2009/09/tsop1730.jpg" alt="TSOP1738 Pin Out" width="192" height="147" /></a><p class="wp-caption-text">TSOP1738 Pin Out</p></div><br />
</p>
<p>The microcontroller code was kept sweet and simple using Ken Shirrif&#8217;s multi-protocol infrared Arduino <a href="http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html">library</a>. All it does is read a code from the IR receiver, check to make sure that it&#8217;s a valid code, and sends the command <em>echo &#8220;&lt;ir protocol&gt;:&lt;ir code&gt;&#8221; | nc &lt;boxee server&gt; 4919</em> to the BusyBox shell running on the WRT54G&#8217;s serial port. The Arduino code can be downloaded <a href="http:///hackingwithgum.com/wp-content/uploads/2009/09/ir.pde">here</a>.</p>
<p>The WRT54G is an old Fonera router re-loaded with <a href="http://www.polarcloud.com/firmware">Tomato</a> firmware. The router has two serial ports, one of which (/dev/ttyS0) provides a root shell; this shell is used by the microcontroller to send messages to the Boxee server:</p>
<blockquote>
<pre>
Tomato 1.25.1720

BusyBox v1.14.0 (2009-05-25 16:08:27 PDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

#
# echo "NEC:18E708F7" | nc boxee 4919
#
</pre>
</blockquote>
<p>The following schematic depicts how the ATmega328 is interfaced with the IR receiver and the router&#8217;s serial port. Both the ATmega328 and the TSOP1738 require 5v, so a 7805 regulator is used to drop router&#8217;s 12v power supply down to 5v, and suppress any power supply disturbances that may occur. The 3.3v zener diode drops the 5v output from the microcontroller down to 3.3v for the router&#8217;s TTL serial interface, while the 2200 ohm resistor limits the current through zener diode so that the it doesn&#8217;t burn out:</p>
<p><div id="attachment_281" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/ir_receiver_schematic.jpg"><img class="size-medium wp-image-281" title="Schematic" src="http://hackingwithgum.com/wp-content/uploads/2009/09/ir_receiver_schematic-300x219.jpg" alt="IR Receiver Schematic" width="300" height="219" /></a><p class="wp-caption-text">IR Receiver Schematic</p></div><br />
</p>
<p>Here is the circuit wired up to the WRT54G during testing. As you can see, the WRT54G case has plenty of room for the new circuit board:</p>
<p><div id="attachment_257" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/circuit_board_testing.jpg"><img class="size-medium wp-image-257" title="Testing The Circuit Board" src="http://hackingwithgum.com/wp-content/uploads/2009/09/circuit_board_testing-300x225.jpg" alt="Testing The Circuit Board" width="300" height="225" /></a><p class="wp-caption-text">Testing The Circuit Board</p></div><br />
</p>
<p>To mount the IR receiver, the &#8220;Cisco Systems&#8221; logo was cut away from the front panel of the case. The logo did not have any hard plastic behind it, so it was easy to cut out with a hobby knife, and is the perfect size for the TSOP1738:</p>
<p><div id="attachment_258" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/remove_cisco_logo.jpg"><img class="size-medium wp-image-258" title="The Cisco Logo Removed" src="http://hackingwithgum.com/wp-content/uploads/2009/09/remove_cisco_logo-300x225.jpg" alt="The Cisco Logo Removed" width="300" height="225" /></a><p class="wp-caption-text">The Cisco Logo Removed</p></div><br />
</p>
<p>The Cisco logo was used to cover the &#8220;Secure Easy Setup&#8221; button, so in order to use that space for the IR receiver, the SES button needed to be removed from the Linksys board as well:</p>
<p><div id="attachment_260" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/wps_button.jpg"><img class="size-medium wp-image-260" title="Secure Easy Access Button" src="http://hackingwithgum.com/wp-content/uploads/2009/09/wps_button-300x225.jpg" alt="Secure Easy Access Button" width="300" height="225" /></a><p class="wp-caption-text">Secure Easy Access Button</p></div>
<div id="attachment_259" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/no_wps_button.jpg"><img class="size-medium wp-image-259" title="Secure Easy Access Button Removed" src="http://hackingwithgum.com/wp-content/uploads/2009/09/no_wps_button-300x225.jpg" alt="Secure Easy Access Button Removed" width="300" height="225" /></a><p class="wp-caption-text">Secure Easy Access Button Removed</p></div>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/board_in_case.jpg"><img class="size-medium wp-image-261" title="Fitting The Circuit Board And IR Receiver Into The Case" src="http://hackingwithgum.com/wp-content/uploads/2009/09/board_in_case-300x225.jpg" alt="Fitting The Circuit Board And IR Receiver Into The Case" width="300" height="225" /></a><p class="wp-caption-text">Fitting The Circuit Board And IR Receiver Into The Case</p></div>
<p><div id="attachment_262" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/case_complete.jpg"><img class="size-medium wp-image-262" title="The Router, Reassembled" src="http://hackingwithgum.com/wp-content/uploads/2009/09/case_complete-300x225.jpg" alt="The Router, Reassembled" width="300" height="225" /></a><p class="wp-caption-text">The Router, Reassembled</p></div><br />
</p>
<p>With the hardware complete, as much of the logic as possible was placed into a Python script that runs on the Boxee server; this way if I need to add or change some IR codes, I can just edit the Python script, rather than re-program the microcontroller. </p>
<p>The <a href="http://hackingwithgum.com/wp-content/uploads/2009/09/ir.txt">Python script</a> runs as a daemon, and currently has codes for most of the buttons on my Sony, RC6, and NEC remote controls at home. Since Python in Linux doesn&#8217;t have an API for simulating keystrokes to GUI applications, the script uses the xte utility which is part of the <a href="http://hoopajoo.net/projects/xautomation.html">xautomation</a> package.</p>
<p>I managed to scrounge up most of the parts for this project (including the router), keeping the total cost to around $15. I&#8217;m also thinking of using a similar set-up to control other applications running on my PC.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackingwithgum.com/2009/09/28/building-a-boxee-remote-control/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Building A Boxee TV Station</title>
		<link>http://hackingwithgum.com/2009/06/01/building-a-boxee-tv-station/</link>
		<comments>http://hackingwithgum.com/2009/06/01/building-a-boxee-tv-station/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 02:09:53 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[TV]]></category>
		<category><![CDATA[Boxee]]></category>
		<category><![CDATA[DTV]]></category>
		<category><![CDATA[TV Transmitter]]></category>
		<category><![CDATA[VCR]]></category>
		<category><![CDATA[XUbuntu]]></category>

		<guid isPermaLink="false">http://hackingwithgum.com/?p=16</guid>
		<description><![CDATA[With the mandated DTV date soon approaching, I got a digital converter box along with an amplified antenna and hooked it all up to my existing analog TV only to discover how terrible DTV really is. Given the soon-to-be obsolescence of my analog TVs and the deplorable state of DTV, I started looking around for [...]]]></description>
			<content:encoded><![CDATA[<p>With the mandated DTV date soon approaching, I got a digital converter box along with an amplified antenna and hooked it all up to my existing analog TV only to discover how <a href="http://hackingwithgum.com/2009/06/01/just-how-bad-is-dtvjust-how-bad-is-dtv/">terrible</a> DTV really is. Given the soon-to-be obsolescence of my analog TVs and the deplorable state of DTV, I started looking around for alternatives (besides spending an extra $50/month on cable, of course). I ended up essentially building my own Boxee-based cable channel that I can watch on every TV in the house using an old laptop and VCR.</p>
<p><span id="more-16"></span></p>
<p>This is actually a very simple project; you likely have everything you need already:</p>
<ol>
<li>A computer; I used an old laptop that I had laying around.</li>
<li>A VCR with an audio / video input.</li>
<li>A video <a href="http://www.monoprice.com/products/product.asp?c_id=101&amp;cp_id=10114&amp;cs_id=1011407&amp;p_id=4724&amp;seq=1&amp;format=2">converter</a> to convert from your computer&#8217;s S-Video / VGA output to composite.</li>
<li>Coax to connect your VCR to your TV.</li>
</ol>
<p>VCRs basically contain small transmitters that modulate audio and video NTSC signals, usually on VHF channels 3 or 4; this is why you can simply plug the VCR output into the antenna input of your TV. We&#8217;ll use the VCR to modulate the audio and video coming from the computer into a signal that the TV understands. You can also use a video card with TV out, but the VCR had three distinct advantages for me:</p>
<ol>
<li>I had a spare VCR laying around.</li>
<li>Using the VCR lets me watch Hulu <em>and</em> my old VHS tapes.</li>
<li>Using a VCR lets me easily hook up other composite video sources to my system.</li>
</ol>
<p>If you don&#8217;t already have a VCR laying around, chances are you can take one off your friend&#8217;s hands, or pick one up from a thrift store for a few bucks. You can also buy a <a href="http://www.camcor.com/cgi-bin/cat/id=1128366216&amp;fg=118075039">TV modulator</a> if you want, but for a quarter of the price you can get a used VCR that does the same thing.</p>
<p>Before we look at hooking up the hardware, it&#8217;s easier if you install the software first. I used Xubuntu 8.10 as my OS; I first tried the more recent 9.04 version, but Boxee kept crashing. Everything works fine in 8.10 though. To get Boxee, you&#8217;ll first have to go sign up at Boxee&#8217;s <a href="http://boxee.tv">Web site</a> (it&#8217;s free), then login and follow the download instructions. They have instructions on editing your /etc/apt/sources.list file for Ubuntu distros, so just follow the right one for your release version and run:</p>
<blockquote><p>$ sudo apt-get update &amp;&amp; sudo apt-get install boxee<br />&nbsp;</p></blockquote>
<p>Once that is finished, you will also want to install the proprietary drivers for your video card (if needed). In Xubuntu this can be done by navigating to <em><strong>Applications</strong><strong> -&gt; System -&gt; Hardware Drivers</strong></em>:</p>
<p style="text-align: center;">
<div id="attachment_96" class="wp-caption aligncenter" style="width: 242px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/xubuntu_hw_drivers.jpg"><img class="size-full wp-image-96" title="Installing video card driver" src="http://hackingwithgum.com/wp-content/uploads/2009/06/xubuntu_hw_drivers.jpg" alt="Installing video card driver" width="232" height="352" /></a><p class="wp-caption-text">Installing video card driver</p></div>
<p>With your software installed, make sure Boxee is running properly by starting it from <strong><em>Applications -&gt; Multimedia -&gt; Boxee</em></strong>, or by executing it from the command line:</p>
<blockquote><p>$ /opt/boxee/Boxee<br />&nbsp;</p></blockquote>
<p>The Boxee interface is pretty intuitive, but if you want help with Boxee-specific configuration options, visit the <a href="http://forum.boxee.tv/">Boxee forums</a>. Since my PC was going to be dedicated to running Boxee, I wanted Boxee to start automatically on boot up. For this I first enabled automatic login for my user account; if you didn&#8217;t check this option during the Xubuntu installation, you can set it by navigating to <em><strong>Applications -&gt; Settings -&gt; Login Window -&gt; Security</strong></em>.</p>
<p>Next, I configured XFCE to start Boxee on login by creating a ~/.config/autostart/Boxee.Desktop file with the following contents:</p>
<blockquote><p>[Desktop Entry]<br />
Type=Application<br />
Exec=/opt/boxee/Boxee<br />
Hidden=False<br />
Terminal=False<br />
StartupNotify=False<br />
Version=0.9.4<br />
Encoding=UTF-8<br />
Name=Boxee</p></blockquote>
<p>Now that you have Boxee up and running, you have to get the video output from your PC to the VCR. If you have an S-Video output on your PC, you can <a href="http://www.epanorama.net/circuits/svideo2cvideo.html">build</a> an S-Video to composite adapter. A friend of mine had given me an S-Video / composite switch box a while back, so I just used that (if you don&#8217;t have S-Video, you can get a VGA to S-Video/composite/VGA converter for less than $30 from <a href="http://www.monoprice.com/products/product.asp?c_id=101&amp;cp_id=10114&amp;cs_id=1011407&amp;p_id=4724&amp;seq=1&amp;format=2">monoprice</a>):</p>
<div id="attachment_61" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1476.jpg"><img class="size-medium wp-image-61" title="RadioShack S-Video Switch Box" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1476-300x225.jpg" alt="S-Video to composite converter / switch-box" width="300" height="225" /></a><p class="wp-caption-text">S-Video to composite converter / switch-box</p></div>
<p>You&#8217;ll need some adapters to connect your 1/4&#8243; audio out line on the computer to the single RCA jack on the VCR. I found some adapters at a local thrift store for a few cents each:</p>
<p style="text-align: center;">
<div id="attachment_62" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1479.jpg"><img class="size-medium wp-image-62" title="1/4&quot; to RCA Adapter" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1479-300x171.jpg" alt="1/4&quot; Headphone to RCA Adapter" width="300" height="171" /></a><p class="wp-caption-text">1/4&quot; headphone to RCA adapter</p></div>
<p>Now hook up your computer&#8217;s audio output to the VCR&#8217;s audio input, the computer&#8217;s S-Video output to the VCR&#8217;s video input, and the &#8220;to TV&#8221; coax connector on the VCR to the &#8220;from antenna&#8221; coax connector on the TV:</p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1478.jpg"><img class="size-medium wp-image-63" title="Switch Box Audio &amp; Video" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1478-300x225.jpg" alt="S-Video and RCA audio wired to the switch box" width="300" height="225" /></a><p class="wp-caption-text">S-Video and RCA audio wired to the switch box</p></div>
<div id="attachment_64" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1480.jpg"><img class="size-medium wp-image-64" title="VCR hook ups" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1480-300x225.jpg" alt="Video and audio VCR inputs with coax TV output" width="300" height="225" /></a><p class="wp-caption-text">Video and audio VCR inputs with coax TV output</p></div>
<p>Since my house was already wired for cable, I connected the coax out from VCR to one of the cable splitters outside the house so I could get my own Boxee cable channel that I can watch on any TV that&#8217;s hooked up to a cable outlet:</p>
<div id="attachment_94" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1499.jpg"><img class="size-medium wp-image-94" title="Coax hookup" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1499-300x225.jpg" alt="Coax hookup" width="300" height="225" /></a><p class="wp-caption-text">Coax hookup</p></div>
<p>Most VCRs will have channel selection buttons on the front panel that controls the signal input channel; make sure this is set to the correct channel for your external <em>input</em> signal (usually this will be channel &#8220;AUX1&#8243; or &#8220;AUX2&#8243;). Select your TV <em>output</em> channel on both the VCR (usually via a switch on the back) and your TV and you&#8217;re ready to go:</p>
<div id="attachment_95" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1500.jpg"><img class="size-medium wp-image-95" title="Boxee Hulu TV" src="http://hackingwithgum.com/wp-content/uploads/2009/06/cimg1500-300x225.jpg" alt="Boxee TV" width="300" height="225" /></a><p class="wp-caption-text">Boxee TV</p></div>
]]></content:encoded>
			<wfw:commentRss>http://hackingwithgum.com/2009/06/01/building-a-boxee-tv-station/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
