<?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>Digivation Hack Central &#187; linux</title>
	<atom:link href="http://blog.digivation.com.au/category/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.digivation.com.au</link>
	<description>Tech Information about various subjects</description>
	<lastBuildDate>Sat, 17 Sep 2011 02:57:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Mapping special names to multiple USB serial adapters</title>
		<link>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters</link>
		<comments>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:34:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Solar]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[current cost]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[device driver]]></category>
		<category><![CDATA[envi]]></category>
		<category><![CDATA[gci]]></category>
		<category><![CDATA[mains power monitor]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[watts clever]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=125</guid>
		<description><![CDATA[The watts clever envi has a USB serial adapter which is a Prolific pl2303. When inserted it is assigned /dev/ttyUSB0 by udev, among a few other symlinks. I have now obtained an RS485 serial adapter on ebay for A$13.98 delivered which uses the exact same chip, which makes it indistiguishable from the envi&#8217;s port. What [...]]]></description>
			<content:encoded><![CDATA[<p>The watts clever envi has a USB serial adapter which is a Prolific pl2303. When inserted it is assigned /dev/ttyUSB0 by udev, among a few other symlinks. I have now obtained an RS485 serial adapter on ebay for A$13.98 delivered which uses the exact same chip, which makes it indistiguishable from the envi&#8217;s port. What I needed was a way to guarantee uniqueness regardless of the enumeration order on boot or random hot plugin. Naturally, this is for the Aurora GCI which will be installed when they become available in May.</p>
<p>Researching udev a bit, I found /lib/udev/rules.d/60-persistent-serial.rules (mine is a debian system). This file shows how the standard symlinks are done. Since each USB port is unique, I should be able to use that uniqueness to map another symlink to the device.</p>
<p>Firstly plug in the device in the chosen USB port and issue<br />
<code>udevadm info --query=all --name=/dev/ttyUSB1</code></p>
<p>This shows a heap of stuff but mainly we are interested in<br />
<code>P: /devices/pci0000:00/0000:00:1a.0/usb2/2-1/2-1:1.0/ttyUSB1/tty/ttyUSB1</code></p>
<p>Create a file in <code>/etc/udev/rules.d/70-persistent-serial.rules</code> which contains</p>
<blockquote><p>
#see /lib/udev/rules.d/60-persistent-serial.rules</p>
<p>ACTION!=&#8221;add|change&#8221;, GOTO=&#8221;persistent_serial_end&#8221;<br />
SUBSYSTEM!=&#8221;tty&#8221;, GOTO=&#8221;persistent_serial_end&#8221;<br />
KERNEL!=&#8221;ttyUSB[0-9]*|ttyACM[0-9]*&#8221;, GOTO=&#8221;persistent_serial_end&#8221;</p>
<p>IMPORT=&#8221;usb_id &#8211;export %p&#8221;<br />
#IMPORT=&#8221;path_id %p&#8221;</p>
<p>ENV{ID_SERIAL}==&#8221;", GOTO=&#8221;persistent_serial_end&#8221;</p>
<p># usb nearest ethernet connector<br />
ENV{DEVPATH}==&#8221;*usb2/2-2/2-2:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/envi&#8221;<br />
#bottom front connector<br />
ENV{DEVPATH}==&#8221;*usb7/7-1/7-1:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/rs485&#8243;<br />
# usb below nearest ethernet connector<br />
ENV{DEVPATH}==&#8221;*usb2/2-1/2-1:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/rs485&#8243;</p>
<p>LABEL=&#8221;persistent_serial_end&#8221;
</p></blockquote>
<p>Replug and voila you get <code>/dev/serial/by-name/rs485</code> which will always be the correct device.</p>
<p>Now I just have to run the wire to where the GCI will be installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funny Characters for gcc/g++ errors and warnings</title>
		<link>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings</link>
		<comments>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings#comments</comments>
		<pubDate>Thu, 01 Apr 2010 03:15:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=117</guid>
		<description><![CDATA[I have found that on some linux systems when you compile with gcc and g++ the error messages have funny characters like test.c: In function â: test.c:6: warning: unused variable â This is due to the default locale being set to something other than the default. in /etc/default/locale you will have a line like LANG="en_AU.UTF-8" [...]]]></description>
			<content:encoded><![CDATA[<p>I have found that on some linux systems when you compile with gcc and g++ the error messages have funny characters like</p>
<p><code>test.c: In function â:<br />
test.c:6: warning: unused variable â<br />
</code></p>
<p>This is due to the default locale being set to something other than the default.</p>
<p>in <strong>/etc/default/locale</strong> you will have a line like</p>
<p><code>LANG="en_AU.UTF-8"</code></p>
<p>add</p>
<p><code>LC_CTYPE=C</code></p>
<p>Restart the shell and compile again and the errors are now meaningful.</p>
<p><code>test.c: In function 'main':<br />
test.c:6: warning: unused variable 'x'<br />
</code></p>
<p>Naturally you could set it in the local shell for the session, but then you would have to do it every time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphing Power Usage</title>
		<link>http://blog.digivation.com.au/category/solar/graphing-power-usage</link>
		<comments>http://blog.digivation.com.au/category/solar/graphing-power-usage#comments</comments>
		<pubDate>Wed, 24 Feb 2010 06:50:07 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Solar]]></category>
		<category><![CDATA[current cost]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[envi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mains power monitor]]></category>
		<category><![CDATA[watts clever]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=71</guid>
		<description><![CDATA[Now that I had a mains power meter, I wanted to provide visibility of the house&#8217;s power utilization. So yhe next step was to collect power usage data from the Watts clever STC4004/currentcost envi. I had a play with the linux web software that others had done before me. I implemented a MQTT server and [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I had a mains power meter, I wanted to provide visibility of the house&#8217;s power utilization. So yhe next step was to collect power usage data from the Watts clever STC4004/currentcost envi.</p>
<p>I had a play with the linux web software that others had done before me.</p>
<p>I implemented a MQTT server and used a modified perl script to write to it first, as others had done in the UK, but these people were mostly IBM employees and thought it was a good idea to have a middle man feeding data to multiple consumers. It occurred to me that this may be a bit of an overkill. All the consumers also used rrdtool in some way to present the data.</p>
<p>Then I decided to get Danny Tsang&#8217;s <a href="http://code.google.com/p/energyathome/">energy@home</a> project and after a few mods, got it going <a href="http://www.digivation.com.au/solar/energyathome/">here</a>.</p>
<p>Please don&#8217;t sit on it or I&#8217;ll have to password protect the page.</p>
<p>The benefits as I see them are:</p>
<ul>Nicer looking graph</ul>
<ul>data is sent raw and the graphing is done locally</ul>
<ul>possibility to feed new samples without uploading the whole graph each refresh period</ul>
<ul>less load in the server</ul>
<p>There are some things I still want to change, including experimenting with rrdtool, but displaying using jquery/flot which generates some very nice looking graphs.</p>
<p>I also need to daemonize the data acquisition bit, probably using daemon and some logging to wrap the datalogger.</p>
<p>There were a couple of omissions in the install details as I had to get some jgrid files to make it all work.</p>
<p>The temperature shows what it is at the server/inside as that is where the monitor it.</p>
<p>The transmitter is quite powerful and can blast over 10m from within full a metal enclosed fusebox. I suspect the 433MHz RF is coupling on the house wiring, otherwise it probably wouldn&#8217;t transmit very well. I originally extended the transmitter antenna, expecting it not to work very well, but found that it was unnecessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/solar/graphing-power-usage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Current Cost Web Linux Software</title>
		<link>http://blog.digivation.com.au/category/solar/current-cost-web-linux-software</link>
		<comments>http://blog.digivation.com.au/category/solar/current-cost-web-linux-software#comments</comments>
		<pubDate>Mon, 01 Feb 2010 23:42:15 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Solar]]></category>
		<category><![CDATA[current cost]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[envi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mains power monitor]]></category>
		<category><![CDATA[watts clever]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=11</guid>
		<description><![CDATA[I want to access the currentcost on my linux web server. I&#8217;ve found several links to what others have done. http://www.plentyways.com/blog/2009/09/how-i-created-my-home-energy-monitor/ http://www.dannytsang.co.uk/index.php/recording-currentcost-data-viewing-it-on-the-web/ http://dalelane.co.uk/blog/?p=456 http://code.google.com/p/currentcost/ http://code.google.com/p/energyathome/ http://www.metphoto.net/metmaker/projects/ http://www.metphoto.net/PDF/Current_Cost_under_Linux.pdf http://andypiper.wordpress.com/2008/12/11/current-cost-monitoring-from-an-iphone/ http://currentcost.wetpaint.com/ Ill be trying a few to see which one I go with and then start hacking. When the solar system is installed, I&#8217;ll fuse this data [...]]]></description>
			<content:encoded><![CDATA[<p>I want to access the currentcost on my linux web server.</p>
<p>I&#8217;ve found several links to what others have done.</p>
<p><a href="http://www.plentyways.com/blog/2009/09/how-i-created-my-home-energy-monitor/">http://www.plentyways.com/blog/2009/09/how-i-created-my-home-energy-monitor/</a><br />
<a href="http://www.dannytsang.co.uk/index.php/recording-currentcost-data-viewing-it-on-the-web/">http://www.dannytsang.co.uk/index.php/recording-currentcost-data-viewing-it-on-the-web/</a><br />
<a href="http://dalelane.co.uk/blog/?p=456">http://dalelane.co.uk/blog/?p=456</a><br />
<a href="http://code.google.com/p/currentcost/">http://code.google.com/p/currentcost/</a><br />
<a href="http://code.google.com/p/energyathome/">http://code.google.com/p/energyathome/</a><br />
<a href="http://www.metphoto.net/metmaker/projects/">http://www.metphoto.net/metmaker/projects/</a><br />
<a href="http://www.metphoto.net/PDF/Current_Cost_under_Linux.pdf">http://www.metphoto.net/PDF/Current_Cost_under_Linux.pdf</a><br />
<a href="http://andypiper.wordpress.com/2008/12/11/current-cost-monitoring-from-an-iphone/">http://andypiper.wordpress.com/2008/12/11/current-cost-monitoring-from-an-iphone/</a><br />
<a http://currentcost.wetpaint.com/>http://currentcost.wetpaint.com/</a></p>
<p>Ill be trying a few to see which one I go with and then start hacking. When the solar system is installed, I&#8217;ll fuse this data with the GCI data to show how the NET PFIT (Premium rate feed in tariff) is performing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/solar/current-cost-web-linux-software/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

