<?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>Lallafa's Blog</title>
	<atom:link href="http://lallafa.de/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://lallafa.de/blog</link>
	<description>Personal Musings about the Commodore64, Macs and my other Hobby Projects</description>
	<lastBuildDate>Sun, 21 Apr 2013 18:23:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Adding touch support for the MI0283QT* displays</title>
		<link>http://lallafa.de/blog/2013/03/adding-touch-support-for-the-mi0283qt-displays/</link>
		<comments>http://lallafa.de/blog/2013/03/adding-touch-support-for-the-mi0283qt-displays/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 15:50:38 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=618</guid>
		<description><![CDATA[<p>In my last posts I showed how to integrate Watterott&#8217;s MI0283QT-2 and the newer -9 displays as a frame buffer device in Raspberry Pi&#8217;s Linux kernel. Now I will focus on adding support for the touch controller found on the display boards.</p> <p>The touch controller is an ADS7846 chip that already has a device driver in <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/03/adding-touch-support-for-the-mi0283qt-displays/">Adding touch support for the MI0283QT* displays</a></span>]]></description>
			<content:encoded><![CDATA[<p>In my last posts I showed how to integrate Watterott&#8217;s <a title="Watterott Display on Raspberry Pi" href="http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/">MI0283QT-2</a> and the newer <a title="Watterott MI0283QT-9A Display for the Rasbperry Pi" href="http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/">-9</a> displays as a frame buffer device in Raspberry Pi&#8217;s Linux kernel. Now I will focus on adding support for the touch controller found on the display boards.</p>
<p>The touch controller is an ADS7846 chip that already has a device driver in the Linux kernel. User <a href="https://github.com/dronus">dronus</a> has patched the vanilla driver to make it work with the MI0283QT displays and the Raspberry Pi.</p>
<p>Fine, we already have everything in place now to give it a try!</p>
<h4>Hardware</h4>
<p>First, we need to add two additional wires in our hardware setup to connect the touch controller (see old wiring in last post) with the RPi:</p>
<pre>Signal     Raspi      Display   Comment
T_IRQ      GPIO25       13       Interrupt line from ADS7846
T_CS       SPI0_CE0_N   11       SPI chip select 0</pre>
<h4>Software</h4>
<p>I assume you already have a patched Linux kernel with the tft driver patches applied. Here is quick list with the next steps:</p>
<ul>
<li>(Manually) apply <a href="https://github.com/dronus/linux/commit/24666a13e8dfac1dfeaf55fa3c6e413b64af1a42">dronus small patch</a> to your kernel tree. This adds the necessary modifications of the ADS driver.</li>
<li>Note: I had to replace the<strong> invert_x</strong> with the <strong>invert_y</strong> entry in the ADS configuration to match the display orientation we use in the frame buffer driver</li>
<li>Your SPI config for the display now should look like this (for the newer *-9 display): <strong>linux/file arch/arm/mach-bcm2708/bcm2708.c</strong></li>
</ul>
<pre>static struct ads7846_platform_data ads7846_config = {
  .x_max      = 0x0fff,
  .y_max      = 0x0fff,
  .x_plate_ohms    = 180,
  .pressure_max    = 255,
  .debounce_max    = 10,
  .debounce_tol    = 3,
  .debounce_rep    = 1,
  .gpio_pendown    = 25,
  .keep_vref_on    = 1,
  .swap_xy     = true,
  .invert_y    = true
};

static struct spi_board_info bcm2708_spi_devices[] = {
        {
                // ads7846 touchscreen on chipsel=0 device
                .modalias    = "ads7846",
                .bus_num    = 0,
                .chip_select    = 0,
                .max_speed_hz           = 500000,
                .irq      = GPIO_IRQ_START+25,
                .platform_data    = &amp;ads7846_config,
                .mode = SPI_MODE_0
        }, {
                // display on chipsel=1 device
                .modalias = "ili9341fb",
                .max_speed_hz = 16000000,
                .bus_num = 0,
                .chip_select = 1,
                .mode = SPI_MODE_0,
                .platform_data = &amp;(struct fbtft_platform_data) {
                        .gpios = (const struct fbtft_gpio []) {
                                { "reset", 23 },
                                { "led", 24 },
                                {},
                        },
                        .fps = 10
                }
        }
};</pre>
<ul>
<li>I use <strong>GPIO 25</strong> for the touch IRQ (mainly because wiring was easier this way <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and had to change the relevant entries. dronus used GPIO 17 instead.</li>
<li>I reduced the SPI rate of the display to 16 MHz and the frame rate to 10 fps. This proved to be more stable with activated touch controller.</li>
<li>The older <strong>-2</strong> display works similarly. You only have to exchange the second block with the one of the <strong>r61505u</strong> driver. See <a title="Watterott Display on Raspberry Pi" href="http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/">old post</a> for details</li>
<li>Open the configuration of the kernel and select the ADS driver:</li>
</ul>
<pre>&gt; make menuconfig
Select "Device Drivers -&gt; Input Device Support -&gt; [*] Touchscreens -&gt; [*] ADS7846..."</pre>
<ul>
<li>Make sure to include the ADS driver directly into the kernel and NOT in a module</li>
<li>Ok, thats it! (Re-)compile kernel and install it on your RPi&#8230;</li>
</ul>
<h4>Test</h4>
<p>After a reboot your system shows a new input device in <strong>/dev/input/*</strong>. If no other USB mouse or keyboard is connected then the devices found there are all created by the touch controller.</p>
<p>You can use the <strong>evtest</strong> utility to check the touch operation (Install with &#8216;apt-get install evtest&#8217; first!):</p>
<pre>&gt; evtest /dev/input/event0</pre>
<p>When you tap on the display you will see the incoming events. Note the x and y coordinates mapping if you tap on different corners of the display.</p>
<p>Now with the basic operation tested you can start X11 on your display (see <a title="Watterott MI0283QT-9A Display for the Rasbperry Pi" href="http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/">last post</a>) and use your fingers or a stylus to navigate the mouse cursor!</p>
<h4>Open Topic</h4>
<p>While touch operation with this driver is rock solid and works very precisely I have found one little nuisance: I can&#8217;t move the X11 cursor into the border regions of the display <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Approx 5 mm at the border of the visibile display area my touch movements are not recognized anymore and I can&#8217;t move the pointer there&#8230; I am not sure if this is a limitation of the display, of the ADS driver or the parameter set for the driver&#8230; If you find a workaround for this then please post a comment!</p>
<h4>[Update: 21.4.2013] Pre-compiled Kernel</h4>
<p>A pre-compiled Raspbian Wheezy Kernel 3.6.11+ with both ili9341 display and ads7846 touch driver (i.e. supporting all devices on the MI0283QT-9 board) is available for download here:</p>
<ul>
<li><a href="http://www.lallafa.de/files/raspi/raspi-linux-3.6.11-ili9341-ads7846.tar.gz">raspi-linux-3.6.11-ili9341-ads7846.tar.gz</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/03/adding-touch-support-for-the-mi0283qt-displays/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>pifon: an audio baby monitor for two Raspberry Pis</title>
		<link>http://lallafa.de/blog/2013/03/pifon-an-audio-baby-monitor-for-two-raspberry-pis/</link>
		<comments>http://lallafa.de/blog/2013/03/pifon-an-audio-baby-monitor-for-two-raspberry-pis/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 18:15:29 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=605</guid>
		<description><![CDATA[<p>Becoming a dad does not only completely change your life but also changes the scope of your hobby projects (If time still permits ) My first self-made project made especially for my newborn baby boy Felix is called pifon and is an audio baby monitor realized with two Raspberry Pi devices.</p> <p class="wp-caption-text">the pifon project: <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/03/pifon-an-audio-baby-monitor-for-two-raspberry-pis/">pifon: an audio baby monitor for two Raspberry Pis</a></span>]]></description>
			<content:encoded><![CDATA[<p>Becoming a dad does not only completely change your life but also changes the scope of your hobby projects (If time still permits <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) My first self-made project made especially for my newborn baby boy Felix is called pifon and is an audio baby monitor realized with two Raspberry Pi devices.</p>
<div id="attachment_606" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon.jpg"><img class="size-medium wp-image-606" title="pifon" src="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon-300x234.jpg" alt="" width="300" height="234" /></a><p class="wp-caption-text">the pifon project: two Raspberry Pis converted into an audio baby monitor</p></div>
<h4>Hardware</h4>
<p>The hardware setup is fairly simple: one Pi, the <strong>pifon server, </strong>has a USB web cam attached. I use its internal microphone to record the voice of my little boy. The other Pi is the <strong>pifon monitor </strong>and has a set of analog speakers attached for the output. Additionaly, the mon device has an <a href="http://www.adafruit.com/products/1110">Adafruit RGB LCD Plate</a> attached and I use the LCD on this little plate as output device and its 5 keys as user input. I did not mount the plate directly on the Pi but used a ribbon cable to detach it: This allows me to package the plate in its own housing (As it is easier to find a case for the plate alone):</p>
<div id="attachment_608" class="wp-caption aligncenter" style="width: 283px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon-mon1.jpg"><img class="size-medium wp-image-608" title="pifon-mon" src="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon-mon1-273x300.jpg" alt="" width="273" height="300" /></a><p class="wp-caption-text">pifon/mon: the listening Pi with the control panel attached</p></div>
<p><span id="more-605"></span></p>
<h4>Software</h4>
<p>To get started quickly, I tried to use as many off-the-shelve components for the software as I could: For the audio recording and streaming I opted for the <a href="http://www.icecast.org">Icecast</a> audio streaming server that gets its input stream recorded from the webcam microphone with the <a href="http://code.google.com/p/darkice/">darkice</a> live audio streamer. This setup is proven to be stable and already documented in various projects &#8211; also on the Pi.</p>
<p>What&#8217;s missing is some kind on status messaging I wanted to have: The pifon server shall analyse the recorded audio stream and when something special (e.g. baby crying) happens it sends an event to the monitor client. So the client can start streaming the live audio only when something interesting is happening. Then the audio stream will stay live until the event is over and then stop streaming.</p>
<p>For the messaging between the server and the monitor I decided to use <a href="http://xmpp.org">XMPP</a>, the well known standard for Internet instant messaging. The pifon server and the monitor will then be two &#8220;bots&#8221; sitting in a chat room and exchanging events by &#8220;typing&#8221; messages. The advantage of this approach is that you can simply join the chat as a user and also watch for incoming events for the server &#8211; that&#8217;s also really helpful for debugging <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I run my own XMPP server on the pifon server Pi and use the <a href="http://prosody.im">prosody</a> server implementation. My code contribution in the project is the bot code and that is written in Python using the <a href="http://sleekxmpp.com">SleekXMPP</a> for the XMPP communication. Additionally, I use <a href="https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code">Adafruit&#8217;s Python Code</a> for accessing the LCD and reading the 5 buttons via the I2C bus.</p>
<p>Audio recording is done on the server with <a href="http://sox.sourceforge.net">SoX</a>&#8216;s rec tool and using an ALSA dsnoop device that allows mutliple applications to share an input device (here the USB cam&#8217;s mic).</p>
<p>For audio playback on the pifon mon Pi I use the well known <a href="http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki">MPD</a> that is controlled by my scripts with the MPC command line tool. It directly supports streaming by adding the stream server URL in the play list.</p>
<div id="attachment_610" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon-mon-ctrl.jpg"><img class="size-medium wp-image-610" title="pifon-mon-ctrl" src="http://lallafa.de/blog/wp-content/uploads/2013/03/pifon-mon-ctrl-300x181.jpg" alt="" width="300" height="181" /></a><p class="wp-caption-text">pifon&#39;s mon status and control panel</p></div>
<h4>Features</h4>
<p>The pifon project is now in daily production use and has the following list of features:</p>
<ul>
<li>pifon audio server
<ul>
<li>Stream baby&#8217;s audio via standard MP3 stream server to any streaming capable device</li>
<li>Constantly analyse the audio signal and watch out for loudness periods</li>
<li>Provides local XMPP chat server with private chat room for pifon eventing</li>
<li>Send events as XMPP chat messages whenever something happens on the audio channel</li>
<li>Listen on chat messages that allow to control the parameters of the analyse algorithm</li>
</ul>
</li>
<li>pifon monitor
<ul>
<li>Automatically joins the XMPP chat and watches out for events from the server</li>
<li>Can stream the audio to your local audio out with mpd</li>
<li>LCD displays current state of the server including
<ul>
<li>audio detector state: idle, attack, active, sustain, respite</li>
<li>connection: is mon connected to XMPP server?</li>
<li>server ping: does the audio server reply my pings?</li>
<li>shows peak and current RMS audio level during active phase</li>
</ul>
</li>
<li>The LCD has an RGB backlight. It is used to display the server state:
<ul>
<li>BLUE: mon is running but server is not connected yet</li>
<li>WHITE: mon is running and server is connected. no audio event happened</li>
<li>RED: audio is active (loud) but playback is not enabled</li>
<li>GREEN: audio is active (load) and playback is enabled</li>
<li>YELLOW: blanking is disabled otherwise similar to WHITE</li>
</ul>
</li>
<li>5 Keys allow to directly toggle:
<ul>
<li><strong>Listen</strong>: toggle direct streaming from server. This allows to listen into baby&#8217;s room without the audio detector triggering the playback</li>
<li><strong>Mute</strong>: do not start audio streaming even if an audio event occurred. Use this if you want to watch out for audio events but do not start streaming the audio stream. You will then see the audio event with the LCD backlight only.</li>
<li><strong>Chime</strong>: the mon client plays a short signal sound before starting or stopping the streaming playback. You can disable playback of these sound icons with this button.</li>
<li><strong>Blank</strong>: if no audio event occurrs then the LCD is automatically blanked after 10s if no button is pressed. If you want to see the display permanently then toggle this button.</li>
<li><strong>Menu:</strong> open the parameter menu. Press the button again to leave the menu. Inside the menu the four directional keys allow you to navigate through the menu items and alter the values. See the description of the detector parameters for details below.</li>
</ul>
</li>
</ul>
</li>
<li>Both devices are more or less portable if your network technology allows this (I use PowerLAN, but WLAN works as well)</li>
<li>Use your Mac/PC or mobile phone as an alternate client: Use an XMPP chat client (I use Adium) to watch for server events and an internet stream player (e.g. VLC) to listen to the audio stream. Talk with the server to alter parameters.</li>
</ul>
<h4>Audio Detector Parameters</h4>
<p>The audio detector used in pifon&#8217;s audio server has several parameters that allow you to adjust the responsitivity of the detector.</p>
<p>The audio detecter is modeled as a state machine that analyses the max RMS value of the samples recorded in a given period and uses this value to decide on state traversal.</p>
<p>The following states are defined:</p>
<ul>
<li><strong>Idle</strong>: nothing special happens on audio</li>
<li><strong>Attack</strong>: audio level peaks and it might be the begin of a loudness phase if its long enough</li>
<li><strong>Active</strong>: attack period was long enough, we enter active mode and start streaming audio</li>
<li><strong>Sustain</strong>: if audio is silent during the active phase for a longer time then the sustain phase is entered and will lead to end of playback if its long enough</li>
<li><strong>Respite</strong>: This phase enforces a quiet period right after the end of an active phase. Even if audio events occur in this phase they are ignored. This phase was introduced to avoid very frequent start/stop playback cycles.</li>
</ul>
<p>The mon displays some additonal states in the LCD, but they are not audio related:</p>
<ul>
<li><strong>Connect</strong>: initial connect to XMPP server</li>
<li><strong>Online</strong>: mon is in chat room and gets pings from audio server</li>
<li><strong>Offline</strong>: no ping and disconnected from XMPP server</li>
<li><strong>No Ping</strong>: mon is connected to XMPP server but audio server does not reply on pings</li>
</ul>
<p>The following audio detector parameters can be adjusted:</p>
<ul>
<li><strong>trace</strong> (boolean): allows to show the audio RMS value all the time. This is useful for debugging and adjusting the other parameters</li>
<li><strong>alevel</strong> (int, 0-100): level of audio signal must be higher than this value to enter attack state</li>
<li><strong>slevel</strong> (int, 0-100): level of audio signal muse be lower than this value to enter sustain state</li>
<li><strong>update</strong> (int, 1-..): update interval of audio state in 100 ms</li>
<li><strong>attack</strong> (int, 0-..): duration in [s] of peak audio values that must be audible so that active state is entered</li>
<li><strong>sustain</strong> (int, 1-..): duration in [s] of silence so that active state is left</li>
<li><strong>respite</strong> (int, 0-..): duration in [s] after an active period where no new active period is started</li>
</ul>
<p>You can alter these parameters in the XMPP chat with the following commands:</p>
<pre>get audio *
set audio trace False
set audio alevel 10
set audio slevel 5
set audio update 5
set audio attack 0
set audio sustain 5
set audio respite 10</pre>
<p>The &#8216;*&#8217; allows to get all values available.</p>
<h4>Build your own pifon!</h4>
<p>Yes you can build your own clone of the pifon if you like. Everything you need is freely available: all used tools and my code.</p>
<p>The source of my code contributions are found on GitHub: <a href="https://github.com/cnvogelg/raspi/tree/master/pifon">cnvogelg/raspi</a>. Just clone the repository and use it.</p>
<p>This repository includes a detailed<a href="https://github.com/cnvogelg/raspi/blob/master/doc/pifon.txt"> instruction manual</a> on how to setup everything. If you need hints on setting up your Pi itself I have all notes I use for my Pi setup stored in <a href="https://github.com/cnvogelg/raspi/blob/master/doc/install.txt">install.txt</a>.</p>
<p>Now hack on and build your own uber-geeky baby monitor!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/03/pifon-an-audio-baby-monitor-for-two-raspberry-pis/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Watterott MI0283QT-9A Display for the Rasbperry Pi</title>
		<link>http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/</link>
		<comments>http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 17:11:14 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=594</guid>
		<description><![CDATA[<p>In my last post I attached the Watterott Display to my Raspi. The model MI0283QT-2 I have here is not available anymore and was replaced with the newer MI0283QT-9A display modul. Unfortunately, this new display uses a different graphics chip and thus the driver I wrote won&#8217;t work for these panels&#8230; </p> <p>With my new display driver <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/">Watterott MI0283QT-9A Display for the Rasbperry Pi</a></span>]]></description>
			<content:encoded><![CDATA[<p>In my <a title="Watterott Display on Raspberry Pi" href="http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/">last post</a> I attached the Watterott Display to my Raspi. The model MI0283QT-2 I have here is not available anymore and was replaced with the newer <a href="http://www.watterott.com/de/MI0283QT-2-Adapter">MI0283QT-9A display modul</a>. Unfortunately, this new display uses a different graphics chip and thus the driver I wrote won&#8217;t work for these panels&#8230; <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>With my new display driver skills, I thought about adding this new module, too <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  A few days ago I received this new model and on the weekend I finally found a little time to investigate the new driver code&#8230; The new chip is an ILI9341 and uses a 9 bit SPI protocol to receive its commands&#8230; Phew, sounds a bit strange but <a href="https://github.com/notro/fbtft">notro&#8217;s fbtft</a> driver framework again comes to the rescue: he has already supported the Adafruit22 which also uses 9 bit transfers and he also added an 9-bit SPI patch for the Raspi Linux kernel&#8230; With this starting point I was able to support the new display in a few hours:</p>
<div id="attachment_596" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/IMG_0955.jpg"><img class="size-medium wp-image-596" title="IMG_0955" src="http://lallafa.de/blog/wp-content/uploads/2013/03/IMG_0955-300x199.jpg" alt="" width="300" height="199" /></a><p class="wp-caption-text">Watterott&#39;s new MI0283QT-9A display running the boot console</p></div>
<p>Since the display supports the Linux framebuffer interface its also possible to run X11 with Xorg&#8217;s framebuffer driver on it:</p>
<div id="attachment_597" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/IMG_0956.jpg"><img class="size-medium wp-image-597" title="IMG_0956" src="http://lallafa.de/blog/wp-content/uploads/2013/03/IMG_0956-300x199.jpg" alt="" width="300" height="199" /></a><p class="wp-caption-text">The display also runs the X11 desktop</p></div>
<p>Again I was able to drive the display with a 32 MHz SPI clock (even 48 MHz works) and got a stable and smooth 25 fps for the 320&#215;240 pixels in 16 Bit RGB.</p>
<p>If you want to setup this display on your own Raspi then read on&#8230;</p>
<p><span id="more-594"></span></p>
<h3>Setup the ILI9341 driver</h3>
<p>I won&#8217;t repeat all the details of the last driver setup as a lot steps are very similar. Just read the <a title="Watterott Display on Raspberry Pi" href="http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/">previous driver setup page</a> and then you&#8217;ll find the differences here:</p>
<ul>
<li>The hardware setup is unchanged! Its a HW compatible replacement module.</li>
<li>The new driver is called <strong>ifi9341fb</strong></li>
<li>My GitHub repository holds the new driver source: <a href="https://github.com/cnvogelg/fbtft">cnvogelg/fbtft</a></li>
<li>Clone the source. Reconfig and rebuild your kernel.</li>
<li>Select the new ILI9341 driver either as a module or directly place it in the kernel</li>
<li>Test run:</li>
</ul>
<pre>modprobe ili9341fb
modprobe spidevices name=ili9341fb cs=1 fps=25</pre>
<h3>Use pre-compiled Kernel</h3>
<p>If you don&#8217;t want to recompile your own kernel then you could use the binary drop I have uploaded on my site:</p>
<ul>
<li>Download <a href="http://www.lallafa.de/files/raspi/raspi-linux-3.6.11-ili9341.tar.gz">raspi-linux-3.6.11-ili9341.tar.gz</a></li>
<li>Unpack the archive</li>
<li>The files in <strong>boot</strong> directory need to be copied in your Raspi&#8217;s <strong>/boot</strong> directory</li>
<li>The files in <strong>root</strong> directory need to be places in your Raspi&#8217;s <strong>/ (root)</strong> directory</li>
<li>Make sure to backup your existing files in these directories first before overwriting them!</li>
<li>Also ensure to keep the files in the same hierarchy as found in my archive.</li>
<li>I use an 12.11 Ubuntu System (as vmware on my Mac) to mount my Raspi SD card and perform the changes there. This is the safer approach as I don&#8217;t replace the running directly on the Raspi&#8230;</li>
<li>Insert your updated sd card and enjoy booting with your display&#8217;s console&#8230;</li>
</ul>
<h3>X11 on your Display</h3>
<ul>
<li>Setting up the X11 desktop on your Raspbian system is fairly easy:</li>
<li>Install the frame buffer driver (as root):</li>
</ul>
<pre># apt-get install xserver-xorg-video-fbdev</pre>
<ul>
<li>Create a config file with following contents in <strong>/usr/share/X11/xorg.conf.d/99-fbdev.conf</strong>:</li>
</ul>
<pre>Section "Device"  
  Identifier "myfb"
  Driver "fbdev"
  Option "fbdev" "/dev/fb1"
EndSection</pre>
<ul>
<li>Now you can startx as a user and the desktop will be on your display:</li>
</ul>
<pre>&gt; startx</pre>
<p>That&#8217;s it for today&#8230; and enjoy your tiny desktop on the Raspi <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BTW: notro was so kind to include my last driver in his mainline source tree&#8230; So you could grab the source also from his repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/03/watterott-mi0283qt-9a-display-for-the-rasbperry-pi/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Watterott Display on Raspberry Pi</title>
		<link>http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/</link>
		<comments>http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 15:56:52 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=583</guid>
		<description><![CDATA[<p>I really like my Raspberry Pi, but what I am missing is a tiny display matching the size of the board that can be used as primary display, the boot console or some graphics later on.</p> <p>A very nice and cheap TFT display is the MI0283QT-Adapter (note: I got the -2 version not the newer -9 <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/">Watterott Display on Raspberry Pi</a></span>]]></description>
			<content:encoded><![CDATA[<p>I really like my Raspberry Pi, but what I am missing is a tiny display matching the size of the board that can be used as primary display, the boot console or some graphics later on.</p>
<p>A very nice and cheap TFT display is the <a href="https://github.com/watterott/MI0283QT-Adapter">MI0283QT-Adapter</a> (note: I got the -2 version not the newer -9 version that has another display driver chip!) sold by <a href="http://www.watterott.com">Watterott</a>. Its mainly focused to be an add on for the Arduinos, but it should work on every embedded system providing SPI access.</p>
<p>For the Linux running on the Raspberry Pi a framebuffer driver for the display would be the best solution, as it allows you to use it as a boot console and then you can run everything that runs on a framebuffer device (e.g. X11, SDL, mplayer, &#8230;).</p>
<p>First I thought about writing a fresh driver from scratch but some google-fu showed me that there already exists a nice solution: user <strong>notro</strong> has written <a href="https://github.com/notro/fbtft">fbtft</a>, a driver framework that allows to simplify writing an own driver for those tiny TFTs.</p>
<p>For the <strong>R61505u</strong> display chip found on my display board, there was no driver available, but thanks to notro&#8217;s powerful framework and Watterott&#8217;s example code (Thanks to Markus for porting the code to the Raspi), I was able to derive a new driver for this chip in a few hours: See my <a href="https://github.com/cnvogelg/fbtft/">cloned fbtft Git Hub repository</a> for the source.</p>
<p>It works really nice: with 32 MHz SPI clock I can run 25 frames per second and even watch movies with smooth display:</p>
<div id="attachment_584" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/display1.jpg"><img class="size-medium wp-image-584" title="display1" src="http://lallafa.de/blog/wp-content/uploads/2013/03/display1-300x200.jpg" alt="" width="300" height="200" /></a><p class="wp-caption-text">Playing Big Bug Bunny with MPlayer&#39;s fbdev output</p></div>
<p>If you compile the driver directly in your kernel (i.e. no modules) then you can use the display directly as the boot console of your board:</p>
<div id="attachment_585" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2013/03/display2.jpg"><img class="size-medium wp-image-585" title="display2" src="http://lallafa.de/blog/wp-content/uploads/2013/03/display2-300x200.jpg" alt="" width="300" height="200" /></a><p class="wp-caption-text">Linux Boot Console running on display</p></div>
<p>If you want to build this setup yourself then read on&#8230;</p>
<h3><span id="more-583"></span>Build this yourself</h3>
<p>The following notes should guide you through the task of setting up the display yourself. Its not a step by step manual but rather a collection of hints and tips. It is assumed you are familiar with low-level stuff like building and setting up a new kernel for the Raspi, so you have been warned <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Hardware</h4>
<ul>
<li>I used <a href="http://www.adafruit.com/products/801">Adafruit&#8217;s Raspberry Pi Proto Plate</a> as a prototyping board for setting up the required connections between the Raspi and the display</li>
<li>Its a very simple setup: only wires required <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>The following connections are required:</li>
</ul>
<pre>Name       Raspi        Display Board
+5V        2+4          3+4
GND        6            1+2
CS_DISP    26 (CE1)     7
RST_DISP   16 (GPIO23)  6
LED_DISP   18 (GPIO24)  5
MOSI       19           8
MISO       21           9
SCLK       23           10</pre>
<ul>
<li>See <a href="http://elinux.org/RPi_Low-level_peripherals">elinux.org&#8217;s Page</a> for details on the Raspi pinout</li>
<li>See <a href="https://github.com/watterott/MI0283QT-Adapter/tree/master/pcb">Watterott&#8217;s schematics</a> for details of the display board</li>
</ul>
<h4>Software</h4>
<ul>
<li>First have a look at <a href="https://github.com/notro/fbtft/wiki">notro&#8217;s wiki pages</a>: There you find details on how to clone the Linux kernel source and set up everything on your system.</li>
<li>I prefer cross-compiling the kernel on a Ubuntu host system for speed reasons. Have a look at <a href="http://elinux.org/RPi_Kernel_Compilation">elinux.org&#8217;s Kernel Compilation Page</a> for details.</li>
<li>Remember to replace notro&#8217;s GitHub source tree with mine:</li>
</ul>
<pre>git clone https://github.com/cnvogelg/fbtft.git</pre>
<ul>
<li>For a first test use the following commands:</li>
</ul>
<pre># modprobe spi-bcm2708
# modprobe spidevices name=r61505ufb fps=25
# modprobe r61505ufb</pre>
<ul>
<li>This will initialize the display and clear the garbled initial display to a black screen that is lit with the backlight. You&#8217;ll find the framebuffer device /dev/fb1 in your filesystem</li>
<li>Install mplayer and get a movie file. I used <a href="http://www.bigbuckbunny.org/index.php/download/">Big Bug Bunny</a> and the 320&#215;180 IPhone version. As root you can try:</li>
</ul>
<pre># mplayer -vo fbdev:/dev/fb1 BigBuckBunny_320x180.mp4</pre>
<ul>
<li>Enjoy the smooth playback!</li>
</ul>
<p>This setup works great if you want to use the display after boot up as a second screen. However for a first screen you have to compile all drivers into the kernel itself:</p>
<ul>
<li>Again follow <a href="https://github.com/notro/fbtft/wiki/Build-kernel-and-fbtft-drivers">notro&#8217;s guide</a></li>
<li>For the platform specific setup I prepared a<a href="https://github.com/cnvogelg/fbtft/blob/master/contrib/bcm2708-r61505ufb.patch"> r61505ufb patch</a> that you can apply to your source</li>
<li>Build a fresh new kernel and if everything worked out ok then your Raspi will boot into your new console display&#8230;</li>
</ul>
<p>Have fun with your new tiny but shiny Raspi display!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2013/03/watterott-display-on-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>SD Card &#8220;disk box&#8221;</title>
		<link>http://lallafa.de/blog/2012/11/sd-card-disk-box/</link>
		<comments>http://lallafa.de/blog/2012/11/sd-card-disk-box/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 18:48:17 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Commodore 64]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=574</guid>
		<description><![CDATA[<p>Its getting colder outside and its time for cool retro projects!</p> <p>Today I had a really fine idea on how to better store all the SD cards I have lying around here on my desk&#8230;</p> <p>With lots of retro projects using SD card as primary storage media I have lots of them here on my <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/11/sd-card-disk-box/">SD Card &#8220;disk box&#8221;</a></span>]]></description>
			<content:encoded><![CDATA[<p>Its getting colder outside and its time for cool retro projects!</p>
<p>Today I had a really fine idea on how to better store all the SD cards I have lying around here on my desk&#8230;</p>
<p>With lots of retro projects using SD card as primary storage media I have lots of them here on my desk (e.g. for sd2iec, Chameleon 64, some Raspberry Pis, Arduinos &#8230;). All are usually shipped with their crystal plastic cases that also take up space&#8230;In daily use most of them are piled on the desk and the cases fly around somewhere else. So I really needed something to clean up this mess a bit.</p>
<p>Today, I copied some 5.25 inch diskettes for my real C64 machine and while storing the floppy disks back in the floppy disk box, I had an idea&#8230; why no build a disk box for SD cards? <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After some hours of paper work the job was done:</p>
<p><a href="http://lallafa.de/blog/wp-content/uploads/2012/11/sdiskbox.jpg"><img class="aligncenter size-full wp-image-575" title="sdiskbox" src="http://lallafa.de/blog/wp-content/uploads/2012/11/sdiskbox.jpg" alt="" width="640" height="489" /></a></p>
<p>If you want to build your own SD card disk box: Here are some hints:</p>
<ul>
<li>Basic housing was the packaging of a SAM 256 uController from Olimex</li>
<li>I cut away the top cover and used the spare cardboard to model the separator in the middle</li>
<li>Finally I completely covered the box with<strong></strong><a href="http://dict.leo.org/ende?lp=ende&amp;p=_xpAA&amp;search=self-adhesive&amp;trestr=0x8004"><strong></strong></a> self-adhesive plastic foil (Here in germany its called <a href="http://www.d-c-fix.com/">d c fix</a>)</li>
<li>The foldaway dividers were cut out from SD card packaging (its a mixture of cardboard and plastic foil and its really durable) and stuck into a ground plate so you can move them a bit.</li>
</ul>
<p>Now, its on to you! Prepare your scissors and start the paper hacking today <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BTW: Another retro paperware project fits very well with this project: There is a thread on Forum64 that describes how to build <strong>scale replicas of 5.25 disk sleeves for your SD cards</strong>. See <a href="http://www.forum64.de/wbb3/board2-c64-alles-rund-um-den-brotkasten/board107-sonstiges/board44-bastelecke/46042-commodore-diskettenh-lle-f-r-sd-karten/">this thread</a> for details and also downloadable PDFs with the sheets of construction paper&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/11/sd-card-disk-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vamos runs on Windows now</title>
		<link>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/</link>
		<comments>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 18:18:22 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[vamos]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=572</guid>
		<description><![CDATA[<p>User kyberias was so kind to port the native part of vamos (the m68k emulation) to Windows and send me his patches for inclusion. The port is now included in my source tree and Windows user can now enjoy using vamos on their platform, too. Have a look at the README.WIN for build instruction.</p> <p>With <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/">vamos runs on Windows now</a></span>]]></description>
			<content:encoded><![CDATA[<p>User <a href="https://github.com/kyberias">kyberias</a> was so kind to port the native part of vamos (the m68k emulation) to Windows and send me his patches for inclusion. The port is now included in my source tree and Windows user can now enjoy using vamos on their platform, too. Have a look at the <a href="https://github.com/cnvogelg/amitools/blob/master/README.WIN">README.WIN</a> for build instruction.</p>
<p>With Mac OS X and Linux/*nix support available since the beginning, vamos is now available on all major platforms.. Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/11/vamos-runs-on-windows-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build an Arduino-based Temperature Logger</title>
		<link>http://lallafa.de/blog/2012/11/build-an-arduino-based-temperature-logger/</link>
		<comments>http://lallafa.de/blog/2012/11/build-an-arduino-based-temperature-logger/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 18:10:49 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=563</guid>
		<description><![CDATA[<p>Ok, this time its no retro project, but a rather useful tool to measure your temperatue at home over a longer period of time. I had trouble with my heating devices at home and so I wanted to record and present temperature curves of various rooms to show that something is wrong&#8230;</p> <p>This was a <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/11/build-an-arduino-based-temperature-logger/">Build an Arduino-based Temperature Logger</a></span>]]></description>
			<content:encoded><![CDATA[<p>Ok, this time its no retro project, but a rather useful tool to measure your temperatue at home over a longer period of time. I had trouble with my heating devices at home and so I wanted to record and present temperature curves of various rooms to show that something is wrong&#8230;</p>
<p>This was a friday night project and done in a few hours (some might call it a hardware hack &#8211; but it works fairly stable for weeks now!). All you need is an Arduino 2009 Board, a Logger Shield, a push button, 2 1k resistors, and a DS18S20 temperature sensor. With these ingredients I was able to build the following compact temperature logger:</p>
<div id="attachment_564" class="wp-caption aligncenter" style="width: 310px"><a href="http://lallafa.de/blog/wp-content/uploads/2012/11/datalog.jpg"><img class="size-medium wp-image-564" title="datalogger" src="http://lallafa.de/blog/wp-content/uploads/2012/11/datalog-300x247.jpg" alt="" width="300" height="247" /></a><p class="wp-caption-text">Arduino and Logger Shield: Temperature Logger</p></div>
<p>The logger samples the temperature every 10s and gives you a digital temperature value with +/-0.5 degree Celsius precision. It has a RTC (real-time-clock) on board that time stamps every measurement. Addionally, the SD card allows you to store the temperature samples in log files.</p>
<p>The logger has two modes of operation: Either directly read the temperature via a Mac/PC connected via the virtual serial port available on USB or write a temperature log onto the SD card. The latter mode allows you to use the device stand alone in any room without the need to directly connect your computer.</p>
<p>Read on for the full build and usage instructions&#8230;</p>
<h3><span id="more-563"></span>1. Hardware</h3>
<p>You need:</p>
<ul>
<li>an Arduino board (I use an <a href="http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove">Arduino 2009</a> but UNO will be fine, too)</li>
<li>an <a href="http://www.ladyada.net/make/logshield/">Adafruit Logger Shield</a></li>
<li>a push button (to toggle SD card recording)</li>
<li>a DS18S20 digital temperature sensor</li>
<li>2 1k resistors</li>
</ul>
<p>Use the prototyping area of the Logger Shield to attach the push button and the DS18S20. The following <a href="http://fritzing.org/">fritzing.org</a> schematic shows you the required connections:</p>
<p><a href="http://lallafa.de/blog/wp-content/uploads/2012/11/datalog.png"><img class="aligncenter size-full wp-image-565" title="datalog" src="http://lallafa.de/blog/wp-content/uploads/2012/11/datalog.png" alt="" width="480" height="473" /></a>Note: the LEDs and the associated resistors are already available on the logger shield. You only have to connect them to the Arduino on DIGITAL 3 and DIGITAL 4 pins. The LED pins have connectors right beside the two DIGITAL ports. So two small wire bridges will connect them. The push button is connected to DIGITAL 2 and the temperature sensors data channel to DIGITAL 7. The temperate one-wire bus needs a 1k pull up to 5V while the push button uses a 1k pull down resistor.</p>
<p>Here is a summary of the connected digital ports:</p>
<ul>
<li>DIGITAL 2: push button input</li>
<li>DIGITAL 3: LED (green) output</li>
<li>DIGITAL 4: LED (red) output</li>
<li>DIGITAL 7: temperature sensors DS18S20 DQ data channel</li>
</ul>
<p>That&#8217;s it for the hardware&#8230; and don&#8217;t forget to add a battery for the RTC (real time clock).</p>
<h3>2. Software</h3>
<h4>2.1 Firmware</h4>
<p>The firmware is hosted on my github site:</p>
<ul>
<li>GitHub: <a href="https://github.com/cnvogelg/ardu">ardu.git</a></li>
<li>
<pre>git clone git://github.com/cnvogelg/ardu.git</pre>
</li>
</ul>
<p>Simply clone this repository and have a look in the <strong>datalog</strong> directory:</p>
<p>The file <strong>datalog.ino</strong> is an <a href="http://arduino.cc/en/Main/Software">Arduino IDE</a> sketch you can directly open there.</p>
<p><strong>Note:</strong> the sketch requires the RTC and SD FAT FS library that is available at Ladyada for the Logger Shield: see the <a href="http://www.ladyada.net/make/logshield/download.html">Logger Shied Download</a> page for details and install the libraries first!</p>
<p>Open the sketch and flash it on your device&#8230;</p>
<h4>2.2 Configuration</h4>
<p>Before you can use the data logger you have to configure it:</p>
<ul>
<li>In the Arduino IDE open the <strong>serial monitor</strong> (Tools -&gt; Serial Monitor) with <strong>57000 Baud</strong> and Line Ending <strong>Both NL+CR</strong></li>
<li>Insert a FAT formatted SD card and power the device</li>
<li>If the green LED is enabled then everything is fine and SD and temperature sensor was detected. You can see the serial number of your sensor:</li>
</ul>
<pre>DS18S20: 10 83 B4 8D 2 8 0</pre>
<ul>
<li>If the red LED blinks then an error has occurred:
<ul>
<li>Either the sensor was not detected:</li>
</ul>
</li>
</ul>
<pre>FATAL: ADDR?
</pre>
<ul>
<li>
<ul>
<li>Or the SD card was not found:</li>
</ul>
</li>
</ul>
<pre>FATAL: SD
</pre>
<ul>
<li>
<ul>
<li>In both cases have a look at your wiring or your card to fix this&#8230;</li>
</ul>
</li>
</ul>
<p>Now we are ready to set up the RTC (real time clock):</p>
<ul>
<li>You can enter commands in the Serial Monitor and send them to the device</li>
<li>The following commands are supported:
<ul>
<li>&#8216;r&#8217; &#8211; read clock (load time and date from RTC chip and print it)</li>
<li>&#8216;a&#8217; &#8211; adjust clock (save the current values for year, month, day, hour, minutes, seconds to RTC chip)</li>
<li>&#8216;y&#8217; &lt;nnnn&gt; &#8211; set year: 2012 &#8230;</li>
<li>&#8216;m&#8217; &lt;nn&gt; &#8211; set month: 01 .. 12</li>
<li>&#8216;d&#8217; &lt;nn&gt; &#8211; set day of month: 01 .. 31</li>
<li>&#8216;H&#8217; &lt;nn&gt; &#8211; set hour: 00 .. 23</li>
<li>&#8216;M&#8217; &lt;nn&gt; &#8211; set minute: 00 .. 59</li>
<li>&#8216;S&#8217; &lt;nn&gt; &#8211; set seconds: 00 .. 59</li>
<li>&#8216;o&#8217; &#8211; open log on SD card for writing</li>
<li>&#8216;c&#8217; &#8211; close open log on SD card and stop writing</li>
<li>&#8216;D&#8217; &lt;nnnn&gt; &#8211; interval of measurements in seconds. default: 10s</li>
</ul>
</li>
<li>So for setting up the clock to: <strong>28.11.2012 18:34:20</strong> you would enter:</li>
</ul>
<pre>y2012
m11
d28
H18
M34
S20
a
</pre>
<ul>
<li>Now your RTC is set up and you should see incoming measurements like this one</li>
</ul>
<pre>t: 2012.11.18 19:39:03 50A93957 +024.50 0189
t: 2012.11.18 19:39:13 50A93961 +024.50 0189
t: 2012.11.18 19:39:23 50A9396B +024.50 0188</pre>
<ul>
<li>Each line has the following columns:
<ul>
<li>date and time</li>
<li>raw date and time in hex</li>
<li>temperature value in degree celsuis</li>
<li>raw temperature value in hex</li>
</ul>
</li>
</ul>
<h3>3. Stand-alone operation</h3>
<p>Start Logging:</p>
<ul>
<li>Detach the Arduino from your Mac/PC</li>
<li>Use a USB power-supply to power the logger now</li>
<li>Make sure the green LED is enabled after power on (SD card is attached and sensor is OK).</li>
<li>Now <strong>press the push button</strong> to start the logging operation</li>
<li>The red LED is enabled and shows you that data is written to SD card</li>
<li>Each time the green LED blinks a measurement is taken and written to the log file</li>
</ul>
<p>End Logging:</p>
<ul>
<li>After a while stop logging by pressing the push button again</li>
<li>The red LED now is disabled and logging has stopped</li>
<li>Now you can safely remove the SD card and have a look at your data</li>
<li><strong>Note:</strong> do never remove the SD card while the red LED is on this might corrupt your data on the card!</li>
<li>On the SD card a data file is always named <strong>yymmdd_s.LOG</strong> with yymmdd being the current date and s a letter starting from A that is incremented with every new log</li>
</ul>
<h3>4. Plot a Temperature Graph</h3>
<p>You can now use your favorite spread sheet application or graphing tool to convert the data log files from the SD card to pictures.</p>
<p>In my code repository I have written a small Python script that uses <a href="http://oss.oetiker.ch/rrdtool/">rrdtool</a> to plot the graphs (see <a href="https://github.com/cnvogelg/ardu/blob/master/datalog/tools/plot_log.py">datalog/tools/plot_log.py</a>):</p>
<p>Run it as follows:</p>
<pre>python2.7 plot_log.py ./plot_log.py 121104_A.LOG out.png</pre>
<p>This will create an image like this:</p>
<p style="text-align: center;"><a href="http://lallafa.de/blog/wp-content/uploads/2012/11/out2.png"><img class="aligncenter size-medium wp-image-568" title="out2" src="http://lallafa.de/blog/wp-content/uploads/2012/11/out2-300x91.png" alt="" width="600" height="182" /></a></p>
<p>Now, have fun building your own device and inspecting your home&#8217;s temperature <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/11/build-an-arduino-based-temperature-logger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>added new amitool: xdfscan</title>
		<link>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/</link>
		<comments>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/#comments</comments>
		<pubDate>Wed, 03 Oct 2012 15:41:34 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[amitools]]></category>
		<category><![CDATA[Mac Stuff]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=557</guid>
		<description><![CDATA[<p>I added a new tool to amitools, my set of cross platform classic Amiga tools: xdfscan!</p> <p>What does this tool do?</p> <p>Its a disk image file scanner that inspects Amiga disk (.adf) or hard disk (.hdf) image files for AmigaOS OFS or FFS file systems. If such a file system is found then the scanner <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/">added new amitool: xdfscan</a></span>]]></description>
			<content:encoded><![CDATA[<p>I added a new tool to <a title="amitools" href="http://lallafa.de/blog/amiga-projects/amitools/">amitools</a>, my set of cross platform classic Amiga tools: <a title="xdfscan" href="http://lallafa.de/blog/amiga-projects/amitools/xdfscan/">xdfscan</a>!</p>
<p>What does this tool do?</p>
<p>Its a disk image file scanner that inspects Amiga disk (.adf) or hard disk (.hdf) image files for AmigaOS OFS or FFS file systems. If such a file system is found then the scanner runs a validator that does an in-depth check of the whole file system structure. If anything does not match or does not fulfill the file system specification then error or warning messages are generated. Warnings are usually not critical and the files on the image are all accessible, but error messages may hint to file corruption in the image. In the latter case it is advisable to recover the image by running a <a title="xdftool" href="http://lallafa.de/blog/amiga-projects/amitools/xdftool/">xdftool</a> repack command or by issuing a DiskSalv running on an emulator.</p>
<p>This tool either scans a single disk image file or scans through a full directory tree. The latter operation allows you to quickly scan your disk image collection with a single run&#8230;</p>
<p>Have fun scanning your disk collections for corrupt or even broken images&#8230; (I must admit that the scanner is really picky and it found some issues on images I believed that were running Ok for years on a real machine&#8230; So don&#8217;t panic if lots of warnings or errors are reported&#8230; AmigaOS is quite robust handling these disks without reporting trouble&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/10/added-new-amitool-xdfscan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>plipbox 0.2: added support for AVR-NET-IO board</title>
		<link>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/</link>
		<comments>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/#comments</comments>
		<pubDate>Sun, 02 Sep 2012 10:05:44 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=548</guid>
		<description><![CDATA[ <p>I discovered a new board that is even more suitable for plipbox than the Arduino: It’s called the AVR-NET-IO and is available from german electronics distributor Pollin. Its fairly cheap (20 EUR for the kit) and you can also buy it pre-assembled (28 EUR). It contains all things we need: an AVR ATmega32, the <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/">plipbox 0.2: added support for AVR-NET-IO board</a></span>]]></description>
			<content:encoded><![CDATA[<div>
<p><a href="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox-avrnetio.jpg"><img class="aligncenter size-medium wp-image-542" title="plipbox-avrnetio" src="http://lallafa.de/blog/wp-content/uploads/2012/07/plipbox-avrnetio-300x153.jpg" alt="" width="300" height="153" /></a>I discovered a new board that is  even more suitable for plipbox than the Arduino: It’s called the  AVR-NET-IO and is available from german electronics distributor Pollin.  Its fairly cheap (20 EUR for the kit) and you can also buy it  pre-assembled (28 EUR). It contains all things we need: an AVR ATmega32,  the right ethernet chip (ENC 28j60) and even the DB 25 connector for  the parallel port of the Amiga!</p>
<p>Only a single wire is missing to make it fully compatible to plipbox. But you can add this one easily…</p>
<p>I added support for this board to the firmware and with <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">v0.2</a> I ship a  new firmware image just for this board… Besides adding the new board  nothing has changed in this release. So Arduino users can still stay at  v0.1 without any drawbacks.</p>
<p>See the plipbox <a title="plipbox hardware" href="http://lallafa.de/blog/amiga-projects/plipbox/plipbox-hardware/">hardware</a> and <a title="plipbox firmware" href="http://lallafa.de/blog/amiga-projects/plipbox/plipbox-firmware/">firmware</a> page for all details on the new board.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/09/plibox-0-2-added-support-for-avr-net-io-board/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>plipbox firmware 0.1 released</title>
		<link>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/</link>
		<comments>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/#comments</comments>
		<pubDate>Sun, 22 Jul 2012 15:30:30 +0000</pubDate>
		<dc:creator>lallafa</dc:creator>
				<category><![CDATA[Amiga]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac Stuff]]></category>

		<guid isPermaLink="false">http://lallafa.de/blog/?p=536</guid>
		<description><![CDATA[<p>The wait is over: the first firmware release of the plipbox project is available. Simply head over to my plipbox page and fetch your copy&#8230;</p> <p>The first release includes full DHCP support and statically configured Ethernet operation, so it should work on most local networks out there. With ARP and TCP/UDP/IP bridging in place, it <span style="color:#777"> . . . &#8594; Read More: <a href="http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/">plipbox firmware 0.1 released</a></span>]]></description>
			<content:encoded><![CDATA[<p>The wait is over: the first firmware release of the plipbox project is available. Simply head over to my <a title="plipbox" href="http://lallafa.de/blog/amiga-projects/plipbox/">plipbox page</a> and fetch your copy&#8230;</p>
<p>The first release includes full DHCP support and statically configured Ethernet operation, so it should work on most local networks out there. With ARP and TCP/UDP/IP bridging in place, it has all essential features I envisioned for this project already available&#8230; And it really works well: I am already totally used to have my Amiga 500 in the network&#8230; (without thinking about starting a SLIP server first <img src='http://lallafa.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now I hope that it works for you, too&#8230; just drop me a comment if you found bugs or have any remarks!</p>
]]></content:encoded>
			<wfw:commentRss>http://lallafa.de/blog/2012/07/plipbox-firmware-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
