<?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>bits4life &#187; Tools</title>
	<atom:link href="http://blog.export.be/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.export.be</link>
	<description>Bits and bytes for your daily life.</description>
	<lastBuildDate>Thu, 12 Nov 2009 10:55:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Velleman K8055 IO board misterhouse glue</title>
		<link>http://blog.export.be/2009/03/velleman-k8055-io-board-misterhouse-glue/</link>
		<comments>http://blog.export.be/2009/03/velleman-k8055-io-board-misterhouse-glue/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 15:21:45 +0000</pubDate>
		<dc:creator>nixo</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[misterhouse]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://blog.export.be/?p=182</guid>
		<description><![CDATA[The next device I added to my misterhouse proxy running on my router is the Velleman K8055 IO board. This is a USB powered experimental IO board with 8 outputs, 5 inputs, 2 DAC outputs and 2 analog inputs. I used the k8055 openwrt kernel module from the sourceforge project homepage.
I have compiled the module [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Velleman K8055 USB IO board" src="http://www.designnotes.com/Merchant2/graphics/00000001/K8055.JPG" alt="" width="163" height="123" />The next device I added to my misterhouse proxy running on my router is the <a title="Velleman k8055 product page" href="http://www.velleman.be/ot/en/product/view/?id=351346" target="_blank">Velleman K8055 IO board.</a> This is a USB powered experimental IO board with 8 outputs, 5 inputs, 2 DAC outputs and 2 analog inputs. I used the k8055 openwrt kernel module from <a title="K8055 openwrt kernel module" href="http://sourceforge.net/projects/k8055d/" target="_blank">the sourceforge project homepage.</a><span id="more-182"></span></p>
<p>I have compiled the module myself because there was no package available for the openwrt kamikaze 8.09 release, if you need it you can <a title="K8055 openwrt kernel module" href="http://blog.export.be/downloads/kmod-k8055d_0.1.2_2.4.35.4-brcm-2.4-1_mipsel.ipk">download it here</a> so you don&#8217;t need to install the buildroot etc.or you can install the package directly.</p>
<p class="textbox">opkg install http://blog.export.be/downloads/kmod-k8055d_0.1.2_2.4.35.4-brcm-2.4-1_mipsel.ipk<br />
opkg install kmod-usb-uhci-iv</p>
<p>Like you can see I also installed the kmod-usb-uhci-iv package which was needed for the module to work. If all went well you now a /proc/k8055/0 directory with a file for every input and output. By reading or writing to these files you can read or write values to the board.<br />
Next I wrote some misterhouse code to create misterhouse items for all the IO and the read and write commands to interface the files. Here is my code :<br />
<em>$k8055_out1 = new Generic_Item;<br />
</em> <em>$k8055_out2 = new Generic_Item;<br />
$k8055_out3 = new Generic_Item;<br />
$k8055_out4 = new Generic_Item;<br />
$k8055_out5 = new Generic_Item;<br />
$k8055_out6 = new Generic_Item;<br />
$k8055_out7 = new Generic_Item;<br />
$k8055_out8 = new Generic_Item;<br />
$k8055_in1 = new Generic_Item;<br />
$k8055_in2 = new Generic_Item;<br />
$k8055_in3 = new Generic_Item;<br />
$k8055_in4 = new Generic_Item;<br />
$k8055_in5 = new Generic_Item;<br />
$k8055_out1 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out2 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out3 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out4 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out5 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out6 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out7 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
$k8055_out8 -&gt; set_states (&#8216;aan&#8217;,'uit&#8217;);<br />
if ($state = state_changed $k8055_out1){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out1&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out1&#8242;,0);<br />
}<br />
}</em></p>
<p><em>if ($state = state_changed $k8055_out2){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out2&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out2&#8242;,0);<br />
}<br />
}</em></p>
<p><em>if ($state = state_changed $k8055_out3){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out3&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out3&#8242;,0);<br />
}<br />
}</em></p>
<p><em><em>if ($state = state_changed $k8055_out4){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out4&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out4&#8242;,0);<br />
}<br />
}</em></em></p>
<p><em><em><em>if ($state = state_changed $k8055_out5){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out5&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out5&#8242;,0);<br />
}<br />
}</em></em></em></p>
<p><em><em><em>if ($state = state_changed $k8055_out6){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out6&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out6&#8242;,0);<br />
}<br />
}</em></em></em></p>
<p><em><em><em>if ($state = state_changed $k8055_out7){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out7&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out7&#8242;,0);<br />
}<br />
}<br />
if ($state = state_changed $k8055_out8){<br />
if ($state eq &#8216;aan&#8217;) {<br />
file_write(&#8216;/proc/k8055/0/out8&#8242;,1);<br />
}<br />
else {<br />
file_write(&#8216;/proc/k8055/0/out8&#8242;,0);<br />
}<br />
}<br />
my $input;<br />
if ($New_Second){<br />
$input = file_read(&#8216;/proc/k8055/0/in1&#8242;);<br />
set $k8055_in1 $input;<br />
$input = file_read(&#8216;/proc/k8055/0/in2&#8242;);<br />
set $k8055_in2 $input;<br />
$input = file_read(&#8216;/proc/k8055/0/in3&#8242;);<br />
set $k8055_in3 $input;<br />
$input = file_read(&#8216;/proc/k8055/0/in4&#8242;);<br />
set $k8055_in4 $input;<br />
$input = file_read(&#8216;/proc/k8055/0/in5&#8242;);<br />
set $k8055_in5 $input;<br />
#print_log &#8220;Input 1 is now $input1&#8243;;<br />
}</em></em></em></p>
<p>Handles for the DA and AD ports are not yet implemented because I don&#8217;t use them for the moment.</p>
<p>Update : I just finished doing the same setup on a NSLU2 . I compiled the k8055 module via the buildroot for the ixp4xx harware. The only difference was that I had to use the kmod-usb-ohci_2.6.28.10-1_ixp4xx.ipk module instead of the uhci one. If anyone needs tha packages for the Linux OpenWrt 2.6.28.10 #2  armv5teb GNU/Linux NSLU2 harware let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.export.be/2009/03/velleman-k8055-io-board-misterhouse-glue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>1-wire usb interface and misterhouse glue</title>
		<link>http://blog.export.be/2009/03/1-wire-usb-interface-and-misterhouse-glue/</link>
		<comments>http://blog.export.be/2009/03/1-wire-usb-interface-and-misterhouse-glue/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 15:54:50 +0000</pubDate>
		<dc:creator>nixo</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[misterhouse]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://blog.export.be/?p=153</guid>
		<description><![CDATA[After installing misterhouse on my openwrt router I started adding devices. I plugged a 1-wire usb interface into my router and started playing around. There are at least two software programs that work for me in openwrt kamikaze 8.09
owserver
I installed the package owserver with the opkg command line tool
opkg -d usb install owserver
When the package [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="1-wire usb adapater" src="http://www.hobby-boards.com/catalog/images/ds9490r-a.jpg" alt="" width="100" height="80" />After installing misterhouse on my openwrt router I started adding devices. I plugged a 1-wire usb interface into my router and started playing around. There are at least two software programs that work for me in openwrt kamikaze 8.09<span id="more-153"></span></p>
<h2>owserver</h2>
<p>I installed the package owserver with the opkg command line tool</p>
<p class="textbox">opkg -d usb install owserver</p>
<p>When the package was installed i started the owserver.</p>
<p class="textbox">owserver &#8211; u -p 5555</p>
<p>On my desktop running ubuntu I installed owfs</p>
<p class="textbox">sudo apt-get install owfs</p>
<p>which is the client for the owserver program and will create a filesystem whit all the sensors data.</p>
<p class="textbox">sudo mkdir /mnt/ow<br />
sudo owfs -s 192.168.1.1:5555 /mnt/ow</p>
<p>Works like a charm for me</p>
<p class="textbox">drwxr-xr-x  1 root root    8 2009-03-16 21:28 .<br />
drwxr-xr-x 22 root root 4096 2009-02-23 21:16 ..<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.096994010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.585394010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.6A6E94010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.A09B94010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.A77594010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 10.F77094010800<br />
drwxrwxrwx  1 root root    8 2009-03-19 15:59 81.E74C2A000000<br />
drwxr-xr-x  1 root root    8 2009-03-16 21:28 bus.0<br />
drwxr-xr-x  1 root root    8 2009-03-16 21:28 settings<br />
drwxr-xr-x  1 root root    8 2009-03-16 21:28 statistics<br />
drwxr-xr-x  1 root root   30 2009-03-16 21:28 structure<br />
drwxr-xr-x  1 root root    8 2009-03-16 21:28 system<br />
drwxr-xr-x  1 root root    8 2009-03-16 21:28 uncached</p>
<p>Nice if you need to share your 1-wire data over the network but what i want is to have my temperature sensors values available in misterhouse that runs on the router as well.<br />
So let&#8217;s go on to the next solution.</p>
<h2>digitemp</h2>
<p>Digitemp is another command line tool to interface a 1-wire network. To install type</p>
<p class="textbox">opkg -d usb install digitemp</p>
<p>Let&#8217;s do a first test :</p>
<p class="textbox">root@OpenWrt:~# digitemp_DS2490 -w<br />
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane<br />
GNU Public License v2.0 &#8211; http://www.digitemp.com<br />
Found DS2490 device #1 at 003/004<br />
Turning off all DS2409 Couplers<br />
&#8230;&#8230;.<br />
Devices on the Main LAN<br />
10A09B9401080052 : DS1820/DS18S20/DS1920 Temperature Sensor<br />
105853940108009D : DS1820/DS18S20/DS1920 Temperature Sensor<br />
106A6E9401080076 : DS1820/DS18S20/DS1920 Temperature Sensor<br />
10096994010800BD : DS1820/DS18S20/DS1920 Temperature Sensor<br />
10A77594010800AF : DS1820/DS18S20/DS1920 Temperature Sensor<br />
10F7709401080053 : DS1820/DS18S20/DS1920 Temperature Sensor<br />
81E74C2A000000A5 : Unknown Family Code</p>
<p>That&#8217;s good ! Next create a conf file.</p>
<p class="textbox">digitemp -i</p>
<p> Now you can read a value like this
<p class="textbox">digitemp_DS2490 -t 2 -q -c /root/.digitemprc<br />
Feb 08 22:09:23 Sensor 2 C: 21.00 F: 69.80</p>
<p>All that we need now is some perl code to read the sensors values and store them in a misterhouse variable. I came up with the following code.</p>
<p class="textbox">use vars &#8216;$tempsensor1&#8242;;<br />
if ($New_Minute){<br />
$_=`digitemp_DS2490 -t 5 -q -c /root/.digitemprc`;<br />
/\sC:\s(.*)\sF/;<br />
$tempsensor1 = $1;<br />
print_log &#8220;Temperatuur is nu $tempsensor1&#8243;;<br />
}
</p>
<p>This is just some test code but it proofs that it works so I am happy for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.export.be/2009/03/1-wire-usb-interface-and-misterhouse-glue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XMLTV</title>
		<link>http://blog.export.be/2009/03/xmltv/</link>
		<comments>http://blog.export.be/2009/03/xmltv/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 12:47:05 +0000</pubDate>
		<dc:creator>nixo</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.export.be/?p=35</guid>
		<description><![CDATA[XMLTV is an XML based format for TV listings that is used by many software packages to provide you with TV schedules for watching and recording TV shows. Some examples of programs that can use XMLTV listings are MythTV, MV enigma dreambox plugin, etc
Some months ago I discovered that the perl module named tv_grab_be which [...]]]></description>
			<content:encoded><![CDATA[<p><a title="XMLTV homepage" href="http://wiki.xmltv.org/index.php/Main_Page" target="_blank">XMLTV</a> is an XML based format for TV listings that is used by many software packages to provide you with TV schedules for watching and recording TV shows. Some examples of programs that can use XMLTV listings are <a title="MythTV, Open Source DVR" href="http://www.mythtv.org/" target="_blank">MythTV</a>, <a title="MV: Dreambox EPG Plugin" href="http://mv.dinglisch.net/" target="_blank">MV enigma dreambox plugin</a>, etc<img class="alignleft size-full wp-image-42" title="mc2xml" src="http://blog.export.be/wp-content/uploads/2009/03/mc2xml.gif" alt="mc2xml" width="64" height="48" /></p>
<p>Some months ago I discovered that the perl module named tv_grab_be which is part of the XMLTV software suite,  was no longer working. The site also indicates that the module is  &#8220;removed due to source site blocking &#8221; So I start looking for another way to receive my TV listings. What I found was a much better and quicker tool. <a title="media center TV Listings to XMLTV.xml" href="http://mc2xml.110mb.com/" target="_blank">mc2xml</a> is a tool to do the same but offers more powerful options like provider selection, channel selection, logo downloads etc &#8230; Even the Belgium TV Vlaanderen satelite provider is selectable from the list of providers and this perfectly what I needed.</p>
<p>If you are a mythtv user, this is a must have tool in my opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.export.be/2009/03/xmltv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
