<?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>Steve's Software Trek</title>
	<atom:link href="http://steve.kargs.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://steve.kargs.net</link>
	<description>Open Source Software Haven</description>
	<lastBuildDate>Sun, 13 Sep 2009 18:16:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu Linux on Desktop PC</title>
		<link>http://steve.kargs.net/software/ubuntu-linux-on-desktop-pc/</link>
		<comments>http://steve.kargs.net/software/ubuntu-linux-on-desktop-pc/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 01:47:12 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=163</guid>
		<description><![CDATA[I refurbished a couple of PCs for my family to use, and installed the latest Ubuntu Linux on them &#8211; Ubuntu 9.04 Jaunty.  I also updated my dual boot work computer with the latest Ubuntu &#8211; it was running Kubuntu and the latest Kubuntu is just foreign to me.
As is usually the case, adding additional [...]]]></description>
			<content:encoded><![CDATA[<p>I refurbished a couple of PCs for my family to use, and installed the latest Ubuntu Linux on them &#8211; Ubuntu 9.04 Jaunty.  I also updated my dual boot work computer with the latest Ubuntu &#8211; it was running Kubuntu and the latest Kubuntu is just foreign to me.</p>
<p>As is usually the case, adding additional packages is essential to getting the computer working right for me.</p>
<h3>Add Codecs, Java, and other Customizations</h3>
<p>The official way to do this is documented in the Ubuntu Wiki under <a href="https://wiki.ubuntu.com/CommonCustomizations" target="_blank">CommonCustomizations</a>.  There is also a wiki page on <a href="https://wiki.ubuntu.com/EasyCodecInstallation">EasyCodecInstallation</a>.  The official meta package is called “ubuntu-restricted-extras” and this installs:</p>
<ul>
<li>MP3 playback and decoding</li>
<li>Sun Java runtime environment</li>
<li>Flash plugin</li>
<li>DVD playback</li>
<li>LAME (to create MP3 compressed audio files)</li>
<li>msttcorefonts (may be missing in kubuntu extras)</li>
<li>DeCSS script to download and install for DVD viewing</li>
</ul>
<p><code>$ sudo apt-get install ubuntu-restricted-extras</code><br />
<code>$ sudo /usr/share/doc/libdvdread4/install-css.sh</code><br />
<code>$ sudo apt-get install msttcorefonts</code></p>
<h3>Add the ability to compile, edit, and maintain code</h3>
<p>Here are the compilers and their documents<br />
<code>$ sudo apt-get install build-essential subversion-tools  gcc-4.2-doc glibc-doc manpages-dev</code><br />
<code>$ sudo apt-get install mingw32 mingw32-binutils mingw32-runtime</code><br />
I need access to subversion and XSLT ChangeLog tools<br />
<code>$ sudo apt-get install subversion-tools</code><br />
<code>$ sudo apt-get install xsltproc</code><br />
I install a couple of editors, useful for various things.  Kate is already installed.<br />
<code>$ sudo apt-get install scite</code><br />
<code>$ sudo apt-get install vim-full</code><br />
Useful tools for cleaning up code, converting comments and line endings, and code statistics:<br />
<code>$ sudo apt-get install splint</code><br />
<code>$ sudo apt-get install sloccount</code><br />
<code>$ sudo apt-get install indent</code><br />
<code>$ sudo apt-get install liwc</code><br />
<code>$ sudo apt-get install tofrodos</code></p>
<h3>Add favorite online music source and music/video player VLC</h3>
<p><code>$ sudo apt-get install streamtuner</code><br />
<code>$ sudo apt-get install vlc</code></p>
<h3>Add the Adobe Flash Plugin and Sun Java JRE</h3>
<p>A lot of websites use Flash or Java for their user interface, so it seems that they are essential.</p>
<p><code>$ sudo apt-get install adobe-flashplugin</code><code><br />
$ sudo apt-get install sun-java6-jre</code></p>
<h3>Get rid of annoying PC speaker beep</h3>
<p>Using a console, remove the PC Speaker driver from the kernel:<br />
<code>$ sudo modprobe -r pcspkr</code><br />
Create <strong>/etc/modprobe.d/blacklist-user.conf</strong> and add a line to keep the PC Speaker driver from automatically loading:</p>
<p><code># Keep the annoying beep from occurring</code><code><br />
# don't load the PC Speaker driver</code><br />
<code>blacklist pcspkr</code></p>
<h2><a rel="nofollow" href="https://help.ubuntu.com/community/SynapticsTouchpad" target="_blank">SynapticsTouchpad</a></h2>
<p>The laptop has a touchpad, which is really annoying when you also have a USB mouse attached, because the touchpad picks up thumps made by my big fingers and makes the mouse click somewhere that you didn&#8217;t want it to click.  Correcting this in Ubunut Jaunty is as easy as selecting <strong>System &gt; Preferences &gt; Mouse</strong>, under the Touchpad tab. Uncheck the <strong>Enable mouse clicks with touchpad</strong> check box.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/software/ubuntu-linux-on-desktop-pc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVR ISP mkII on Ubuntu Hardy</title>
		<link>http://steve.kargs.net/bacnet/avr-isp-mkii-on-ubuntu-hardy/</link>
		<comments>http://steve.kargs.net/bacnet/avr-isp-mkii-on-ubuntu-hardy/#comments</comments>
		<pubDate>Wed, 13 May 2009 01:10:52 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=154</guid>
		<description><![CDATA[
I created a BACnet Development Kit, compiled the open source BACnet Protocol Stack hosted on SourceForge.net firmware using gcc-avr, and attempted to load the firmware onto the kit using an Atmel AVR ISP mkII USB programmer.  I connected the AVR ISP mkII to my Ubuntu Hardy Linux PC and attached the 2&#215;3 ISP cable to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2009/05/bdk-atxx4-mstp.jpg"><img class="size-thumbnail wp-image-156 alignright" title="bdk-atxx4-mstp" src="http://steve.kargs.net/wp-content/uploads/2009/05/bdk-atxx4-mstp-150x150.jpg" alt="BACnet Development Kit" width="150" height="150" /></a></p>
<p>I created a <a href="http://bacnetdevelopmentkit.com/" target="_blank">BACnet Development Kit</a>, compiled the <a href="http://bacnet.sourceforge.net/" target="_blank">open source BACnet Protocol Stack hosted on SourceForge.net</a> firmware using <a href="http://www.avrfreaks.net/AVRGCC/" target="_blank">gcc-avr</a>, and attempted to load the firmware onto the kit using an <a href="http://www.atmel.com/dyn/Products/tools_card.asp?tool_id=3808" target="_blank">Atmel AVR ISP mkII</a> USB programmer.  I connected the AVR ISP mkII to my Ubuntu Hardy Linux PC and attached the 2&#215;3 ISP cable to the development kit board, and attempted to program using <a href="http://www.bsdhome.com/avrdude/" target="_blank">avrdude</a>:</p>
<pre>$ avrdude -c avrispmkII -p m644p -P usb -e -U flash:w:bacnet.hex</pre>
<pre>avrdude: usb_open(): cannot read serial number "error sending..."
avrdude: usb_open(): cannot read product name "error sending..."
avrdude: usbdev_open(): error setting configuration...
avrdude: usbdev_open(): did not find any USB device "usb"</pre>
<p>Wow! That wasn&#8217;t nice.  A search on the Internet turned up <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;t=58673&amp;start=0" target="_blank">some answers about how to fix the problem</a>, and I modified my /etc/udev/avarice.rules file to look like this:</p>
<pre>SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avarice_end"

# Atmel Corp. JTAG ICE mkII
SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avarice_end"</pre>
<p>I disconnected and reconnected my AVR ISP mkII, and tried again.  I still had the same results.  I checked that I was a member of the dialout group:</p>
<pre>$ groups
skarg adm dialout cdrom floppy audio dip video plugdev users fuse lpadmin admin</pre>
<p>I looked at the symbolic link in the /etc/udev/rules.d/ directory and also consumed the README file.  My file had the following name:</p>
<pre>/etc/udev/rules.d/z60_avarice.rules</pre>
<p>So I changed the filename:</p>
<pre>$ sudo mv /etc/udev/rules.d/z60_avarice.rules /etc/udev/rules.d/60-avarice.rules</pre>
<p>I unplugged the AVR ISP mkII, and plugged it in again.  I tried to run avrdude again:</p>
<pre>avrdude -c avrispmkII   \
     -p m644p -P usb -e        \
     -U flash:w:bacnet.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e960a
avrdude: erasing chip
avrdude: reading input file "bacnet.hex"
avrdude: input file bacnet.hex auto detected as Intel Hex
avrdude: writing flash (57406 bytes):

Writing | ################################################## | 100% 6.31s

avrdude: 57406 bytes of flash written
avrdude: verifying flash memory against bacnet.hex:
avrdude: load data flash data from input file bacnet.hex:
avrdude: input file bacnet.hex auto detected as Intel Hex
avrdude: input file bacnet.hex contains 57406 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 5.41s

avrdude: verifying ...
avrdude: 57406 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.</pre>
<p>The kit programmed successfully, and began operation.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/avr-isp-mkii-on-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireshark and BACnet MS/TP</title>
		<link>http://steve.kargs.net/bacnet/wireshark-and-bacnet-mstp/</link>
		<comments>http://steve.kargs.net/bacnet/wireshark-and-bacnet-mstp/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 06:26:51 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=139</guid>
		<description><![CDATA[I wrote an article about Analyzing BACnet with Wireshark for ASHRAE Journal special supplement BACnet Today.  ASHRAE is very particular about endorsing specific company products, and removed some references I had to information about how BACnet MS/TP can be supported on Wireshark by adding an external interface which sends Ethernet SNAP protocol packets.  The external [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2008/11/wireshark_bacnet_mstp_cimetrics.png"><img class="alignright size-thumbnail wp-image-140" title="wireshark_bacnet_mstp_cimetrics" src="http://steve.kargs.net/wp-content/uploads/2008/11/wireshark_bacnet_mstp_cimetrics-150x150.png" alt="" width="150" height="150" /></a>I wrote an article about <a href="http://www.bacnet.org/Bibliography/BACnet-Today-08/Karg_2008.pdf" target="_blank">Analyzing BACnet with Wireshark</a> for <a href="http://www.ashrae.org/publications/page/540" target="_blank">ASHRAE Journal</a> special supplement BACnet Today.  <a href="http://www.ashrae.org/" target="_blank">ASHRAE</a> is very particular about endorsing specific company products, and removed some references I had to information about how BACnet MS/TP can be supported on Wireshark by adding an external interface which sends Ethernet SNAP protocol packets.  The external interface was originally a <a href="http://cimetrics.com/products/proddetail.php?prod=B2110&amp;cat=1" target="_blank">Cimetrics U+4</a> device which connects BACnet MS/TP via USB to a computer, and uses a special driver to appear as a network interface to <a href="http://wireshark.org/" target="_blank">Wireshark</a>.</p>
<p>In April, 2008, I was informed that the Cimetrics U+4 packets showed up in Wireshark, but were not decoded correctly.  I asked for a sample of the capture, and reverse engineered the header.  I then created the BACnet MS/TP decoding in Wireshark in order to display the MS/TP data, and passed the BACnet Network Layer and Application Layer information along to the existing dissectors.</p>
<p>The beauty of the BACnet protocol is that it is layered.  The NPDU (network layer) and APDU (application layer) encodings are the same regardless of the datalink layer used.  The NDPU layer is decoded by <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-bacnet.c" target="_blank">packet-bacnet.c</a>, which passes the APDU layer to <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-bacapp.c" target="_blank">packet-bacapp.c</a>.  The BACnet MS/TP datalink layer is decoded by <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-mstp.c" target="_blank">packet-mstp.c</a> which I created, and passes the NPDU, if it exists, to <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-bacnet.c" target="_blank">packet-bacnet.c</a>, for decoding.  The ARCNET, Ethernet, and BACnet/IP (<a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-bvlc.c" target="_blank">packet-bvlc.c</a>) all pass a relevant packet to <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-bacnet.c" target="_blank">packet-bacnet.c</a> for BACnet decoding.  I created <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-cimetrics.c" target="_blank">packet-cimetrics.c</a> for the Cimetrics header which passes the BACnet  MS/TP datalink layer to <a href="http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-mstp.c" target="_blank">packet-mstp.c</a>.</p>
<p>The BACnet MS/TP patches were accepted into the <a href="http://wireshark.org/" target="_blank">Wireshark </a>repository on May 13, 2008, checked in as SVN 25291.  The SVN 25881 was a fix to the Length decoding.  The BACnet MS/TP decoding eventually made it into the <a href="http://www.wireshark.org/download/" target="_blank">Wireshark 1.1 development release</a>, but is not present in the Wireshark 1.0 stable release.</p>
<p>Wireshark now sees packets with the Cimetrics U+4 signature encapsulated in the SNAP protocol as MS/TP packets, and it is able to open a file that has been saved in PCAP format using the MS/TP WTAP signature.  But I didn&#8217;t have a Cimetrics U+4 device.  So I used a standard RS485 converter, my <a href="http://bacnet.sourceforge.net/" target="_blank">open source BACnet stack</a>, and wrote <a href="http://bacnet.svn.sourceforge.net/viewvc/bacnet/trunk/bacnet-stack/demo/mstpcap/">a simple application to packetize the MS/TP frames</a> and saves them to PCAP format.  I could now capture MS/TP packets and view them!</p>
<p>In August, 2008, I received an email from John in New Zealand.  His intention was &#8220;to use an existing simple VB  application that captures MS/TP traffic from a low cost USB to RS-485 converter,  to send the MS/TP packets using Winsock/UDP to Wireshark for final dissection  and display.&#8221;  I figured that we could do this by making use of the existing <a href="http://en.wikipedia.org/wiki/Subnetwork_Access_Protocol" target="_blank">SNAP protocol</a> dissector that I created for the Cimetrics packets.</p>
<p>I reused the code that I had written to save in PCAP format, and wrote <a href="http://bacnet.svn.sourceforge.net/viewvc/bacnet/trunk/bacnet-stack/ports/linux/mstpsnap.c" target="_blank">a simple application</a> to packetize the MS/TP frames and resend them on Ethernet as the Cimetrics U+4 signature encapsulated in the SNAP protocol.  I got it to work under Linux, but would probably need to use WinPcap to get it to work under Windows.</p>
<p>Sending those <a href="http://en.wikipedia.org/wiki/Subnetwork_Access_Protocol" target="_blank">SNAP protocol</a> packets on Ethernet allows the display of BACnet MS/TP packets in realtime alongside BACnet/IP and BACnet Ethernet.  This makes it very easy to relate traffic going to and from workstations and routers with what is happening on the BACnet MS/TP network.</p>
<p>There are some <a href="http://kargs.net/captures/" target="_blank">sample captures</a> (see <a href="http://kargs.net/captures/cimetrics_mstp.pcap" target="_blank">cimetrics_mstp.pcap</a> and <a href="http://kargs.net/captures/mstp_wtap.cap" target="_blank">mstp_wtap.cap</a>) that demostrate some of the abilities of Wireshark.<a href="http://kargs.net/captures/" target="_blank"><br />
</a></p>
<p>I use a USB to RS-485 converter from SerialGear <a href="http://www.serialgear.com/Industrial-Serial-Adapters-USB-COMi-SI-M.html" target="_blank">USB-COMi-SI-M</a>, and am told that the <a href="http://www.bb-elec.com/bb-elec/literature/USxPTL4-1207ds.pdf" target="_blank">B&amp;B Electronics USOPTL4</a> works very well.  I am also told that the USB to RS-485 adapters that use the FTDI chipset are great for this as they allow the use of 76800 baud which is usually the stumbling block for native MS/TP interfacing with a standard PC serial port.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/wireshark-and-bacnet-mstp/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>GIMP: Removing Noise from Digital Photos</title>
		<link>http://steve.kargs.net/photography/gimp-removing-noise-from-digital-photos/</link>
		<comments>http://steve.kargs.net/photography/gimp-removing-noise-from-digital-photos/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 15:36:47 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=132</guid>
		<description><![CDATA[I shot some low light photography at the youth group Halloween dance using a Casio Exilim point-n-shoot, and some of the photos had digital noise, or grain (as we called it in the days of film).
I searched the internet for some assistance in removing the digital noise using the GNU Image Manipulation Program (GIMP), and [...]]]></description>
			<content:encoded><![CDATA[<p>I shot some low light photography at the youth group <a href="http://en.wikipedia.org/wiki/Halloween" target="_blank">Halloween</a> dance using a Casio Exilim point-n-shoot, and some of the photos had <a href="http://en.wikipedia.org/wiki/Image_noise" target="_blank">digital noise</a>, or <a href="http://en.wikipedia.org/wiki/Film_grain" target="_blank">grain</a> (as we called it in the days of film).</p>
<p>I searched the internet for some assistance in removing the digital noise using the <a href="http://gimp.org/" target="_blank">GNU Image Manipulation Program (GIMP)</a>, and stumbled upon a well written post about <a href="http://photodoto.com/free-noise-reduction-plugin-for-the-gimp/" target="_blank">how to remove digital noise</a>.  The technique makes use of the <a href="http://cimg.sourceforge.net/greycstoration/" target="_blank">GREYCstoration</a> plugin for the GIMP.</p>
<p>I use the GIMP on <a href="http://www.kubuntu.org/" target="_blank">Kubuntu Linux</a>, and wondered if there was already a package created for GREYCstoration.</p>
<pre>$ apt-cache search greyc
gimp-plugin-registry - A repository of optional extensions for The GIMP</pre>
<p>I found it!  So I installed it:</p>
<pre>$ sudo apt-get install gimp-plugin-registry</pre>
<p>After restarting the GIMP, here are the results:</p>
<div id="attachment_134" class="wp-caption alignleft" style="width: 160px"><a href="http://steve.kargs.net/wp-content/uploads/2008/10/halloweenslowdance.jpg"><img class="size-thumbnail wp-image-134" title="halloweenslowdance" src="http://steve.kargs.net/wp-content/uploads/2008/10/halloweenslowdance-150x150.jpg" alt="Low light photo (scaled)" width="150" height="150" /></a><p class="wp-caption-text">Low light photo (scaled)</p></div>
<div id="attachment_134" class="wp-caption alignright" style="width: 160px"><a href="http://steve.kargs.net/wp-content/uploads/2008/10/halloweenslowdancecropscaled.jpg"><img class="size-thumbnail wp-image-134" title="halloweenslowdancecropscaled" src="http://steve.kargs.net/wp-content/uploads/2008/10/halloweenslowdancecropscaled-150x150.jpg" alt="Low light photo (GREYCstoration, scaled)" width="150" height="150" /></a><p class="wp-caption-text">Low light photo (GREYCstoration, scaled)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/photography/gimp-removing-noise-from-digital-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interrupt Safe Ring Buffer Library</title>
		<link>http://steve.kargs.net/software/interrupt-safe-ring-buffer-library/</link>
		<comments>http://steve.kargs.net/software/interrupt-safe-ring-buffer-library/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 15:35:21 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=116</guid>
		<description><![CDATA[
I created a ring buffer library for embedded systems in C some years ago and have been using it when I need to add a simple queue to my software.  I knew it worked correctly since I created unit tests to validate the code.  However, I noticed that it wasn&#8217;t interrupt safe since one of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2008/10/christhoper_circular.jpg"><img class="size-thumbnail wp-image-123 alignright" title="Christoper looks through a circular tube" src="http://steve.kargs.net/wp-content/uploads/2008/10/christhoper_circular-150x150.jpg" alt="Christoper looks through a circular tube" width="150" height="150" /></a></p>
<p>I created a <a href="http://en.wikipedia.org/wiki/Circular_buffer" target="_blank">ring buffer</a> library for embedded systems in C some years ago and have been using it when I need to add a simple queue to my software.  I knew it worked correctly since I <a href="http://kargs.net/docs/simplest_unit_test.pdf" target="_blank">created unit tests</a> to validate the code.  However, I noticed that it wasn&#8217;t interrupt safe since one of the consumer variables is shared by the producer (the count).  This library requires disabling interrupts when consuming.  Not what I wanted.</p>
<p>There are a <a href="http://en.wikipedia.org/wiki/Circular_buffer" target="_blank">number of difficulties</a> when designing ring buffers, mostly dealing with efficiencies of code or data, or the struggle between consumers and producers.  My generic ringbuf library had used a single fill count, but the count had to be updated by the <a href="http://en.wikipedia.org/wiki/Interrupt_handler" target="_blank">interrupt service routine</a> (producer) and by the routine that retrieved the data (consumer).  I tried to use read and write offset indices, but that required that I always keep an element open since the you can&#8217;t tell if the ring is empty or full when the head and tail are the same.</p>
<p>Absolute indices appeared to be interrupt safe, although they require that the buffer length be a power of two.  That seemed to be flexible enough for most embedded work.  I modified and tested my ring buffer library using that method, but my ringbuf, which allowed for a fixed length element,  seemed to be overkill for what I was using it for &#8211; gathering bytes from a serial interrupt service routine.  Its <a href="http://en.wikipedia.org/wiki/API" target="_blank">API</a> also had a slight flaw such that if the consumer retrieved the data (via <a href="http://en.wikipedia.org/wiki/Push_and_pop" target="_blank">Pop</a> rather than just viewing the first element), the producer was free to put new data into the buffer, overwriting the data just retrieved.</p>
<p>I had started my ring buffer library as a simple character (one byte) <a href="http://en.wikipedia.org/wiki/FIFO" target="_blank">FIFO</a> &#8211; first in, first out.  So, I revisited that code, and modified it to use absolute indices.  A simple byte ring buffer, first in, first out.  Now I had interrupt safe code that would work in my serial interrupt service routine.</p>
<p>Why go to the trouble to make a library module to handle a ring buffer when slapping the following <a href="http://www.embeddedrelated.com/usenet/embedded/show/77084-1.php" target="_blank">quick and dirty ring buffer code</a> (from Stefan) into the serial module would have worked as well?</p>
<pre>   #define N 128
   volatile unsigned int head, tail;
   volatile char buffer[N];
   unsigned int inuse() { return head - tail; }
   void put(char c) { if (inuse() != N) { buffer[head++%N] = c; } }
   void get(char* c) { if (inuse() != 0) { *c = buffer[tail++%N]; } }</pre>
<p>Because I needed to know that it worked correctly, and I like reusable library modules.  Especially high quality reusable modules.  Especially high quality reusable modules that include unit tests to validate functionality.  Unit tests that also serve as guides for implementers.</p>
<p>The new module files are <a href="http://kargs.net/code/ringbuf.c" target="_blank">ringbuf.c</a> and <a href="http://kargs.net/code/ringbuf.h">ringbuf.h</a> for the ring buffer with fixed sized elements, and <a href="http://kargs.net/code/fifo.c" target="_blank">fifo.c</a> and <a href="http://kargs.net/code/fifo.h" target="_blank">fifo.h</a> for the ring buffer with byte sized elements. All my versions of the ring buffer and the <a href="http://kargs.net/docs/simplest_unit_test.pdf" target="_blank">unit testing framework</a> can be found in the <a href="http://kargs.net/code/ringbuf.zip" target="_blank">ringbuf.zip</a> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/software/interrupt-safe-ring-buffer-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BACnet &#8211; First to the Moon, and Beyond!</title>
		<link>http://steve.kargs.net/bacnet/bacnet-first-to-the-moon-and-beyond/</link>
		<comments>http://steve.kargs.net/bacnet/bacnet-first-to-the-moon-and-beyond/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 13:06:45 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=112</guid>
		<description><![CDATA[
I drove to the BACnet meetings in nearby Atlanta and Bill photographed my license plate.  We need lofty goals, don&#8217;t we?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2008/09/bacnet-firsttothemoon.jpg"><img class="alignnone size-full wp-image-113" title="bacnet-firsttothemoon" src="http://steve.kargs.net/wp-content/uploads/2008/09/bacnet-firsttothemoon.jpg" alt="" width="500" height="257" /></a></p>
<p>I drove to the BACnet meetings in nearby Atlanta and Bill photographed my license plate.  We need lofty goals, don&#8217;t we?</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/bacnet-first-to-the-moon-and-beyond/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert to MP3 Konqueror Service Menu</title>
		<link>http://steve.kargs.net/linux/convert-to-mp3-konqueror-service-menu/</link>
		<comments>http://steve.kargs.net/linux/convert-to-mp3-konqueror-service-menu/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 13:17:22 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=110</guid>
		<description><![CDATA[I wanted an easy way to convert music to MP3 from various formats under Konqueror in KDE on Kubuntu Linux.  I found an interesting post about creating a KDE Service Menu which got me started in the right direction.  However, I didn&#8217;t like the way ffmpeg converted to 64kbps MP3 quality and the bad sounding [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted an easy way to convert music to MP3 from various formats under Konqueror in KDE on Kubuntu Linux.  I found an <a href="http://ubuntuforums.org/showthread.php?t=684029" target="_blank">interesting post about creating a KDE Service Menu</a> which got me started in the right direction.  However, I didn&#8217;t like the way <a href="http://ffmpeg.mplayerhq.hu/" target="_blank">ffmpeg</a> converted to 64kbps MP3 quality and the bad sounding results regardless of the bitrate settings that I chose.  I tried <a href="http://lame.sourceforge.net/" target="_blank">lame</a>, and was quite pleased with the results.  I also didn&#8217;t like the way the service menu used the entire filename without stripping the dotted extension, so I copied another service menu <a href="http://groups.google.co.th/group/alt.comp.lang.perl/browse_thread/thread/dc04e1d8bd91bb35" target="_blank">perl example</a>.  My &#8220;Convert to MP3&#8243; service menu script goes into the following location:</p>
<pre>/usr/share/apps/konqueror/servicemenus/</pre>
<p>File <a href="http://steve.kargs.net/wp-content/uploads/2008/08/convert_mp3.desktop">convertmp3.desktop</a>:</p>
<pre>[Desktop Entry]
ServiceTypes=audio/*
Actions=convertToMP3

[Desktop Action convertToMP3]
Name=Convert to MP3
Exec=lame -V2 %f "`echo %f | perl -pe 's/\.[^.]+$//'`.mp3"</pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/linux/convert-to-mp3-konqueror-service-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gmail IMAP Invalid Credentials in Thunderbird</title>
		<link>http://steve.kargs.net/uncategorized/gmail-imap-invalid-credentials-in-thunderbird/</link>
		<comments>http://steve.kargs.net/uncategorized/gmail-imap-invalid-credentials-in-thunderbird/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 21:29:22 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=109</guid>
		<description><![CDATA[I kept getting &#8220;Invalid Credentials&#8221; in Thunderbird when connected to my Gmail IMAP account.  I found the solution to be:
https://www.google.com/accounts/UnlockCaptcha?
]]></description>
			<content:encoded><![CDATA[<p>I kept getting &#8220;Invalid Credentials&#8221; in Thunderbird when connected to my Gmail IMAP account.  I found the solution to be:</p>
<p><a href="https://www.google.com/accounts/UnlockCaptcha?" target="_blank">https://www.google.com/accounts/UnlockCaptcha?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/uncategorized/gmail-imap-invalid-credentials-in-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Birds Are Fast</title>
		<link>http://steve.kargs.net/photography/birds-are-fast/</link>
		<comments>http://steve.kargs.net/photography/birds-are-fast/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 18:53:33 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=90</guid>
		<description><![CDATA[Birds are fast.  I guess that is why they have been able to survive all these years.  But I want to take a photograph of them!  So, I have learned to be fast.  Not just fast in taking the shot, but also fast regarding the shutter speed.
I usually use a longer lense (300mm) to get [...]]]></description>
			<content:encoded><![CDATA[<p>Birds are fast.  I guess that is why they have been able to survive all these years.  But I want to take a photograph of them!  So, I have learned to be fast.  Not just fast in taking the shot, but also fast regarding the shutter speed.</p>
<p>I usually use a longer lense (300mm) to get in close, and didn&#8217;t realize how much shaking is going on when I am photographing something.  Since a lot of birds eat in the morning or evening, and the setting is my back yard which is wooded, the birds are not in full sun light.  The other challenge in a wooded environment is auto focus.  Too many things for the auto focus to focus on, and how does it know I am looking at a bird?</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/07/blurry_woodpecker.jpg"><img class="alignnone size-thumbnail wp-image-101" title="blurry_woodpecker" src="http://steve.kargs.net/wp-content/uploads/2008/07/blurry_woodpecker-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/shake_cardinal_female.jpg"><img class="alignnone size-thumbnail wp-image-103" title="shake_cardinal_female" src="http://steve.kargs.net/wp-content/uploads/2008/07/shake_cardinal_female-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/in_flight_bird.jpg"><img class="alignnone size-thumbnail wp-image-105" title="in_flight_bird" src="http://steve.kargs.net/wp-content/uploads/2008/07/in_flight_bird-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>1) Focus Problem  2) Lens Shake  3) Missed the Bird</p>
<p>So here is what I do:</p>
<ol>
<li>Increase the ISO.  I set my Canon Digital Rebel XTi to ISO 1600.</li>
<li>Use shutter priority &#8211; TV &#8211; mode.  Set the shutter speed to 1/125s or faster.</li>
<li>Use the rapid fire &#8211; AI Servo &#8211; mode for taking lots of photos very fast.</li>
<li>Use manual focus (sometimes).</li>
</ol>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/07/cardinal_at_feeder.jpg"><img class="alignnone size-thumbnail wp-image-102" title="cardinal_at_feeder" src="http://steve.kargs.net/wp-content/uploads/2008/07/cardinal_at_feeder-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/chickadee_takeoff.jpg"><img class="alignnone size-thumbnail wp-image-104" title="chickadee_takeoff" src="http://steve.kargs.net/wp-content/uploads/2008/07/chickadee_takeoff-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/bird_at_feeder.jpg"><img class="alignnone size-thumbnail wp-image-106" title="bird_at_feeder" src="http://steve.kargs.net/wp-content/uploads/2008/07/bird_at_feeder-150x150.jpg" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/photography/birds-are-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BACnet Meets in Salt Lake City</title>
		<link>http://steve.kargs.net/bacnet/bacnet-meets-in-salt-lake-city/</link>
		<comments>http://steve.kargs.net/bacnet/bacnet-meets-in-salt-lake-city/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 01:33:19 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/?p=91</guid>
		<description><![CDATA[
The BACnet committee met in Salt Lake City at the end of June.  We had a large number of Addenda that had finished public review, and had lots of comments for which to respond.  Salt Lake City had some interesting sites and some street items that I had not seen before.  The &#8220;Look&#8221; on the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2008/07/slc_mountain_range_wide_512.jpg"><img class="alignnone size-full wp-image-94" title="slc_mountain_range_wide_512" src="http://steve.kargs.net/wp-content/uploads/2008/07/slc_mountain_range_wide_512.jpg" alt="Salt Lake City Mountains" width="500" height="125" /></a></p>
<p>The <a href="http://www.bacnet.org/">BACnet</a> committee met in <a href="http://www.visitsaltlake.com/visit/" target="_blank">Salt Lake City</a> at the end of June.  We had a large number of Addenda that had finished public review, and had lots of comments for which to respond.  Salt Lake City had some interesting sites and some street items that I had not seen before.  The &#8220;Look&#8221; on the pavement, as well as the flags used at some crosswalks.<br />
<a href="http://steve.kargs.net/wp-content/uploads/2008/07/lookbothways.jpg"><img class="alignnone size-thumbnail wp-image-92" title="lookbothways" src="http://steve.kargs.net/wp-content/uploads/2008/07/lookbothways-150x150.jpg" alt="Look Both Ways!" /></a> <a href="http://steve.kargs.net/wp-content/uploads/2008/07/streetcrossingflags.jpg"><img class="alignnone size-thumbnail wp-image-93" title="streetcrossingflags" src="http://steve.kargs.net/wp-content/uploads/2008/07/streetcrossingflags-150x150.jpg" alt="Street Crossing Flags" width="150" height="150" /></a></p>
<p>I attended Mass at <a href="http://www.saltlakecathedral.org/" target="_blank">Cathedral of the Madeleine</a> on Saturday night.  It was a beautiful church and a thought provoking sermon.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_altar.jpg"><img class="alignnone size-thumbnail wp-image-95" title="cathedral_altar" src="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_altar-150x150.jpg" alt="Altar at the Cathedral" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_of_the_madeleine.jpg"><img class="alignnone size-thumbnail wp-image-96" title="cathedral_of_the_madeleine" src="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_of_the_madeleine-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_organ_crop.jpg"><img class="alignnone size-thumbnail wp-image-97" title="cathedral_organ_crop" src="http://steve.kargs.net/wp-content/uploads/2008/07/cathedral_organ_crop-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>I ate some wonderful food in Salt Lake City, including a fabulous carrot cake at <a title="Squatter's Pub Brewery" href="http://www.squatters.com/">Squatter&#8217;s Pub Brewery</a>, and some delightful salmon at <a title="Cucina Toscana" href="http://cucina-toscana.com/">Cucina Toscana</a>.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8934.jpg"><img class="alignnone size-thumbnail wp-image-98" title="resized_dscn8934" src="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8934-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8936.jpg"><img class="alignnone size-thumbnail wp-image-100" title="resized_dscn8936" src="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8936-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8935.jpg"><img class="alignnone size-thumbnail wp-image-99" title="resized_dscn8935" src="http://steve.kargs.net/wp-content/uploads/2008/07/resized_dscn8935-150x150.jpg" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/bacnet-meets-in-salt-lake-city/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BACnet Committee Meets in Germantown</title>
		<link>http://steve.kargs.net/bacnet/bacnet-committee-meets-in-germantown/</link>
		<comments>http://steve.kargs.net/bacnet/bacnet-committee-meets-in-germantown/#comments</comments>
		<pubDate>Sat, 03 May 2008 13:55:00 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/bacnet/bacnet-committee-meets-in-germantown/</guid>
		<description><![CDATA[Our fun BACnet committee and working groups met in Germantown at the end of April for a week.  The weather was perfect, and the Montgomery College Germantown Campus was beautiful and lively.
 
We had our traditional Tuesday night BACnet dinner at Dogfish Head Brewery.

Most of the working groups met.

]]></description>
			<content:encoded><![CDATA[<p>Our fun <a href="http://www.bacnet.org/" target="_blank">BACnet</a> committee and working groups met in Germantown at the end of April for a week.  The weather was perfect, and the <a href="http://www.montgomerycollege.edu/" target="_blank">Montgomery College Germantown Campus</a> was beautiful and lively.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7047.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7047.JPG" alt="Cherry Tree in Bloom" title="Cherry Tree in Bloom" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/sunlit_cherry_tree.jpg" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.sunlit_cherry_tree.jpg" alt="sunlit_cherry_tree.jpg" title="sunlit_cherry_tree.jpg" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7064.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7064.JPG" alt="Pink Dogwood in Bloom" title="Pink Dogwood in Bloom" border="0" hspace="2" vspace="2" /></a> </p>
<p>We had our traditional Tuesday night BACnet dinner at <a href="http://www.dogfish.com/" target="_blank">Dogfish Head Brewery</a>.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7016.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7016.JPG" alt="Don and Dave chat about Georgia Tech" title="Don and Dave chat about Georgia Tech" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7019.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7019.JPG" alt="Howard and Christoph" title="Howard and Christoph" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7017.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7017.JPG" alt="Mike, Steve, and David need reading glasses - Craig does not" title="Mike, Steve, and David need reading glasses - Craig does not" border="0" hspace="2" vspace="2" /></a></p>
<p>Most of the working groups met.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7030.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7030.JPG" alt="SSPC 135 BACnet Committee" title="SSPC 135 BACnet Committee" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7015.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7015.JPG" alt="Working Group Meeting" title="Working Group Meeting" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/DSCN7029.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.DSCN7029.JPG" alt="Mike Newman" title="Mike Newman" border="0" hspace="2" vspace="2" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/bacnet-committee-meets-in-germantown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawing a Fairy with Wings &#8211; Tinkerbell</title>
		<link>http://steve.kargs.net/clipart/drawing-a-fairy-with-wings-tinkerbell/</link>
		<comments>http://steve.kargs.net/clipart/drawing-a-fairy-with-wings-tinkerbell/#comments</comments>
		<pubDate>Sat, 03 May 2008 03:19:16 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[clipart]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/clipart/drawing-a-fairy-with-wings-tinkerbell/</guid>
		<description><![CDATA[My daughter Anna got a book in December &#8211; How to Draw Fairies.  I like to draw, so I studied it and began drawing a fairy using Inkscape.  Drawing scalable vector art that can be filled is different than sketching.  After I got the sketching finished, I had to redraw most of [...]]]></description>
			<content:encoded><![CDATA[<p>My daughter Anna got a book in December &#8211; How to Draw Fairies.  I like to draw, so I studied it and began drawing a fairy using <a href="http://inkscape.org/" target="_blank">Inkscape</a>.  Drawing scalable vector art that can be filled is different than sketching.  After I got the sketching finished, I had to redraw most of it to make it fillable so that I could add colors.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/figure.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.figure.png" alt="figure.png" title="figure.png" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/torso.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.torso.png" alt="torso.png" title="torso.png" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell1.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.tinkerbell1.png" alt="tinkerbell1.png" title="tinkerbell1.png" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell2.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.tinkerbell2.png" alt="tinkerbell2.png" title="tinkerbell2.png" border="0" hspace="2" vspace="2" /></a> </p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell3.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.tinkerbell3.png" alt="tinkerbell3.png" title="tinkerbell3.png" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell4.png" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.tinkerbell4.png" alt="tinkerbell4.png" title="tinkerbell4.png" border="0" hspace="2" vspace="2" /></a><a href="http://steve.kargs.net/wp-content/uploads/2008/winged-fairy.svg" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.winged-fairy.png" alt="winged-fairy.png" title="winged-fairy.png" border="0" hspace="2" vspace="2" /></a></p>
<p>I presented my handiwork to Anna.  She told me that Tinkerbell&#8217;s wings were more blue, she needed a ribbon in her hair, and she had tassles or balls on her shoes.  I guess I missed a few critical details.  So back to the drawing board I went.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell.svg"><img src="http://steve.kargs.net/wp-content/uploads/2008/tinkerbell.png" alt="tinkerbell.png" title="tinkerbell.png" border="0" /></a></p>
<p>I had hoped to add this little gem to <a href="http://tuxpaint.org/" target="_blank">Tux Paint</a>, but I am not sure that I can since Tinkerbell is a <a href="http://disney.com/" target="_blank">Disney</a> trademark image.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/clipart/drawing-a-fairy-with-wings-tinkerbell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Kubuntu 8.04 Linux for Dell Latitude D820 Notebook</title>
		<link>http://steve.kargs.net/linux/configuring-kubuntu-804-linux-for-dell-latitude-d820-notebook/</link>
		<comments>http://steve.kargs.net/linux/configuring-kubuntu-804-linux-for-dell-latitude-d820-notebook/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 15:28:22 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/linux/configuring-kubuntu-804-linux-for-dell-latitude-d820-notebook/</guid>
		<description><![CDATA[I was pleasantly surprised to have all the hardware working and a smooth install of Kubuntu 8.04rc for a year old Dell Latitude D820 notebook PC.  There was still a bit of customization to do to make it work like I wanted, but who can fault Canonical for not knowing what I like?
Add Codecs, [...]]]></description>
			<content:encoded><![CDATA[<p>I was pleasantly surprised to have all the hardware working and a smooth install of <a href="http://kubuntu.com/" target="_blank">Kubuntu</a> 8.04rc for a year old <a href="http://dell.com/" target="_blank">Dell Latitude</a> D820 notebook PC.  There was still a bit of customization to do to make it work like I wanted, but who can fault <a href="http://www.canonical.com/" target="_blank">Canonical</a> for not knowing what I like?</p>
<h3>Add Codecs, Java, and other Customizations</h3>
<p>The official way to do this is documented in the Ubuntu Wiki under <a href="https://wiki.ubuntu.com/CommonCustomizations" target="_blank">CommonCustomizations</a>.  There is also a wiki page on <a href="https://wiki.ubuntu.com/EasyCodecInstallation">EasyCodecInstallation</a>.  The official meta package is called &#8220;ubuntu-restricted-extras&#8221; and this installs:</p>
<ul>
<li>MP3 playback and decoding</li>
<li>Sun Java runtime environment</li>
<li>Flash plugin</li>
<li>DVD playback</li>
<li>LAME (to create MP3 compressed audio files)</li>
<li>msttcorefonts (may be missing in kubuntu extras)</li>
<li>DeCSS script to download and install for DVD viewing</li>
</ul>
<p><code>$ sudo apt-get install kubuntu-restricted-extras</code><br />
<code>$ sudo /usr/share/doc/libdvdread3/install-css.sh</code><br />
<code>$ sudo apt-get install msttcorefonts</code></p>
<h3>Add the ability to compile, edit, and maintain code</h3>
<p>Here are the compilers and their documents<br />
<code>$ sudo apt-get install build-essential subversion-tools  gcc-4.2-doc glibc-doc manpages-dev</code><br />
<code>$ sudo apt-get install mingw32 mingw32-binutils mingw32-runtime</code><br />
I need access to subversion and XSLT ChangeLog tools<br />
<code>$ sudo apt-get install subversion-tools</code><br />
<code>$ sudo apt-get install xsltproc</code><br />
I install a couple of editors, useful for various things.  Kate is already installed.<br />
<code>$ sudo apt-get install scite</code><br />
<code>$ sudo apt-get install vim-full</code><br />
Useful tools for cleaning up code, converting comments and line endings, and code statistics:<br />
<code>$ sudo apt-get install splint</code><br />
<code>$ sudo apt-get install sloccount</code><br />
<code>$ sudo apt-get install indent</code><br />
<code>$ sudo apt-get install liwc</code><br />
<code>$ sudo apt-get install tofrodos</code></p>
<h3>Add favorite online music source and music/video player VLC</h3>
<p><code>$ sudo apt-get install streamtuner</code><br />
<code>$ sudo apt-get install vlc</code></p>
<h3>Get rid of limited use Dolphin</h3>
<p>This is one of the main reasons I use Kubuntu and KDE: Konqueror allows me to do many things that Nautilus and Dolphin prevent or are unable to customize<br />
<code>$ sudo apt-get remove dolphin</code></p>
<h3>Get Rid of IcedTea &#8211; Install Sun Java JRE</h3>
<p>I had several errors which prevented me from doing useful work on some websites that used Java.  Turns out that the default install of Kubuntu used <a href="http://iced-tea.org/" target="_blank">IcedTea &#8211; the OpenJDK</a>.  Well, apparently it doesn&#8217;t mimic Java the way the websites expected, and so, it didn&#8217;t work.  Into the hopper it goes, and Sun gets the install.<br />
<code>$ sudo apt-get remove openjdk-6-jre</code><br />
<code>$ sudo apt-get install sun-java6-jre</code></p>
<h3>Get rid of annoying PC speaker beep</h3>
<p>Using a console, remove the PC Speaker driver from the kernel:<br />
<code>$ sudo modprobe -r pcspkr</code><br />
Edit <strong>/etc/modprobe.d/blacklist</strong> and add a new line to keep the PC Speaker driver from automatically loading:<br />
<code># Keep the annoying beep from occurring - don't load the PC Speaker driver</code><br />
<code>blacklist pcspkr</code></p>
<h3>Get rid of annoying Synaptic Tap Button</h3>
<p>Edit the X11 configuration file <code>/etc/X11/xorg.conf</code></p>
<p>Add the Tapbutton line and any other missing lines in the Synaptic Touchpad section:</p>
<p><code>Section "InputDevice"</code><br />
<code>Identifier  "Synaptics Touchpad"</code><br />
<code>Driver      "synaptics"</code><br />
<code>Option      "SendCoreEvents" "true"</code><br />
<code>Option      "Device" "/dev/psaux"</code><br />
<code>Option      "Protocol" "auto-dev"</code><br />
<code>Option      "HorizScrollDelta" "0"</code><br />
<code>Option      "SHMConfig" "On"</code><br />
<code>Option      "TapButton1" "0"</code><br />
<code>EndSection</code></p>
<p>You can disable the Tap Button effect immediately using the synclient tool as long as SHMConfig is On:<br />
<code>$ synclient TapButton1=0</code></p>
<h3>Fix a bug in Firefox 3 rendering Check boxes and Radio boxes</h3>
<p>Check boxes and Radio boxes show as a blank box or circle until the focus is moved away.  This<a href="https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/194624" target="_blank"> bug was reported</a>, and the solution is to install a GTK2 engine:<br />
<code>$ sudo apt-get install gtk2-engines-qtcurve</code></p>
<p>Additionally,  go to System Settings-&gt;Appearance-&gt;GTK Styles and fonts, and Set: Use another style = QtCurve.</p>
<h3>Updating a Toshiba A135 Notebook</h3>
<p>I also updated our Toshiba A135 Notebook and the sound and sound controls now work!  I did have to fix <a href="https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules-2.6.24/+bug/118605">an fglrx bug to keep from locking up on logout</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/linux/configuring-kubuntu-804-linux-for-dell-latitude-d820-notebook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sharkfest &#8216;08 Conference for Wireshark</title>
		<link>http://steve.kargs.net/bacnet/sharkfest-08-conference-for-wireshark/</link>
		<comments>http://steve.kargs.net/bacnet/sharkfest-08-conference-for-wireshark/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 05:53:26 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/bacnet/sharkfest-08-conference-for-wireshark/</guid>
		<description><![CDATA[I was invited to attend Sharkfest &#8216;08, a conference for Wireshark users and developers, held March 31-April 2 at Foothill College in Los Altos Hills, California.  I had a great time, and am so grateful that Gerald invited me to attend.  I attended as a Wireshark developer since I actively maintain the BACnet [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://steve.kargs.net/wp-content/uploads/2008/sharkfest08.gif" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/sharkfest08.gif" alt="sharkfest logo" align="right" border="0" hspace="4" vspace="4" /></a>I was invited to attend <a href="http://www.cacetech.com/SHARKFEST.08/">Sharkfest &#8216;08</a>, a conference for <a href="http://wireshark.org/">Wireshark </a>users and developers, held March 31-April 2 at <a href="http://www.foothill.fhda.edu/">Foothill College</a> in Los Altos Hills, California.  I had a great time, and am so grateful that <a href="http://en.wikipedia.org/wiki/Gerald_Combs">Gerald</a> invited me to attend.  I attended as a Wireshark developer since I actively maintain the BACnet dissector.  I went to the conference with several goals in mind:</p>
<ol>
<li>Figure out how to do BACnet segmentation</li>
<li>Figure out how to get BACnet MS/TP into libpcap/winpcap.</li>
<li>Add a couple of BACnet dissector enhancements to Wireshark.</li>
<li>Learn about using Wireshark for problem network analysis.</li>
</ol>
<p>I attended <a href="http://www.wiresharktraining.com/">Laura Chappell&#8217;s training sessions</a>, and learned a whole lot about Network analysis and the love-hate relationship between TCP/IP SYN, ACK, and Keepalives (#4 completed).   I also wrote some <a href="http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2404">Wireshark code</a> during the classes which I promply submitted (#3 completed).  <a href="http://www.linkedin.com/pub/2/309/5b5">Loris</a> came into the activity center and sat down with my son Joshua and me, and so we discussed how to integrate BACnet MS/TP RS485 from serial port into libpcap/winpcap (#2 completed).  On the last day and the last session of the conference, I attended a session by <a href="http://www.richardsharpe.com/">Richard Sharpe</a> about file sharing protocols and learned about Wireshark conversations (#1 completed).</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/Vint_Gerald.jpg" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.Vint_Gerald.jpg" alt="Vint Cerf and Gerald Combs" title="Vint Cerf and Gerald Combs" align="right" border="0" hspace="4" vspace="4" /></a>We were treated to an inspiration talk on Tuesday morning by <a href="http://en.wikipedia.org/wiki/Vinton_Cerf">Vint Cerf</a>.   After the talk, I went to Laura&#8217;s session, and Joshua talked to Vint.  Vint signed Joshua&#8217;s Half-Life player guide, had photos taken with Vint and Gerald, and the Wireshark crew gave Joshua some <a href="http://en.wikipedia.org/wiki/Promotional_item">swag</a>.</p>
<p>Gerald treated the developers to dinner on Tuesday night at Trader Vic&#8217;s.  I drove to dinner with Joshua and <a href="http://www.linkedin.com/in/jaapkeuter">Jaap Keuter</a>, and learned about PBX systems and Jaap&#8217;s passion for <a href="http://www.xs4all.nl/~skydiver/">skydiving</a>. At dinner I sat next to <a href="http://wiki.wireshark.org/UlfLamping">Ulf Lamping</a> and learned about yet another division of <a href="http://siemens.com/">Siemens</a> and about Ulf&#8217;s love for motorcycle riding. <a href="mailto:guy@alum.mit.edu">Guy Harrris</a> and <a href="http://weblogs.java.net/blog/bondolo/">Mike</a> sat across from me.  Joshua ate with Gerald&#8217;s wife and daughter, and John Bruno&#8217;s wife.</p>
<p>The Foothill College campus was beautiful and on Spring Break.  The food was awesome and plentiful.  The people were great!  The Wireshark sessions were helpful.  Maybe I will get to attend next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/sharkfest-08-conference-for-wireshark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read the Fine Manual or Datasheet</title>
		<link>http://steve.kargs.net/bacnet/read-the-fine-manual-or-datasheet/</link>
		<comments>http://steve.kargs.net/bacnet/read-the-fine-manual-or-datasheet/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 16:20:04 +0000</pubDate>
		<dc:creator>skarg</dc:creator>
				<category><![CDATA[BACnet]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://steve.kargs.net/bacnet/read-the-fine-manual-or-datasheet/</guid>
		<description><![CDATA[I found a bug in my Atmel AVR ATmega168 port of the BACnet Stack at SourceForge.  It was the result of having not read the AVR datasheet close enough.  Here is what the datasheet said:
The Transmit Complete (TXCn) Flag bit is set one when the entire frame in the Transmit Shift egister has [...]]]></description>
			<content:encoded><![CDATA[<p>I found a bug in my <a href="http://www.atmel.com/avr">Atmel AVR</a> ATmega168 port of the <a href="http://bacnet.sourceforge.net/">BACnet Stack at SourceForge</a>.  It was the result of having not read the AVR datasheet close enough.  Here is what the datasheet said:</p>
<blockquote><p><em>The Transmit Complete (TXCn) Flag bit is set one when the entire frame in the Transmit Shift egister has been shifted out and there are no new data currently present in the transmit buffer. The TXCn Flag bit is automatically cleared when a transmit complete interrupt is executed, or it can be cleared by writing a one to its bit location.</em></p></blockquote>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/SAGE_Instruction_Counter.JPG" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.SAGE_Instruction_Counter.JPG" alt="SAGE_Instruction_Counter.JPG" title="SAGE_Instruction_Counter.JPG" align="right" border="0" hspace="4" vspace="4" /></a>I had initially written the code to clear the TXC0 flag by clearing it, rather than setting it.  Since the code could not determine when the end of the transmission occurred, I had added a _delay_us() function from the AVR-GCC library.  This is what the AVR-GCC manual says about that function:</p>
<blockquote><p> <em>In order for these functions to work as intended, compiler optimizations must be enabled, and the delay time must be an expression that is a known constant at compile-time. If these requirements are not met, the resulting delay will be much longer (and basically unpredictable), and applications that otherwise do not use floating-point calculations will experience severe code bloat by the floating-point library routines linked into the application.</em></p></blockquote>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/ENIAC_tubes.jpg" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.ENIAC_tubes.jpg" alt="ENIAC_tubes.jpg" title="ENIAC_tubes.jpg" align="right" border="0" hspace="4" vspace="4" /></a>Severe code bloat indeed!  I had used a non-constant (the Baud Rate) in the delay call, and that resulted in a 4k increase in code size.  After fixing the Transmit Complete flag functionality, I was able to remove the _delay_us, and the code size dimimished by 4k.  On this 16k device, that means alot!</p>
<p>Statistics for the BACnet Stack at SourceForge on the ATmega168 are as follows:</p>
<p>IAR Atmel AVR C/C++ Compiler V5.10A/W32<br />
10 191 bytes of CODE memory (+             36 range fill )<br />
775 bytes of DATA memory (+ 24 absolute )</p>
<p>avr-gcc (GCC) 4.2.2 (WinAVR 20071221rc1)<br />
Program:   12052 bytes (73.6% Full)<br />
Data:        481 bytes (47.0% Full)</p>
<p>With all the extra code space, I went on to add more functionality to the demo. The <a href="http://www.bacnet.org/">BACnet</a> capabilities include WhoIs, I-Am, ReadProperty, and WriteProperty support.  The BACnet objects include a Device object, 10 Binary Value objects, and 10 Analog Value objects.  An LED is controlled by Binary Value object instance 0.  All required object properties can be retrieved using ReadProperty.  The Present_Value property of the Analog Value and Binary Value objects can be written using WriteProperty.  The Object_Identifier, Object_Name, Max_Info_Frames, Max_Master, and baud rate (property 9600) of the Device object can be written using WriteProperty.</p>
<p>After adding all that functionality, I learned the hard way about the C-Stack differences between the IAR AVR compiler and the GCC-AVR compiler.  The IAR compiler uses a fixed CStack size.  If it is not set correctly, the CStack can overflow and cause problems in your code.</p>
<p><a href="http://steve.kargs.net/wp-content/uploads/2008/Johnniac.jpg" rel="lightbox"><img src="http://steve.kargs.net/wp-content/uploads/2008/.thumbs/.Johnniac.jpg" alt="Johnniac.jpg" title="Johnniac.jpg" align="right" border="0" hspace="4" vspace="4" /></a>The GCC compiler uses the <a href="http://www.cs.utah.edu/~regehr/stacktool/">RAM not allocated to variables and text for the C-Stack</a>.  That means that the data value reported by the avr-size program is only part of the picture.  If the data value is 481 bytes, and the device has 1024 total, then 1024-481=543 bytes are used by the C-Stack.  In other words, don&#8217;t be fooled by the &#8220;47% Full&#8221; printed by avr-size and think that you have extra RAM.  You might be able to add some more functionality, but certainly leave some RAM (or alot in my case) for the C-Stack. The GCC-AVR has two intrinsic variables for tracking the C-Stack: _end and __stack.  These can be used to <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=printview&amp;t=52249&amp;start=0">paint the C-Stack prior to its usage, and monitor the C-Stack during runtime</a>. I added this technique to the demo.</p>
<p>The final statistics on ATmega168 demo of the <a href="http://bacnet.sourceforge.net/">BACnet Stack at SourceForge</a>:</p>
<p>IAR Atmel AVR C/C++ Compiler V5.10A/W32<br />
12 732 bytes of CODE memory (+ 36 range fill )<br />
955 bytes of DATA memory (+ 24 absolute ) (CStack=0&#215;200)</p>
<p>avr-gcc (GCC) 4.2.2 (WinAVR 20071221rc1)<br />
Program:   15790 bytes (96.4% Full)<br />
Data:        414 bytes (40.4% Full) (CStack=0&#215;262)</p>
<p>Note: The photos are ancient computer memory from <a href="http://www.computerhistory.org/">The Computer History Museum</a> in <a href="http://en.wikipedia.org/wiki/Mountain_View%2C_California">Mountain View, California</a>.  I&#8217;m visiting the area for the <a href="http://www.cacetech.com/SHARKFEST.08/">Wireshark Sharkfest &#8216;08</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.kargs.net/bacnet/read-the-fine-manual-or-datasheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
