<?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>Bret Kuhns &#187; OpenLog</title>
	<atom:link href="http://www.bretkuhns.com/blog/tag/openlog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bretkuhns.com/blog</link>
	<description>Programming, Cars, and Life</description>
	<lastBuildDate>Sun, 19 Dec 2010 19:05:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hyperterminal Replacement For Linux</title>
		<link>http://www.bretkuhns.com/blog/2010/03/hyperterminal-replacement-for-linux/</link>
		<comments>http://www.bretkuhns.com/blog/2010/03/hyperterminal-replacement-for-linux/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 18:17:21 +0000</pubDate>
		<dc:creator>Bret Kuhns</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenLog]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.bretkuhns.com/blog/?p=108</guid>
		<description><![CDATA[This is a little gem I found recently when I needed to communicate with my OpenLog board. A lot of tutorials want you to pull up HyperTerminal in Windows to talk to OpenLog over the USB-&#62;UART bridge. My biggest problem with this is that I&#8217;m primarily a Linux user, where HyperTerminal is unavailable. That&#8217;s all [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little gem I found recently when I needed to communicate with my <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9530">OpenLog</a> board. A lot of tutorials want you to pull up HyperTerminal in Windows to talk to OpenLog over the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8772">USB-&gt;UART bridge</a>. My biggest problem with this is that I&#8217;m primarily a Linux user, where HyperTerminal is unavailable. That&#8217;s all well and good, however, I&#8217;ll just boot into my Windows 7 install and do it, right? Wrong. Windows 7 no longer ships with HyperTerminal. I jumped back to my Ubuntu Linux install and started hunting for a HyperTerminal replacement. The best solution I ended up finding was a command-line application called <a href="http://en.wikipedia.org/wiki/Minicom">minicom</a>. This handy little app is a bit to get the hang of, but once you&#8217;re using it, it works like a charm. Here&#8217;s a quick rundown of connecting to a serial device over USB using Minicom.<span id="more-108"></span></p>
<p>First, let&#8217;s figure out the path to our serial device. Ubuntu typically places these devices at /dev/ttyUSB#. Use the following command to determine the appropriate number of your device.</p>
<pre class="brush: plain; gutter: false;">$ ls /dev/ttyUSB*</pre>
<p>Now we&#8217;ll install Minicom to get started.</p>
<pre class="brush: plain; gutter: false;">$ sudo apt-get install minicom</pre>
<p>Once that&#8217;s complete, we&#8217;ll need to configure Minicom so that it&#8217;s using the correct port. To do this, run the command below.</p>
<pre class="brush: plain; gutter: false;">$ minicom -s</pre>
<p>You&#8217;ll be prompted with a configuration menu. Arrow down to &#8220;Serial port setup&#8221; and press enter.</p>
<div id="_mcePaste">
<pre class="brush: plain; gutter: false;">+--------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0               |
| B - Lockfile Location     : /var/lock                  |
| C -   Callin Program      :                            |
| D -  Callout Program      :                            |
| E -    Bps/Par/Bits       : 115200 8N1                 |
| F - Hardware Flow Control : Yes                        |
| G - Software Flow Control : No                         |
|                                                        |
|    Change which setting?                               |
+--------------------------------------------------------+</pre>
</div>
<p>The first line will give you the path to the serial port Minicom is going to talk to. If this doesn&#8217;t match the /dev/ttyUSB# path you found above, hit &#8220;A&#8221; on your keyboard and enter in the correct path and press enter. Now double check your Bps/Par/Bits settings. The default 9600 8N1 is pretty standard, but you may need to hit &#8220;E&#8221; and provide a different Speed setting depending on the device you&#8217;re talking to. In my case, OpenLog is running at 115200bps, so I went through and made the appropriate changes. Hit enter again to exit the serial port settings menu. The other settings can usually be left to their default values, so arrow down to &#8220;Save setup as dfl&#8221; to save this configuration as default. This way you don&#8217;t have to configure Minicom every time you use it. Now arrow down to &#8220;Exit&#8221; and hit enter. Minicom will now start up using the settings you specified. If all goes well, you should now be connected to your device and ready to send/receive. From now on, you can start minicom without the -s switch.</p>
<pre class="brush: plain; gutter: false;">$ minicom</pre>
<p>Got a better HyperTerminal replacement that you use in Linux? Let me know about it in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bretkuhns.com/blog/2010/03/hyperterminal-replacement-for-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flashing OpenLog Firmware in Ubuntu Linux</title>
		<link>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/</link>
		<comments>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:36:37 +0000</pubDate>
		<dc:creator>Bret Kuhns</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenLog]]></category>
		<category><![CDATA[sparkfun]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.bretkuhns.com/blog/?p=85</guid>
		<description><![CDATA[I recently hit a bug in the Sparkfun OpenLog v1.1 firmware that left the device useless. I found out the hard way that version 1.1 only supports up to 255 log files. Once it hits this limit the firmware doesn&#8217;t know what to do with itself and loops endlessly. This even prevents you from entering command [...]]]></description>
			<content:encoded><![CDATA[<p>I recently hit a bug in the Sparkfun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9530">OpenLog </a>v1.1 firmware that left the device useless. I found out the hard way that version 1.1 only supports up to 255 log files. Once it hits this limit the firmware doesn&#8217;t know what to do with itself and loops endlessly. This even prevents you from entering command mode where you could otherwise reset the log number. <a href="http://github.com/nseidle">Nate Seidle</a> at SparkFun quickly released an update, v1.2, to correct this problem I was having. But now I had to figure out how to flash the firmware on my OpenLog. It turns out the process is extremely easy in Ubuntu, but the GitHub documentation targets mostly Windows, so I decided to document the process for Ubuntu users from start to finish here.<span id="more-85"></span></p>
<p>I expect that you have the Arduino IDE <a href="http://www.arduino.cc/playground/Learning/Linux">installed and running properly</a>. This means the avrdude and avr-gcc libraries necessary to flash OpenLog will already be installed. Next step is to pull the firmware source code from the <a href="http://github.com/nseidle/OpenLog">GitHub repository</a>. If you don&#8217;t have git installed, run the following command:</p>
<pre class="brush: plain; gutter: false;">$ sudo apt-get install git-core</pre>
<p>Now you can run the git command to pull the source code over the read-only HTTP path. This is generally the easiest path to use to avoid issues with proxies or closed/blocked ports on your network.</p>
<pre class="brush: plain; gutter: false;">$ git clone http://github.com/nseidle/OpenLog.git</pre>
<p>Once the command has completed, you&#8217;ll have an OpenLog directory in your currently active directory. Time to compile the source code to make the required hex file that we&#8217;ll write to OpenLog.</p>
<pre class="brush: plain; gutter: false;">$ cd OpenLog/Code/</pre>
<pre class="brush: plain; gutter: false;">$ make</pre>
<p style="text-align: left;">You should see several notices about compiling various .c files, linking main.elf, and most importantly loading main.hex. Now we need to get that hex file onto OpenLog. Grab your trusty <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8772">FTDI breakout board</a> (you should never leave home without it) and wire it to OpenLog as shown below.</p>
<p style="text-align: left; padding-top: 0;"><a href="http://www.bretkuhns.com/blog/wp-content/uploads/2010/03/FTDI-Connections.jpg"><img class="aligncenter size-medium wp-image-86" title="FTDI to OpenLog connection diagram." src="http://www.bretkuhns.com/blog/wp-content/uploads/2010/03/FTDI-Connections-300x96.jpg" alt="" width="300" height="96" /></a></p>
<p style="text-align: left; padding-top: 0;">Before connecting the FTDI to your computer, we want to make sure we have the correct device path for the next step. Look at the list of all tty-capable USB devices. It&#8217;s okay if none show up right now.</p>
<p style="text-align: left; padding-top: 0;">
<pre class="brush: plain; gutter: false;">$ ls /dev/ttyUSB*</pre>
<p style="text-align: left; padding-top: 0;">Now connect the FTDI board and run the command again. The new ttyUSB# device listed is your FTDI board. I&#8217;ll use ttyUSB0 in the command below, so you will need to change the zero if your # is different.</p>
<p style="text-align: left; padding-top: 0;">I hope you have an extra wire at hand. The Linux build of avrdude unfortunately doesn&#8217;t have the &#8220;DTR wiggle&#8221; necessary to automatically reset OpenLog&#8217;s ATMega328p, so we have to do it ourselves. Grab a wire and connect one end to ground. If necessary, the microSD socket&#8217;s case can be used as a ground if you don&#8217;t have OpenLog on a breadboard. You&#8217;ll need to tap the other end of the wire onto the GPIO pin 6 on OpenLog. This is the square pin pad near the &#8220;O&#8221; in &#8220;OpenLog&#8221; on the silkscreen (the bottom-left most pin in the image featured above). Timing here is of the essence; run the command below, hit enter on your keyboard, then immediately tap the other end of your grounded wire to pin 6. Don&#8217;t leave the wire sitting on pin 6, it&#8217;s just a quick tap to momentarily ground it and force a reset.</p>
<p style="text-align: left; padding-top: 0;">
<div id="_mcePaste">
<pre class="brush: plain; gutter: false;">$ avrdude -p atmega328p -P /dev/ttyUSB0 -c stk500v1 -b 57600 -U flash:w:main.hex</pre>
</div>
<p>Don&#8217;t forget to change the ttyUSB# number if necessary. If your timing was good enough, you should see avrdude show a progress bar as it flashes the hex firmware onto OpenLog. If not, you&#8217;ll likely see errors like &#8220;programmer not responding&#8221; or &#8220;out of sync&#8221;. Try try again. Tapping enter and grounding pin 6 should be almost instantaneous, with the enter key coming ever so slightly first.</p>
<p>After a few seconds, the updated firmware will now be on your OpenLog chip and you&#8217;ll be on your merry way. I hope this helps someone out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

