<?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>Blogue de Guillaume DALLAIRE&#039;s Blog</title>
	<atom:link href="http://gdallaire.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://gdallaire.net/blog</link>
	<description>Some of my interests and more...</description>
	<lastBuildDate>Mon, 29 Mar 2010 12:31:18 +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>Sans fil au CÉGEP de Chicoutimi sous Ubuntu</title>
		<link>http://gdallaire.net/blog/?p=144</link>
		<comments>http://gdallaire.net/blog/?p=144#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:24:28 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Internet Infrastructure]]></category>
		<category><![CDATA[cegep]]></category>
		<category><![CDATA[chicoutimi]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=144</guid>
		<description><![CDATA[Voici la procédure pour configurer un ordinateur sous Ubuntu (9.10) pour utiliser le réseau wifi du CÉGEP de Chicoutimi:
Allez chercher votre certificat en vous connectant sur : http://sf.cegep-chiccoutimi.qc.ca (téléchargez votre certificat dans un fichier local)

Votre assistant réseau devrait détecter le réseau &#8220;cchic&#8221;, allez modifier les propriétés:

C&#8217;est un de mes étudiants, Mathieu Gaudreault, qui avec plusieurs [...]]]></description>
			<content:encoded><![CDATA[<p>Voici la procédure pour configurer un ordinateur sous Ubuntu (9.10) pour utiliser le réseau wifi du CÉGEP de Chicoutimi:</p>
<p>Allez chercher votre certificat en vous connectant sur : <a title="Outil pour obtenir un certificat" href="http://sf.cegep-chiccoutimi.qc.ca" target="_blank">http://sf.cegep-chiccoutimi.qc.ca</a> (téléchargez votre certificat dans un fichier local)</p>
<p><a href="http://gdallaire.net/blog/wp-content/uploads/2010/03/ubuntu-wireless-downloadcer.png"><img class="alignnone size-full wp-image-147" title="ubuntu-wireless-downloadcer" src="http://gdallaire.net/blog/wp-content/uploads/2010/03/ubuntu-wireless-downloadcer.png" alt="Téléchargement du certificat" width="660" height="537" /></a></p>
<p>Votre assistant réseau devrait détecter le réseau &#8220;cchic&#8221;, allez modifier les propriétés:</p>
<p><a href="http://gdallaire.net/blog/wp-content/uploads/2010/03/ubuntu-wireless-cchic.png"><img class="alignnone size-medium wp-image-145" title="ubuntu-wireless-cchic" src="http://gdallaire.net/blog/wp-content/uploads/2010/03/ubuntu-wireless-cchic-281x300.png" alt="Panneau de contrôle" width="281" height="300" /></a></p>
<p>C&#8217;est un de mes étudiants, Mathieu Gaudreault, qui avec plusieurs essais/erreurs est parvenu à trouver les bons paramètres.</p>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=144</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really basic chat client using JMS</title>
		<link>http://gdallaire.net/blog/?p=122</link>
		<comments>http://gdallaire.net/blog/?p=122#comments</comments>
		<pubDate>Tue, 23 Mar 2010 02:33:31 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=122</guid>
		<description><![CDATA[Here is a simple example of a chat client using JMS. I wrote it to show to my students how to use JMS. It implements 3 commands : /exit, /nick and /join. By default, it connects to the topic &#8220;chat.public&#8221;, entering &#8220;/join newRoom&#8221; switches the client to the &#8220;chat.newRoom&#8221; topic.
I used ActiveMQ as JMS provider. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple example of a chat client using JMS. I wrote it to show to my students how to use JMS. It implements 3 commands : /exit, /nick and /join. By default, it connects to the topic &#8220;chat.public&#8221;, entering &#8220;/join newRoom&#8221; switches the client to the &#8220;chat.newRoom&#8221; topic.</p>
<p>I used <a title="ActiveMQ's web site" href="http://activemq.apache.org/" target="_self">ActiveMQ</a> as JMS provider. See the jndi.properties file below.</p>
<p>Under Eclipse, just add &#8220;activemq-all-x.y.z.jar&#8221; as External Jar (Project&#8217;s properties, Java Build Path, Add External Jars).</p>
<pre>
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.io.*;

/**
 * very basic chat client over a JMS topic
 * 2010-03-20 Guillaume DALLAIRE
 *
 * Commands are:
 *    /exit : close connection and exit
 *    /nick xxxx : change user's name
 *    /join xxxx : change user's room
 */
public class Chat implements MessageListener
{
	private Destination currentDestination = null;
	private Session jmsSession;
	private Connection jmsConnection;
	private ConnectionFactory jmsConnectionFactory = null;
	private MessageConsumer jmsConsumer;
	private MessageProducer jmsProducer;
	private TextMessage jmsMessage;

	private String myNick = null;

	public Chat()
	{
		createSession();
		try
		{
			myNick = jmsConnection.getClientID();
		} catch (Exception e) {}
	}

	public void onMessage(Message message)
	{
		try
		{
			if (! (message instanceof TextMessage) )
			{
				//System.out.println("onMessage() received an unhandled: " + message.getClass().getName());
			}
			TextMessage textMessage = (TextMessage) message;
			System.out.println(textMessage.getText());
		}
		catch (Throwable t)
		{
			System.err.println((t instanceof JMSException) ? "JMSException" : "Throwable" + " Caught in onMessage(): " + t.getMessage());
		}
	}

	private void createSession()
	{
		try
		{
			Context jndiContext = null;

			try
			{
				jndiContext = new InitialContext();
			}
			catch (NamingException e)
			{
				System.out.println("Could not create JNDI API context: " + e.toString());
				System.exit(1);
			}

			try
			{
				jmsConnectionFactory = (ConnectionFactory) jndiContext.lookup(
					"connectionFactory");
			}
			catch (Exception e)
			{
				System.out.println("Connection: JNDI API lookup failed: " + e.toString());
				e.printStackTrace();
				System.exit(1);
			}

			jmsConnection = jmsConnectionFactory.createConnection();

			// create a session
			this.jmsSession = jmsConnection.createSession(
					false /* not transacted */, Session.AUTO_ACKNOWLEDGE);

			joinRoom("public");

			// now that everything is ready to go, start the connection
			jmsConnection.start();

			jmsMessage = jmsSession.createTextMessage();

		}
		catch (JMSException ex)
		{
			System.out.println("Error running program");
			ex.printStackTrace();
		}
	}

	private void joinRoom(String room)
	{
		// prefix all room's name with chat.
		room = "chat." + room;

		if (currentDestination != null)
		{
			try
			{
				jmsConsumer.close();
				jmsProducer.close();
			}
			catch (Exception e)
			{
			}
		}
		try
		{
			currentDestination = jmsSession.createTopic(room);

			jmsConsumer = jmsSession.createConsumer(currentDestination);
			jmsConsumer.setMessageListener(this); 			

			// create a producer
			jmsProducer = jmsSession.createProducer(currentDestination);
		}
		catch (Exception e)
		{
		}
	}

	private void sendMsg(String msg)
	{
		try
		{
			jmsMessage.setText(myNick+": "+ msg);
			jmsProducer.send(jmsMessage);
		}
		catch (JMSException ex)
		{
			System.out.println("Error running program");
			ex.printStackTrace();
		}
	}

	public void start() {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		while (true)
		{
			String str;
			try
			{
				str = in.readLine();
			}
			catch (IOException e)
			{
				break;
			}

			if (str.isEmpty())
				continue;

			if (str.equalsIgnoreCase("/exit"))
				break;
			if (str.startsWith("/nick"))
			{
				String tmp = str.substring(6);
				str = "was known as " + myNick;
				myNick = tmp;
			}
			if (str.startsWith("/join"))
			{
				sendMsg("is leaving this room...");
				joinRoom(str.substring(6));
				str = "is entering this room...";
			}
			sendMsg(str);
		}
	}

	private void closeSession()
	{
		try
		{
			jmsSession.close();
			jmsConnection.close();
		} catch (JMSException ex) {
			System.out.println("Error running program");
			ex.printStackTrace();
		}
	}

	public static void main(String args[])
	{
		Chat client = new Chat();
		client.start();
		client.closeSession();
	}
}
</pre>
<p>jndi.properties file :</p>
<pre>java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory

# use the following property to configure the default connector
java.naming.provider.url = tcp://127.0.0.1:61616

# use the following property to specify the JNDI name the connection factory
# should appear as.
connectionFactoryNames = connectionFactory
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nouveau laptop Studio XPS 1340</title>
		<link>http://gdallaire.net/blog/?p=114</link>
		<comments>http://gdallaire.net/blog/?p=114#comments</comments>
		<pubDate>Sat, 20 Mar 2010 15:54:39 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=114</guid>
		<description><![CDATA[Cette semaine j&#8217;ai changé d&#8217;ordinateur portable pour un Dell Studio XPS 1340 (écran 13&#8243; (bon ratio portabilité/ergonomie d&#8217;utilisation), Core 2 Duo 2.53GHz, 4GB DDR3 RAM, HD@7.2k RPM) : Voici un extrait de dmidecode:
System Information
        Manufacturer: Dell Inc.
        Product Name: Studio XPS [...]]]></description>
			<content:encoded><![CDATA[<p>Cette semaine j&#8217;ai changé d&#8217;ordinateur portable pour un Dell Studio XPS 1340 (écran 13&#8243; (bon ratio portabilité/ergonomie d&#8217;utilisation), Core 2 Duo 2.53GHz, 4GB DDR3 RAM, HD@7.2k RPM) : Voici un extrait de dmidecode:</p>
<pre>System Information
        Manufacturer: Dell Inc.
        Product Name: Studio XPS 1340
        Version: A07</pre>
<p>Je voulais plus de puissance pour rouler des machines virtuelles avec KVM. J&#8217;avais un netbook MSI U100 qui allait très bien mais qui était trop démuni pour supporter la virtualisation.</p>
<p>Nul besoin de dire que je n&#8217;ai même pas essayé cet ordinateur avec l&#8217;OS déjà installé par défaut (Vista) : Je l&#8217;ai soulagé en installant la dernière d&#8217;<a title="Ubuntu 9.10" href="http://www.ubuntu.com/products/whatisubuntu/910features" target="_self">Ubuntu</a> en version 64 bits.</p>
<p>Ce fût un succès, tous ses composants sont bien supportés (carte wifi, carte graphique Nvidia en mode deux écrans (<em>dual head</em>), et le reste sauf la caméra que je n&#8217;ai pas testée. Ce succès n&#8217;est pas une surprise car <a title="Wiki de Dell pour Linux" href="http://en.community.dell.com/wikis/linux/default.aspx" target="_self">Dell</a> offre ou a offert dans le passé ce modèle pré-installé avec Ubuntu.</p>
<p>Le seul défaut que je lui reproche est qu&#8217;il est un peu chaud après quelques minutes de fonctionnement (c&#8217;est légèrement désagréable quand on utilise son clavier, les mains sont appuyées sur le boitier et on sent la chaleur). Peut-être qu&#8217;il faudrait que je fasse quelques ajustements sous Linux pour qu&#8217;il limite les accès au disque ou autres choses qui génèrent trop d&#8217;activités. Apparemment je ne suis pas le seul avec ce <a title="Studio XPS 1340 overheating!" href="http://lists.us.dell.com/pipermail/linux-desktops/2009-May/002910.html" target="_self">problème</a>.</p>
<p>Autrement tout va bien, je peux rouler une VM Windows 7 en faisant pleins d&#8217;autres choses (Eclipse, Open Office, etc&#8230;.) sans problème et l&#8217;expérience est &#8220;agréable&#8221;.</p>
<p>En terminant, voici le résultat de la commande lspci:</p>
<pre>00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1)
00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b2)
00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1)
00:03.3 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.5 Co-processor: nVidia Corporation MCP79 Co-processor (rev b1)
00:04.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:04.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:06.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:06.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)
00:09.0 PCI bridge: nVidia Corporation MCP79 PCI Bridge (rev b1)
00:0a.0 Ethernet controller: nVidia Corporation MCP79 Ethernet (rev b1)
00:0b.0 SATA controller: nVidia Corporation MCP79 AHCI Controller (rev b1)
00:0c.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:10.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:15.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:16.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:17.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:18.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
01:07.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
01:07.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
01:07.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
01:07.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
01:07.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)
02:00.0 VGA compatible controller: nVidia Corporation G98 [GeForce 9200M GS] (rev a1)
03:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M G] (rev b1)
06:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)</pre>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=114</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nouveau site web pour AliConseil</title>
		<link>http://gdallaire.net/blog/?p=109</link>
		<comments>http://gdallaire.net/blog/?p=109#comments</comments>
		<pubDate>Sat, 20 Mar 2010 14:52:21 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Internet Infrastructure]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=109</guid>
		<description><![CDATA[Je viens de refaire une beauté au site web de l&#8217;entreprise de consultation alimentaire de ma conjointe : http://aliconseil.com
C&#8217;est pour moi une autre occasion d&#8217;aiguiser mes talents en SEO.
]]></description>
			<content:encoded><![CDATA[<p>Je viens de refaire une beauté au site web de l&#8217;entreprise de consultation alimentaire de ma conjointe : <a title="AliConseil" href="http://aliconseil.com" target="_self">http://aliconseil.com</a></p>
<p>C&#8217;est pour moi une autre occasion d&#8217;aiguiser mes talents en <a title="Section SEO chez Wikipedia" href="http://fr.wikipedia.org/wiki/Optimisation_pour_les_moteurs_de_recherche" target="_self">SEO</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy geocoding with Google Maps using python</title>
		<link>http://gdallaire.net/blog/?p=98</link>
		<comments>http://gdallaire.net/blog/?p=98#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:16:47 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=98</guid>
		<description><![CDATA[For a project, I had to resolve street address into geographic coordinates (geocode), here is a minimal piece of code using the Google Maps API Services :
import urllib
import json

def geocode(addr, api_key=''):
  url = "http://maps.google.com/maps/geo?q=%s&#38;output=json&#38;api_key=%s" % (urllib.quote(addr), urllib.quote(api_key))
  data = urllib.urlopen(url).read()
  return json.loads(data)['Placemark'][0]['Point']['coordinates']

data = geocode("1600 Amphitheatre Parkway Mountain View, CA 94043")
print "lat:%s long:%s" [...]]]></description>
			<content:encoded><![CDATA[<p>For a project, I had to resolve street address into geographic coordinates (<a title="geocode" href="http://en.wikipedia.org/wiki/Geocoding">geocode</a>), here is a minimal piece of code using the <a title="Google Maps API Services" href="http://code.google.com/intl/en/apis/maps/documentation/geocoding">Google Maps API Services</a> :</p>
<pre>import urllib
import json

def geocode(addr, api_key=''):
  url = "http://maps.google.com/maps/geo?q=%s&amp;output=json&amp;api_key=%s" % (urllib.quote(addr), urllib.quote(api_key))
  data = urllib.urlopen(url).read()
  return json.loads(data)['Placemark'][0]['Point']['coordinates']

data = geocode("1600 Amphitheatre Parkway Mountain View, CA 94043")
print "lat:%s long:%s" % (data[0], data[1])</pre>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=98</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring electricity usage : Part 2</title>
		<link>http://gdallaire.net/blog/?p=92</link>
		<comments>http://gdallaire.net/blog/?p=92#comments</comments>
		<pubDate>Fri, 23 Jan 2009 12:54:31 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[electronic]]></category>
		<category><![CDATA[electricity usage]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=92</guid>
		<description><![CDATA[Recently I found other ways (see my previous post) to monitor my house&#8217;s electricity usage:

http://www.theenergydetective.com
http://www.diykyoto.com/uk/wattson/about

They use current transformer clamps instead of reading the power meter&#8217;s output. I prefer this design mainly because you get instant reading (ok the power meter gives a relatively fast reading but I want &#60; second reading) and it allows you [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found other ways (see my <a href="http://gdallaire.net/blog/?p=80">previous post</a>) to monitor my house&#8217;s electricity usage:</p>
<ul>
<li><a href="http://www.theenergydetective.com">http://www.theenergydetective.com</a></li>
<li><a href="http://www.diykyoto.com/uk/wattson/about">http://www.diykyoto.com/uk/wattson/about</a></li>
</ul>
<p>They use current transformer clamps instead of reading the power meter&#8217;s output. I prefer this design mainly because you get instant reading (ok the power meter gives a relatively fast reading but I want &lt; second reading) and it allows you to compare with the power meter reading (my power meter is probably &gt; 30 years old, still accurate??).</p>
<p>Then I found this project:</p>
<p><a href="http://www.picobay.com/projects/2009/01/real-time-web-based-power-charting.html">http://www.picobay.com/projects/2009/01/real-time-web-based-power-charting.html</a></p>
<p>This is mostly what I&#8217;m planning to build. I was looking for a cheap and well documented current transformer clamp <a href="http://www.sterenshop.com/catalogo/interior3Shop.asp?pdto=PUN-285">model</a>. So I ordered 2 of these clamps.</p>
<p>More to follow&#8230;</p>
<p><img class="alignnone" src="http://www.sterenshop.com/catalogo/images_productos/grande/pun-285.jpg" alt="" width="255" height="163" /></p>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=92</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real time monitoring of your power meter now easy</title>
		<link>http://gdallaire.net/blog/?p=80</link>
		<comments>http://gdallaire.net/blog/?p=80#comments</comments>
		<pubDate>Mon, 15 Dec 2008 02:54:50 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[meter]]></category>
		<category><![CDATA[power]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=80</guid>
		<description><![CDATA[
Black and Decker introduced a rebranded version of &#8220;the Powercost Monitor&#8221; from Blue Line Innovations:  The &#8220;Power Monitor&#8220;.
The idea behind this device is to help you monitor your power consumption by installing an unit that reads your meter and transmits the information to the base station inside of your house.
An important feature is missing though [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gdallaire.net/blog/wp-content/uploads/2008/12/powerminitor.jpg"><img class="alignright size-medium wp-image-81" title="powerminitor" src="http://gdallaire.net/blog/wp-content/uploads/2008/12/powerminitor.jpg" alt="" width="300" height="183" /></a></p>
<p>Black and Decker introduced a rebranded version of &#8220;the Powercost Monitor&#8221; from <a href="http://www.bluelineinnovations.com" target="_blank">Blue Line Innovations</a>:  The &#8220;<a href="http://www.blackanddecker.com/Energy/products.aspx" target="_blank">Power Monitor</a>&#8220;.</p>
<p>The idea behind this device is to help you monitor your power consumption by installing an unit that reads <span id="body_text">your meter and transmits the information to the base station inside of your house.</span></p>
<p>An important feature is missing though : No way to interface it with a computer allowing logging and other possibilities. But the idea is good, I could just use the reader and connect its output to my systems.. Or just try to build something similar to read the spinning wheel&#8217;s RPM? To follow..</p>
<ul>
<li>Note #1: Click <a href="http://www.testfreaks.com/blog/review/black-and-decker-power-monitor/">here</a> to read a complete review.</li>
<li>Note #2: I saw this device at my local &#8220;Rona&#8221; hardware store.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=80</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAID configuration types now easy to understand</title>
		<link>http://gdallaire.net/blog/?p=77</link>
		<comments>http://gdallaire.net/blog/?p=77#comments</comments>
		<pubDate>Wed, 12 Nov 2008 20:22:16 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[joke]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=77</guid>
		<description><![CDATA[just click here lol
]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm1.static.flickr.com/44/128638167_d3fa212660_o.jpg" target="_self">just click here</a> lol</p>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=77</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RS485 Arduino Network</title>
		<link>http://gdallaire.net/blog/?p=39</link>
		<comments>http://gdallaire.net/blog/?p=39#comments</comments>
		<pubDate>Thu, 30 Oct 2008 02:52:24 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[rs485]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=39</guid>
		<description><![CDATA[Recently I started wondering about the fact that most of my MCU based projects use a RS232 serial port to exchange data between my &#8220;base&#8221; computer and every modules. Since the number of serial ports is limited (normally 2) on a normal PC, this is a problem.
After some reading, I decided to try a RS485 [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started wondering about the fact that most of my MCU based projects use a <a title="Wikipedia: RS232" href="http://en.wikipedia.org/wiki/RS-232" target="_blank">RS232</a> serial port to exchange data between my &#8220;base&#8221; computer and every modules. Since the number of serial ports is limited (normally 2) on a normal PC, this is a problem.</p>
<p>After some reading, I decided to try a <a title="Wikipedia: RS485" href="http://en.wikipedia.org/wiki/EIA-485" target="_blank">RS485</a> bus: A multipoint serial communication channel that would be both simple and cheap to implement inside my projects. The first thing to do is to test this technology by prototyping a half-duplex RS485 bus with some Arduino MCU.</p>
<div id="attachment_52" class="wp-caption alignright" style="width: 174px"><a href="http://gdallaire.net/blog/wp-content/uploads/2008/10/pinout751761.jpg"><img class="size-medium wp-image-52" title="pinout751761" src="http://gdallaire.net/blog/wp-content/uploads/2008/10/pinout751761.jpg" alt="75176 RS485 Transceiver pinout" width="164" height="137" /></a><p class="wp-caption-text">75176 RS485 Transceiver pinout</p></div>
<p>Let&#8217;s find a transceiver. Two chips seem to be commonly used : The <a title="Maxim's page for the MAX485" href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1111" target="_blank">MAX485</a> (or <a title="National Semiconductor's page for the DS485" href="http://www.national.com/pf/DS/DS485.html" target="_blank">DS485</a>, the Nationnal Semiconductor equivalent) and the <a title="Texas instruement's page for the SN75176" href="http://focus.ti.com/docs/prod/folders/print/sn75176b.html" target="_blank">SN75176BP</a>. See this Maxim comparision <a title="Maxim comparsion page" href="http://www.maxim-ic.com/alternatives.cfm/part/SN75176/pk/15" target="_blank">page</a>. I choose the <a title="Texas instruement's page for the SN75176" href="http://focus.ti.com/docs/prod/folders/print/sn75176b.html" target="_blank">SN75176BP</a>, only 0.71$CAD.</p>
<div id="attachment_53" class="wp-caption alignleft" style="width: 370px"><a href="http://gdallaire.net/blog/wp-content/uploads/2008/10/atmega8_rs485.png"><img class="size-medium wp-image-53" title="atmega8_rs485" src="http://gdallaire.net/blog/wp-content/uploads/2008/10/atmega8_rs485.png" alt="Connection between the Arduino and the 75176" width="360" height="119" /></a><p class="wp-caption-text">Connection between the Arduino and the 75176</p></div>
<p>Each MCU has its own 75176 connected to the UART (RO and DI). The RE and DE pins are connected together to a digital output allowing the MCU to control the &#8220;direction&#8221; of the data flow with the bus. When this line is LOW, the transceiver is in &#8220;receiving&#8221; mode. At a HIGH level, the transceiver switch to the &#8220;sending&#8221; mode.</p>
<p>Note that the RE/DE pins can be connected to any MCU&#8217;s digital output.</p>
<p>The RS485&#8217;s topology is multipoint. This means that every node in the network shares the same media, then without collision avoidance mechanism (which is relatively complex to implement), only one node can be defined as a master. The master sends commands or data and zero or more slaves respond to the master (It&#8217;s an important limitation).</p>
<p>I built my prototype around 1 master and 3 slaves:</p>
<div id="attachment_58" class="wp-caption aligncenter" style="width: 517px"><a href="http://gdallaire.net/blog/wp-content/uploads/2008/10/imgp32971.jpg"><img class="size-medium wp-image-58" title="imgp32971" src="http://gdallaire.net/blog/wp-content/uploads/2008/10/imgp32971.jpg" alt="My bench" width="507" height="348" /></a><p class="wp-caption-text">My bench</p></div>
<p>The blue and white wires are the RS485 physical bus. Slave #1 has 2 sensors (barometric and RH), slave #2 and #3 are simple LED display. The master reads the sensors by sending slave&#8217;s #1 address, this slave sends the values (current RH+pressure), the master reads it and finally, it sets the displays by calling each slave&#8217;s (#2 and #3) address with the data to show. The RS485 transmit function looks like this:</p>
<pre>void rs485TxMsg(char *msg)
{
  Serial.flush();
  digitalWrite(txPin, HIGH);
  delay(10);
  Serial.println(msg);
  delay(10);
  digitalWrite(txPin, LOW);
}</pre>
<p>The read function :</p>
<pre>void rs485RxMsg(char *msg, byte msgLen)
{
  byte i = 0;
  char val;
  msg[0] = 0;
  while(Serial.available())
  {
    val = Serial.read();
    if (val == '\r')
      msg[i++] = 0;
    if (val == '\n')
    {
      msg[i++] = 0;
      return;
    }
    msg[i++] = val;
    if (i&gt;msgLen)
      return;
  }
}</pre>
<p>The &#8220;message&#8221; separator are the &#8220;\r\n&#8221; characters. A more elaborate format would be needed in production and CRC checking (or equivalent) would be also a good thing.</p>
<p>For now I succesfully got a working system very easily. RS485 is simple and cheap to implement for a MCU based system.</p>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python</title>
		<link>http://gdallaire.net/blog/?p=44</link>
		<comments>http://gdallaire.net/blog/?p=44#comments</comments>
		<pubDate>Sun, 26 Oct 2008 17:36:34 +0000</pubDate>
		<dc:creator>gdallaire</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[cartoon]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://gdallaire.net/blog/?p=44</guid>
		<description><![CDATA[The Python language is present in my life since about 1 year now. It&#8217;s hard to express how good it has been for me but this cartoon is a good example of &#8220;a picture is worth a thousand words&#8221;.  Here are some other good ones about Python too:

Electric Skateboard
New Pet

]]></description>
			<content:encoded><![CDATA[<p>The <a title="Python's offcial home page" href="http://python.org" target="_self">Python</a> language is present in my life since about 1 year now. It&#8217;s hard to express how good it has been for me but this <a title="Python" href="http://xkcd.com/353/" target="_self">cartoon</a> is a good example of &#8220;a picture is worth a thousand words&#8221;.  Here are some other good ones about Python too:</p>
<ul>
<li><a title="Electric Skateboard" href="http://xkcd.com/409/" target="_self">Electric Skateboard</a></li>
<li><a title="New Pet" href="http://xkcd.com/413/" target="_self">New Pet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gdallaire.net/blog/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
