<?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>Jochen Toppe&#039;s Blog</title>
	<atom:link href="http://jtoee.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jtoee.com</link>
	<description>Putting the &#62;O&#60; in technology</description>
	<lastBuildDate>Thu, 26 Apr 2012 13:09:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CQ5 &#8211; Command Line Admin</title>
		<link>http://jtoee.com/2012/04/cq5-command-line-admin/</link>
		<comments>http://jtoee.com/2012/04/cq5-command-line-admin/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 13:08:29 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[JCR]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=814</guid>
		<description><![CDATA[It&#8217;s so rare that I post here, it&#8217;s almost criminal. While researching how to best automate cloud-based installations of CQ5, I ran across these sweet command line tools to change passwords and setup replication agents. I figured they&#8217;d be worth sharin 8-) They&#8217;re right here on github.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s so rare that I post here, it&#8217;s almost criminal. While researching how to best automate cloud-based installations of CQ5, I ran across these sweet command line tools to change passwords and setup replication agents. I figured they&#8217;d be worth sharin 8-)</p>
<p>They&#8217;re right <a href="https://github.com/42Lines/cq5tools" target="_blank">here on github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2012/04/cq5-command-line-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing in Adobe/Day/CQ5</title>
		<link>http://jtoee.com/2011/09/799/</link>
		<comments>http://jtoee.com/2011/09/799/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 16:00:12 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[JCR]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=799</guid>
		<description><![CDATA[There are a two approaches to effectively test your code in CQ5 – either outside of CQ5 using standard unit tests instantiated from your build tool (i.e. maven). While this approach will cover most simple functionality, the need will quickly arise to execute unit tests within CQ5/Sling/OSGi. Testing outside of CQ5 In addition to your [...]]]></description>
			<content:encoded><![CDATA[<p>There are a two approaches to effectively test your code in CQ5 – either outside of CQ5 using standard unit tests instantiated from your build tool (i.e. maven). While this approach will cover most simple functionality, the need will quickly arise to execute unit tests within CQ5/Sling/OSGi.</p>
<h2>Testing outside of CQ5</h2>
<p>In addition to your standard junit tests, you can grab a hold of the CRX repository and start writing some basic tests against that. As you can see in the following example, you ca even wrap the JCR-repository in its Sling equivalent:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<div class="csharpcode">
<pre class="alt">package com.jtoee.cq.test;</pre>
<pre></pre>
<pre class="alt">import org.a~pache.jackrabbit.commons.JcrUtils;</pre>
<pre>import org.apache.sling.jcr.api.SlingRepository;</pre>
<pre class="alt">import org.junit.Test;</pre>
<pre>import org.slf4j.Logger;</pre>
<pre class="alt">import org.slf4j.LoggerFactory;</pre>
<pre></pre>
<pre class="alt">import javax.jcr.Repository;</pre>
<pre>import javax.jcr.RepositoryException;</pre>
<pre class="alt"></pre>
<pre><span class="kwrd">public</span> <span class="kwrd">class</span> SimpleTest {</pre>
<pre class="alt">    <span class="kwrd">private</span> Logger log = LoggerFactory.getLogger(SimpleTest.<span class="kwrd">class</span>);</pre>
<pre></pre>
<pre class="alt">    @Test</pre>
<pre>    <span class="kwrd">public</span> <span class="kwrd">void</span> runTest() {</pre>
<pre class="alt">        <span class="kwrd">try</span> {</pre>
<pre>            log.debug(<span class="str">"Connecting to respository"</span>);</pre>
<pre class="alt">            Repository repository = JcrUtils.</pre>
<pre>                    getRepository(<span class="str">"http://localhost:4502/crx/server"</span>);</pre>
<pre class="alt">            SlingRepository slingRepo =</pre>
<pre>                    <span class="kwrd">new</span> RepositoryUtil.RepositoryWrapper(repository);</pre>
<pre class="alt">            log.debug(<span class="str">"Retrieved sling repository"</span>);</pre>
<pre>            <span class="rem">// .. do something</span></pre>
<pre class="alt">        } <span class="kwrd">catch</span> (RepositoryException e) {</pre>
<pre>            log.debug(<span class="str">"Exception retrieving repository."</span>, e);</pre>
<pre class="alt">        }</pre>
<pre>    }</pre>
<pre class="alt">}</pre>
</div>
<h2>Testing within CQ5</h2>
<p>If you&#8217;ve dug into CQ5 a little more, you&#8217;ve noticed the the power of the OSGi container and have probably started writing a lot of components (services) and wired them together via dependency injection. Luckily there&#8217;s a very easy way to run unit tests directly in the container and even use the OSGi-style dependency injection directly in your test, allowing you not only to write simple unit tests but also more involved automated integration tests.</p>
<p>According to the <a href="http://sling.apache.org/site/sling-testing-tools.html">Apache Sling testing guideline</a> there are a few approaches but I shall only focus on one of them today.</p>
<p>First, we will need to install a new Sling Junit OSGi bundle into Felix (<a href="http://localhost:4502/system/console">http://localhost:4502/system/console</a>). Grab it via subversion and compile it:</p>
<p>$ svn co <a href="http://svn.apache.org/repos/asf/sling/trunk/testing/junit/core">http://svn.apache.org/repos/asf/sling/trunk/testing/junit/core</a></p>
<p>$ cd core</p>
<p>$ mvn package</p>
<p>Then go into the Felix console (Install/Update button on the right) and install the resulting jar file as a new component (it&#8217;s in core/target/org.apache.sling.junit.core-1.0.7-SNAPSHOT.jar):</p>
<p style="text-align: center;"><a href="http://jtoee.com/wp-content/uploads/2011/09/Screenshot.png"><img class="aligncenter size-full wp-image-807" title="Screenshot" src="http://jtoee.com/wp-content/uploads/2011/09/Screenshot.png" alt="" width="600" height="177" /></a></p>
<p>Now you&#8217;re ready to write your first test into one of your custom OSGi bundles. One thing to keep in mind is that while with regular unit tests you would write your tests in the src/test/java directory structure (assuming a standard Maven project layout), you would put these tests into the src/main/java directory – you want them deployed and executed as part of the bundle.</p>
<p>Let&#8217;s take a look at a first test:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<div class="csharpcode">
<pre class="alt"><span class="rem">/**</span></pre>
<pre><span class="rem"> * &lt;p/&gt;</span></pre>
<pre class="alt"><span class="rem"> * User: jochen</span></pre>
<pre><span class="rem"> * Date: 9/24/11</span></pre>
<pre class="alt"><span class="rem"> * Time: 9:08 PM</span></pre>
<pre><span class="rem"> */</span></pre>
<pre class="alt">@RunWith(SlingAnnotationsTestRunner.<span class="kwrd">class</span>)</pre>
<pre><span class="kwrd">public</span> <span class="kwrd">class</span> MyAwesomeTest {</pre>
<pre class="alt"></pre>
<pre>    @TestReference</pre>
<pre class="alt">    <span class="kwrd">private</span> BundleContext bundleContext;</pre>
<pre></pre>
<pre class="alt">    @TestReference</pre>
<pre>    <span class="kwrd">private</span> SlingRepository repository;</pre>
<pre class="alt"></pre>
<pre>    @TestReference</pre>
<pre class="alt">    <span class="kwrd">private</span> ResourceResolverFactory resourceResolverFactory;</pre>
<pre></pre>
<pre class="alt">    @TestReference</pre>
<pre>    <span class="kwrd">private</span> CloudStorageService storage;</pre>
<pre class="alt"></pre>
<pre>    <span class="rem">/**</span></pre>
<pre class="alt"><span class="rem">     * Get a sling resource resolver</span></pre>
<pre><span class="rem">     */</span></pre>
<pre class="alt">    <span class="kwrd">public</span> ResourceResolver getResourceResolver() {</pre>
<pre>        <span class="kwrd">try</span> {</pre>
<pre class="alt">            <span class="kwrd">return</span> getResourceResolverFactory().</pre>
<pre>                    getAdministrativeResourceResolver(<span class="kwrd">null</span>);</pre>
<pre class="alt">        } <span class="kwrd">catch</span> (LoginException e) {</pre>
<pre>            fail(e.toString());</pre>
<pre class="alt">        }</pre>
<pre>        <span class="kwrd">return</span> <span class="kwrd">null</span>;</pre>
<pre class="alt">    }</pre>
<pre></pre>
<pre class="alt">    @Test</pre>
<pre>    <span class="kwrd">public</span> <span class="kwrd">void</span> testCreateFutureAttachment()</pre>
<pre class="alt">            throws Exception {</pre>
<pre>        assertTrue(<span class="kwrd">true</span>);</pre>
<pre class="alt">    }</pre>
<pre>}</pre>
</div>
<p>As you can see with the class annotation @RunWith(SlingAnnotationsTestRunner.class) we&#8217;re telling the system to automatically inject OSGi-dependencies into the test case (you can&#8217;t use the regular @Reference annotations you might be using in the rest of your code since these have a compile-time retention policy). Use the @TestReference annotations to inject any of your defined components into your test. The rest of the test is standard Junit.</p>
<h2>Maven Setup</h2>
<p>Before running the tests, you need to register a regex for the test runner to identify your tests by name, such as the following Maven example does:<br />
<!-- code formatted by http://manoli.net/csharpformat/ --></p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">&lt;</span><span class="html">plugin</span><span class="kwrd">&gt;</span></pre>
<pre>  <span class="kwrd">&lt;</span><span class="html">groupId</span><span class="kwrd">&gt;</span>org.apache.felix<span class="kwrd">&lt;/</span><span class="html">groupId</span><span class="kwrd">&gt;</span></pre>
<pre class="alt">  <span class="kwrd">&lt;</span><span class="html">artifactId</span><span class="kwrd">&gt;</span>maven-bundle-plugin<span class="kwrd">&lt;/</span><span class="html">artifactId</span><span class="kwrd">&gt;</span></pre>
<pre>  <span class="kwrd">&lt;</span><span class="html">extensions</span><span class="kwrd">&gt;</span>true<span class="kwrd">&lt;/</span><span class="html">extensions</span><span class="kwrd">&gt;</span></pre>
<pre class="alt">  <span class="kwrd">&lt;</span><span class="html">configuration</span><span class="kwrd">&gt;</span></pre>
<pre>    <span class="kwrd">&lt;</span><span class="html">instructions</span><span class="kwrd">&gt;</span></pre>
<pre class="alt">        <span class="kwrd">&lt;</span><span class="html">Export-Package</span><span class="kwrd">&gt;</span></pre>
<pre>            com.jtoee.cq.test.*</pre>
<pre class="alt">        <span class="kwrd">&lt;/</span><span class="html">Export-Package</span><span class="kwrd">&gt;</span></pre>
<pre>        <span class="kwrd">&lt;</span><span class="html">Sling-Test-Regexp</span><span class="kwrd">&gt;</span>.*Test<span class="kwrd">&lt;/</span><span class="html">Sling-Test-Regexp</span><span class="kwrd">&gt;</span></pre>
<pre class="alt">        <span class="kwrd">&lt;</span><span class="html">Private-Package</span><span class="kwrd">&gt;&lt;/</span><span class="html">Private-Package</span><span class="kwrd">&gt;</span></pre>
<pre>        <span class="kwrd">&lt;</span><span class="html">Import-Package</span><span class="kwrd">&gt;</span></pre>
<pre class="alt">   ...</pre>
</div>
<h2>Running Your Tests</h2>
<p>The Sling unit testing core package installed earlier includes a simple servlet runner which is available via <a href="http://localhost:4502/system/sling/junit/">http://localhost:4502/system/sling/junit/</a> (adjust to your particular installation). You can simply run the tests from there. The runner implements various selectors, namely .html, .xml, and .json. Especially the XML-based format lends itself toward an easy integration into an automated build process:</p>
<p>$ curl -X POST <a href="http://localhost/system/sling/junit/com.jtoee.cq.xml">http://localhost/system/sling/junit/com.jtoee.cq.xml</a></p>
<p>While I&#8217;ve come to love using the the JSON format via curl for readability, it doesn&#8217;t give you the stack traces in case any of your tests fail. However, the XML format does.</p>
<h2>Conclusion</h2>
<p>You have no more excuse not to write unit tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2011/09/799/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Agile &#8211; Keep It Simple</title>
		<link>http://jtoee.com/2011/04/agile-keep-it-simple/</link>
		<comments>http://jtoee.com/2011/04/agile-keep-it-simple/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 14:47:15 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=789</guid>
		<description><![CDATA[Being hip followers at work, almost all of our projects are agile now. But while have a solid agile process defined which works well across disciplines and time zones (i.e. off-shore), just peeking in on various projects every now and then makes me wonder why I see the same problems pop up again and again. [...]]]></description>
			<content:encoded><![CDATA[<p>Being hip followers at work, almost all of our projects are agile now. But while have a solid agile process defined which works well across disciplines and time zones (i.e. off-shore), just peeking in on various projects every now and then makes me wonder why I see the same problems pop up again and again.</p>
<p>First of all, agile is actually a very simple, disciplined process &#8212; and that&#8217;s the beauty of it. It&#8217;s simple. Plan out your work, track it, create a workable/releasable piece of software with every increment, do a demo, regroup, repeat. A simple process built on simple <a href="http://agilemanifesto.org/principles.html" target="_blank">principles </a>of sustainable development (that means not burning your teams out, dummy).</p>
<p>So what are some of the things that I keep seeing that are messing with the success?</p>
<p>1. Keep re-planning throughout the sprint</p>
<p>Constantly re-prioritizing every day and letting the clients and other sprint teams (e.g. user experience/functional folks) influence the core development team. This is a major no-no. The idea is that at the beginning of the sprint you plan out your work together with the product stakeholder. You do not add or change work or the major goals of the sprint during the sprint. If the sprint plan needs to be changed, interrupt the sprint and call for a planning meeting. It seems to be tempting to squeeze a little this and a little that into a sprint, but in the end it compromises the quality of the increment&#8217;s deliverable. And usually causes  long hours for the dev team.</p>
<p>Here&#8217;s another awesome idea. Invite many managers to every meeting (yes, they exist in most organizations) and have them talk, create chaos, then leave for a few weeks just to come back and change direction.</p>
<p>Remember &#8211; agile teams are to be self-organizing and interact with their product owner for direction during sprint planning. The key is really in the self-organizing part. Empower your team.</p>
<p>2. More features</p>
<p>You want to impress the client and add more and more features into the sprint and think it&#8217;s perfectly ok to implement each of them half of the way as long as you have something to show for. Well, remember that one principle of agile development? Workable software with every increment. Having a bunch of half-implemented features not only creates half-assed non-releasable software, but also causes your features to bleed into the next sprint where your team will spend half the sprint cleaning up the features from the previous one. And of course your client won&#8217;t be happy because the sprint demo probably won&#8217;t go well. Your developers will hate you for the long hours trying to just get something to work even though they probably have to rip half the code out again in the next sprint.</p>
<p>Time savings? No.</p>
<p>Increased productivity? No.</p>
<p>Happy clients? Probably not.</p>
<p>3. Who&#8217;s the scrum master?</p>
<p>Appoint a non-technical person to be the scrum master of your tech team. This might be a little controversial, but I don&#8217;t think that project managers without tech background make good scrum masters for a technology team. The scrum master should be the equivalent of the technology lead for the team. This is especially important in a multi-team environment like we have at an agency or any other sizeable project. The lead of the team needs to be able to participate in scrum-of-scrum meetings with the other teams and be able to fully understand the technology as well as any implications of decisions the other teams are making. So the scrum master of the technology team needs to be able to coordinate between the user experience / functional scrum team and the technology team. Otherwise you&#8217;re headed into disaster with two interdependent scrum teams which are running into opposite directions. And you need scrum-of-scrum meetings to coordinate in a multi-team environment; don&#8217;t think you can save those 10 minutes a day.</p>
<p>4. Code away</p>
<p>Write no documentation. Yes, agile processes are light on documentation. But that doesn&#8217;t mean that you don&#8217;t document and just code away. That&#8217;s the cowboy methodology. You still have to document what needs to be documented. Just create a task for the documentation during your planning session. Documentation isn&#8217;t all bad, just keep it to the necessary amount. API specs of interfaces your provide to another scrum team would be a great idea to document, so are core data models of your application so you don&#8217;t have to repeat the same discussion with the team all over every two days. Use a wiki.</p>
<p>5. Standups</p>
<p>Sit down and talk through all the issues for an hour every day during your standup meeting (I guess that would make it a sit-down). Really, keep them short and simple, all major discussion should be happening outside of these meetings. Limit them to 10-15 minutes, talk about your accomplishments, what you&#8217;re about to do, and your impediments. You might be able to just get by with talking about impediments, but that depends on your team. These meetings are not meant to waste time and make managers happy. If you&#8217;re having a hard time with this one, pass around an egg timer that goes off after a minute or two of talking.</p>
<p>&nbsp;</p>
<p>Alright. That&#8217;s five for starters. So please keep agile simple. I know it&#8217;s not easy, but resist the dark side.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2011/04/agile-keep-it-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Certification Incompetence</title>
		<link>http://jtoee.com/2011/03/certification-incompetence/</link>
		<comments>http://jtoee.com/2011/03/certification-incompetence/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 14:55:46 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=785</guid>
		<description><![CDATA[Most of my friends and colleagues are very negative about certification schemes in software development, a disdain that I share. This doesn&#8217;t mean that I think that certifications in software are bad by definition, just that almost every one we see fails a basic test. Couldn&#8217;t agree more, Mr. Fowler. Read on..]]></description>
			<content:encoded><![CDATA[<blockquote><p>Most of my friends and colleagues are very negative about certification schemes in software development, a disdain that I share. This doesn&#8217;t mean that I think that certifications in software are bad by definition, just that almost every one we see fails a basic test.</p></blockquote>
<p>Couldn&#8217;t agree more, Mr. Fowler. <a href="http://martinfowler.com/bliki/CertificationCompetenceCorrelation.html" target="_blank">Read on..</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2011/03/certification-incompetence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bye Bye Holographic Storage</title>
		<link>http://jtoee.com/2010/02/bye-bye-holographic-storage/</link>
		<comments>http://jtoee.com/2010/02/bye-bye-holographic-storage/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 21:48:34 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=775</guid>
		<description><![CDATA[I remember reading this great article about holographic storage in 1991. Yes, that&#8217;s 1991, I was a nerd even back then (article on Der Spiegel or via Google Translate). Holographic storage was going to take over everything and replace hard-drives in five years. I guess that didn&#8217;t happen, but companies such as InPhase sure kept [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-776" title="holostorage" src="http://jtoee.com/wp-content/uploads/2010/02/holostorage.jpg" alt="" width="126" height="106" />I remember reading this great article about holographic storage in 1991. Yes, that&#8217;s 1991, I was a nerd even back then (article on <a href="http://www.spiegel.de/spiegel/print/d-13488697.html" target="_blank">Der Spiegel</a> or via <a href="http://bit.ly/d2T6Rf" target="_blank">Google Translate</a>). Holographic storage was going to take over everything and replace hard-drives in five years. I guess that didn&#8217;t happen, but companies such as InPhase sure kept trying. Now according to ZDNet, InPhase <a href="http://blogs.zdnet.com/storage/?p=799&amp;tag=content;col1" target="_blank">finally bit the dust</a>.</p>
<p>Bye bye holographic storage, too bad we never met, but you sure sounded like a cool idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2010/02/bye-bye-holographic-storage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ditch Flash, Mr. Jobs. Really?</title>
		<link>http://jtoee.com/2010/02/ditch-flash-mr-jobs-really/</link>
		<comments>http://jtoee.com/2010/02/ditch-flash-mr-jobs-really/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 14:56:11 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=773</guid>
		<description><![CDATA[Apparently Steve Jobs told the Wall Street Journal to ditch flash because it is a buggy old technology with security holes. That&#8217;s an interesting attitude, considering that the real reason for why Apple refuses to support Flash on the iPhone and iPad is that it would undermine the Apple store and they would have to [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently Steve Jobs told the Wall Street Journal to <a href="http://arstechnica.com/apple/news/2010/02/steve-jobs-to-wsj-ditch-dying-flash-technology.ars" target="_blank">ditch flash</a> because it is a buggy old technology with security holes. That&#8217;s an interesting attitude, considering that the real reason for why Apple refuses to support Flash on the iPhone and iPad is that it would undermine the Apple store and they would have to relinquish their total control over what apps run on the devices. That and the fact that AT&amp;T would have to deal with large-scale video streaming on their network (here&#8217;s <a href="http://www.economist.com/businessfinance/displaystory.cfm?story_id=15498399" target="_blank">interesting article</a> regarding this on the Economist).</p>
<p>Do no evil, Mr <span style="text-decoration: line-through;">Gates</span> Jobs and let us decide what software to install on the devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2010/02/ditch-flash-mr-jobs-really/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Link: Game Development in a Post-Agile World</title>
		<link>http://jtoee.com/2010/02/link-game-development-in-a-post-agile-world/</link>
		<comments>http://jtoee.com/2010/02/link-game-development-in-a-post-agile-world/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 14:52:27 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=769</guid>
		<description><![CDATA[I ran across this totally awesome rant/statement of facts (thanks Slashdot) about real-world development, hype, and just getting things done. I personally have always been a huge proponent of just doing what works and feels right in the particular situation, borrowing bits and pieces from all kinds of methodologies. I&#8217;ve never been a fan of [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across this totally awesome rant/statement of facts (thanks Slashdot) about real-world development, hype, and just getting things done. I personally have always been a huge proponent of just doing what works and feels right in the particular situation, borrowing bits and pieces from all kinds of methodologies. I&#8217;ve never been a fan of folks who want to follow a process (whichever it is) on a text-book level.</p>
<p>While the author talks about projects in the gaming world, I think these translate 1-1 to my reality. I think I would like to have a drink with the author of <a href="http://gwaredd.blogspot.com/2010/02/game-development-in-post-agile-world.html" target="_blank">this post</a>. <a href="http://gwaredd.blogspot.com/2010/02/game-development-in-post-agile-world.html" target="_blank">Read it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2010/02/link-game-development-in-a-post-agile-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launching Open Source Home Automation Site!</title>
		<link>http://jtoee.com/2010/01/launching-open-source-home-automation-site/</link>
		<comments>http://jtoee.com/2010/01/launching-open-source-home-automation-site/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 18:07:43 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=759</guid>
		<description><![CDATA[Taking my home automation tinkering to the next level, I am launching catrpillr.com as an open-source solution to home automation. The site contains circuits, software, firmware, and documentation. Be advised that you currently still need at least intermediate knowledge of electronics to put these pieces together. The current solution allows you to fairly easily link [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jtoee.com/wp-content/uploads/2010/01/attiny.jpg"><img class="alignright size-full wp-image-761" title="attiny" src="http://jtoee.com/wp-content/uploads/2010/01/attiny.jpg" alt="" width="116" height="116" /></a>Taking my home automation tinkering to the next level, I am launching <a href="http://www.catrpillr.com"> catrpillr.com</a> as an open-source solution to home automation. The site contains circuits, software, firmware, and documentation. Be advised that you currently still need at least intermediate knowledge of electronics to put these pieces together. The current solution allows you to fairly easily link together devices through low-cost radio-frequency receivers and transmitters, a few sample circuits such as a generic binary sensor and a relay-based remote switch are included.</p>
<p>A lot of the Arduino and hardware-related posts as of late will start going over onto the new site, freeing this site back up for things relating to (enterprise) software development.</p>
<p style="text-align: right;"><a href="http://www.catrpillr.com">Read More ></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2010/01/launching-open-source-home-automation-site/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Connecting Multiple AVR/Arduinos via I2C/TWI</title>
		<link>http://jtoee.com/2009/12/connecting-multiple-avrarduinos-via-i2ctwi/</link>
		<comments>http://jtoee.com/2009/12/connecting-multiple-avrarduinos-via-i2ctwi/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:09:59 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=748</guid>
		<description><![CDATA[Since my RF receivers require a full hardware-based UART to function reliably, I decided to opt for adding a simple attiny2313 as a controller connected to an Arduino. Ready to build a simple protocol, I decided to do a little more research into I2C &#8212; the inter-integrated-circuit protocol which puts multiple digital micro-controllers on a [...]]]></description>
			<content:encoded><![CDATA[<p>Since my RF receivers require a full hardware-based UART to function reliably, I decided to opt for adding a simple attiny2313 as a controller connected to an Arduino. Ready to build a simple protocol, I decided to do a little more research into <strong>I2C</strong> &#8212; the inter-integrated-circuit protocol which puts multiple digital micro-controllers on a low-speed bus. As it turns out, the attiny controllers actually implement the full protocol, even if Atmel calls it TWI (two-wire-interface). The protocol defines a master device as well as up to 127 slave devices (7-bit addressing).</p>
<p>The hardware is very easy to hook up and it simply requires two wires (TWI is not just a clever name) &#8211; one called SDA, to transmit the data, and one called SCL, to transmit a clock signal. On an Arduino Duemilanove SDA is analog pin 4 and SCL is analog pin 5. On the attiny2313 controller, SDA is pin B5 (pin 17, also MOSI), and SCL is on pin B7 (pin 19) &#8212; also refer to <a href="http://tinkerlog.com/2009/06/18/microcontroller-cheat-sheet/" target="_blank">Alex&#8217;s cheat sheet</a> for the pins. Just connect SDA to SDA and SCL to SCL.</p>
<p>Arduinos have the <strong><a href="http://www.arduino.cc/en/Reference/Wire" target="_blank">Wire</a> </strong>library built straight into them, and after some hunting I found a small library for atttiny adapted from the <a href="http://www.avrfreaks.net/index.php?module=Freaks%20Tools&amp;func=viewItem&amp;item_id=664" target="_blank">original Atmel code</a> by a Donald Blake (can be found on avrfreaks.net or <a href="http://code.google.com/p/tinkercode/source/browse/#svn/trunk/automation-framework/i2c" target="_blank">my subversion repository</a>). The Arduino is quickly configured as a master and set up to send and receive characters typed into the serial console to and from the slave controller:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="rem">// Arduino Code</span>
<span class="kwrd">void</span>
  setup()   {
  Serial.begin(57600);
  <span class="rem">// initialize as i2c master</span>
  Wire.begin();
  Serial.println(<span class="str">"OK&gt;"</span>);
}
<span class="rem">// loop forever..</span>
<span class="kwrd">void</span> loop()
{
  <span class="rem">// data available from computer?</span>
  <span class="kwrd">if</span> (Serial.available()) {
    <span class="rem">// read the incoming byte from the serial port</span>
    sByte = Serial.read();
    <span class="rem">// begin transmission to device 1    </span>
    Wire.beginTransmission(1);
    <span class="rem">// send</span>
    Wire.send(sByte);
    <span class="rem">// done</span>
    Wire.endTransmission();

    <span class="rem">// request data from device 1</span>
    Wire.requestFrom(1,1);
    <span class="rem">// echo out whatever we get back</span>
    <span class="kwrd">while</span>(Wire.available()) {
      Serial.print(Wire.receive());
      Serial.print(<span class="str">"-"</span>);
    }
  }
  delay(100);
}</pre>
<p>On the slave, simply link the Donald Blake&#8217;s library into the code and this then does all the magic:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="rem">// attiny2313 code</span>
<span class="kwrd">int</span> main(<span class="kwrd">void</span>)
{
  <span class="rem">// initialize as slave with id 1</span>
  usiTwiSlaveInit(1);

  <span class="rem">// enable interrupts (must be there, i2c needs them!)</span>
  sei();

  <span class="rem">// handle commands</span>
  <span class="kwrd">while</span> (1)
  {
    <span class="rem">// check if data is in the i2c receive buffer</span>
    <span class="kwrd">if</span>(usiTwiDataInReceiveBuffer())
    {
      <span class="rem">// get it</span>
      uint8_t b = usiTwiReceiveByte();
      <span class="rem">// echo it back</span>
      usiTwiTransmitByte(b);
    }
    <span class="rem">// Do something else while waiting for the TWI transceiver to complete.</span>

    asm <span class="kwrd">volatile</span> (<span class="str">"NOP"</span> ::);
  }
  <span class="kwrd">return</span> 0;
}</pre>
<p>Works like a charm!</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2009/12/connecting-multiple-avrarduinos-via-i2ctwi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atmega/Arduino (Soft-) Serial Ports</title>
		<link>http://jtoee.com/2009/12/atmegaarduino-soft-serial-ports/</link>
		<comments>http://jtoee.com/2009/12/atmegaarduino-soft-serial-ports/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 14:02:11 +0000</pubDate>
		<dc:creator>Jochen</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://jtoee.com/?p=744</guid>
		<description><![CDATA[In the implementation of the &#8220;reverse&#8221; channel of my home automation system, the RF receiver will transmit radio data back to the master controller which in return sends it to the computer. Since the atmega168/328&#8242;s processors used in the standard Arduino only have one hardware-based serial port (UART), I tried for the software-based serial that [...]]]></description>
			<content:encoded><![CDATA[<p>In the implementation of the &#8220;reverse&#8221; channel of my <a href="http://jtoee.com/rf-automation-libary/">home automation system</a>, the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8948" target="_blank">RF receiver</a> will transmit radio data back to the master controller which in return sends it to the computer. Since the atmega168/328&#8242;s processors used in the standard Arduino only have one hardware-based serial port (UART), I tried for the software-based serial that ships with the Arduino IDEs. Transmitting data out works like a charm (as seen previously), but receiving it is quite a challenge, mostly due to timing problems. The software serial port doesn&#8217;t work unless all the sketch does is gather data &#8212; there&#8217;s no time for processing or it will start losing data.</p>
<p>My next attempt was to use an interrupt-based version of the software serial port. I briefly thought about writing one, but then I found this great libary, the <a href="http://arduiniana.org/libraries/NewSoftSerial/" target="_blank">New SoftSerial</a>. It is as simple to use as the original library, but unfortunately once I connect the RF receiver, the processor is too busy handling interrupts and nothing really works. The noise picked up by the RF module must simply overwhelm it. That&#8217;s too bad, this works beautifully on my attiny2313-based receiver when using the hardware UART.</p>
<p>A software-based solution is clearly not the answer, some hardware is required. I can think of a few options</p>
<ol>
<li>Abandon the Arduino altogether and use an AVR controller with multiple UARTs &#8212; not ideal, I like the idea of basing the master on Arduino for the hackability factor</li>
<li>Use a logic gate and an external clock generator to sample/filter the signal exactly at the right timing required for 1200 bps (the maximum reliable speed I could get to work for the RF modules) &#8211; this could still lead to timing issues</li>
<li>Create an attiny2313-based &#8220;daughter-board&#8221; which handles all the nitty gritty of the RF communication using the hardware-UART and then communicates to the Arduino via a few of the regular digital ports (I&#8217;m thinking asynchronously via about 4 pins)</li>
</ol>
<p>Clearly this requires a little more thinking, but I&#8217;m leaning towards the third option &#8212; it encapsulates all the protocol logic on the attiny&#8217;s and the Arduino library that would need to be written to communicate with it would be very light-weight. And let&#8217;s not forget the attiny&#8217;s are only about two bucks.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtoee.com/2009/12/atmegaarduino-soft-serial-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

