<?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>Snowbotic</title>
	<atom:link href="http://www.snowbotic.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.snowbotic.com</link>
	<description>Robotics. Life. Stuff.</description>
	<lastBuildDate>Sat, 09 Mar 2013 02:41:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Fixing Mac OS X framework errors</title>
		<link>http://www.snowbotic.com/archives/97</link>
		<comments>http://www.snowbotic.com/archives/97#comments</comments>
		<pubDate>Wed, 04 Apr 2012 17:02:09 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=97</guid>
		<description><![CDATA[Due to a series of unfortunate choices, I accidentally convinced OS X 10.6.8 that it was OS X 10.7. I was mostly able to revert the damage, but sometimes Apple&#8217;s Software Update utility will decide to download some 10.7 update and break the a core framework installation, which breaks everything else. What are the symptoms [...]]]></description>
				<content:encoded><![CDATA[<p>Due to a series of unfortunate choices, I accidentally convinced OS X 10.6.8 that it <strong>was</strong> OS X 10.7.  I was mostly able to revert the damage, but sometimes Apple&#8217;s Software Update utility will decide to download some 10.7 update and break the a core framework installation, which breaks everything else.</p>
<p><span id="more-97"></span></p>
<p>What are the symptoms of such an event?  Well, if running almost any application yields a crash with an error that looks like the following, you probably have an inconsistent framework installation.</p>
<pre><code>Process:         vmware [806]
Path:            /Applications/VMware Fusion.app/Contents/MacOS/vmware
Identifier:      com.vmware.fusion
Version:         3.1.3 (416484)
Code Type:       X86 (Native)
Parent Process:  launchd [507]

Date/Time:       2012-04-04 12:32:29.775 -0400
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Interval Since Last Report:          7508 sec
Crashes Since Last Report:           15
Per-App Crashes Since Last Report:   4
Anonymous UUID:                      CE0047A5-BFFA-4E13-A739-58AA50C92F0D

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: __ZN3JSC11JSByteArray10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
  Referenced from: /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
  Expected in: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
 in /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
...</code></pre>
<p>To fix this particular problem, we need to copy over the messed up JavaScriptCore framework with a clean copy.  Apple helpfully provides this, in the form of the <a href="http://support.apple.com/kb/DL1399" title="OS X 10.6.8 combo update">OS X 10.6.8 combo update</a>.  This gigantic package basically contains the all core libraries used by 10.6.8 in a consistent state.  The caveat is that simply installing it does not seem to guarantee that these libraries will be used.</p>
<p>Instead, we will manually extract the files from the package using <code>pkgutil</code> and copy them ourselves.</p>
<pre><code>$ pkgutil --expand ./MacOSXUpdCombo10.6.8.pkg ~/combo_update/</code></pre>
<p>If we go into this directory, we will see a bunch of directories with some weird files in them.  These are gzipped archives of directories.</p>
<pre><code>$ cd ~/combo_update
$ ls
Distribution				MacOSXUpdCombo10.6.8.Part6.pkg
MacOSXUpdCombo10.6.8.Part0.pkg		MacOSXUpdCombo10.6.8.Part7.pkg
MacOSXUpdCombo10.6.8.Part1.pkg		MacOSXUpdCombo10.6.8.Part8.pkg
MacOSXUpdCombo10.6.8.Part10.pkg		MacOSXUpdCombo10.6.8.Part9.pkg
MacOSXUpdCombo10.6.8.Part11.pkg		QuickTimePlayer7ForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part12.pkg		Resources
MacOSXUpdCombo10.6.8.Part2.pkg		RosettaForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part3.pkg		SUBaseSystemCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part4.pkg		X11ForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part5.pkg
$ ls MacOSXUpdCombo10.6.8.Part0.pkg
Bom		PackageInfo	Payload		Scripts</code></pre>
<p>Now, we need to unpack these archives to get to the files we need.</p>
<pre><code>$ mkdir payload
$ cd payload
$ cat ../*.pkg/Payload | gzip -d - | cpio -im</code></pre>
<p>If we look around the payload directory, we can see a familiar Mac OS X directory structure.</p>
<pre><code>$ ls
Applications	System		mach_kernel	sbin
Library		bin		private		usr</code></pre>
<p>Now, we just replace the broken framework with the one from this directory. <strong>Warning: The following line REMOVES the existing JavaScriptCore framework, so don&#8217;t do it unless you are 100% sure the replacement files were unpacked correctly!</strong></p>
<pre><code>sudo rm -rf /System/Library/Frameworks/JavaScriptCore.framework; sudo cp -R JavaScriptCore.framework /System/Library/Frameworks/</code></pre>
<p>That&#8217;s it, your errors should disappear (or at least change).  If you are now getting a different framework error, just rinse and repeat with the next affected framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/97/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing linking errors caused by MacPorts&#8217; incompatible binaries</title>
		<link>http://www.snowbotic.com/archives/88</link>
		<comments>http://www.snowbotic.com/archives/88#comments</comments>
		<pubDate>Sat, 02 Jul 2011 20:11:31 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plinth]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=88</guid>
		<description><![CDATA[I was recently compiling SFML, to see whether it would be a viable replacement for SDL in Plinth, when I came across the following error: ld: warning: in /opt/local/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (i386) What this means is that I needed libfreetype, but the version [...]]]></description>
				<content:encoded><![CDATA[<p>I was recently compiling <a href="http://http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php">SFML</a>, to see whether it would be a viable replacement for <a href="http://www.libsdl.org/">SDL</a> in <a title="Plinth" href="http://www.snowbotic.com/projects/plinth">Plinth</a>, when I came across the following error:</p>
<pre><code>ld: warning: in /opt/local/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (i386)</code></pre>
<p>What this means is that I needed libfreetype, but the version installed by MacPorts (into /opt/local/lib, was a 32-bit version).<br />
This is particularly odd, because I was on a 64-bit mac, and I don&#8217;t really need 32-bit libraries.  Apparently, certain packages in MacPorts don&#8217;t get the memo and install only i386 binary libraries anyway.</p>
<p>Upon googling, I saw a <em><strong>lot</strong></em> of people encountering these errors during mac compilation, with all sorts of weird solutions.  In many of these cases, the quick fix is simply to tell MacPorts to install all binary versions of the library.  This takes up a bit of extra space, since you&#8217;ll get other versions of the library for other platforms that you don&#8217;t need, but it includes the 64-bit libraries that you do need.</p>
<p>To do this, simply tell MacPorts to install your package with the <code>+universal</code> argument:</p>
<pre><code>$ sudo port install freetype +universal</code></pre>
<p>Voila, linking errors begone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/88/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling infrastructure wifi on the ARDrone with DHCP</title>
		<link>http://www.snowbotic.com/archives/68</link>
		<comments>http://www.snowbotic.com/archives/68#comments</comments>
		<pubDate>Fri, 01 Apr 2011 04:07:19 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Hardware Hacking]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AR Drone]]></category>
		<category><![CDATA[busybox]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=68</guid>
		<description><![CDATA[There are a number of different articles on &#8220;patching&#8221; the AR Drone to connect to infrastructure. I&#8217;m going to talk a little about the technical details of what is going on, based on my own experience. Background The ARDrone, in its stock configuration, is an embedded linux device that runs Busybox. By default, on boot [...]]]></description>
				<content:encoded><![CDATA[<p>There are a number of different articles on &#8220;patching&#8221; the AR Drone to connect to infrastructure. I&#8217;m going to talk a little about the technical details of what is going on, based on my own experience.<br />
<span id="more-68"></span></p>
<h2>Background</h2>
<p>The ARDrone, in its stock configuration, is an embedded linux device that runs Busybox.  By default, on boot it starts an ad-hoc wiki network of the form <em>ardrone_xxxxxx</em>, where the last bit is the ID of the drone.  When you connect to the ad-hoc network, the drone can assign an IP address from the 192.168.1.xxx range, where 192.168.1.1 is reserved for the drone itself.</p>
<p>At this point, the drone is accessible over the network via <code>telnet</code>, simply use:</p>
<pre><code>telnet 192.168.1.1</code></pre>
<p>If you use <code>ifconfig</code>, you can see the wifi device <code>ath0</code>.  I believe the drone simply uses mostly stock atheros wifi drivers.  Now, on boot, the drone executes the initialiation script <code>/bin/wifi_setup.sh</code>.  You can look inside and actually see the drone configure its wireless and startup the DHCP server.</p>
<h2>Connecting to infrastructure wifi</h2>
<p>So if we want to connect to an infrastructure access point, we have a couple of key steps:</p>
<ol>
<li>Shut down the DHCP server.</li>
<li>Bring down the <code>ath0</code> interface</li>
<li>Bring up the <code>ath0</code> interface in managed mode, connecting to SSID of choice</li>
<li>Run DHCP client to get IP address</li>
</ol>
<p>The first 3 steps of this are well described in a lot of other posts like <a href="http://www.shellware.com/BlogEngine.Web/post/2011/03/27/How-to-Manually-Infrastructure-Enable-Your-ARDrone.aspx">this one at Shellware</a>, so lets talk about the DHCP client.</p>
<p>Busybox includes a DHCP client called <code>udhcpc</code>.  Running it is simple, and by default it will get an IP address and netmask:</p>
<pre><code>udhcpc -b -i ath0</code></pre>
<p>So now, the process of starting up the wifi is to do the following block:</p>
<pre><code>killall udhcpd
ifconfig ath0 down
iwconfig ath0 mode managed essid $INFRA_ESSID ap any channel auto commit
ifconfig ath0 up
udhcpc -b -i ath0</code></pre>
<p>If we want to start up ad-hoc networking again, we can do:</p>
<pre><code>killall udhcpc
udhcpd /tmp/udhcpd.conf
ifconfig ath0 down
iwconfig ath0 mode Ad-Hoc essid $DRONE_SSID channel auto commit
ifconfig ath0 192.168.1.1 netmask 255.255.255.0 up</pre>
<p></code></p>
<p>At this point, we can make scripts to manually switch between an infrastructure network and an ad-hoc network.  As long as we don't run anything at boot, the drone will always safely reboot into ad-hoc mode.</p>
<h2>Automatically connecting to infrastructure wifi</h2>
<p>So I found an existing tool that autoloads a startup script for connecting to infrastructure APs called <a href="http://sites.google.com/site/androflight/arautoconnect">ARAutoConnect</a>.  It was open source, so I extracted the underlying script, which runs a loop that scans every 10s for the SSID network and connects to it, and added DHCP support.  The resulting script, which can be downloaded here (<a href='http://www.snowbotic.com/wp-content/uploads/2011/04/autoconnect.sh.zip'>autoconnect.sh</a>), runs the same loop, but also tries to get a DHCP lease. </p>
<p>To use the script, simply put it in some directory.  I prefer <code>/home/default/wifi</code>.  Now, create a file in the same directory called <code>essid</code>, and put the name of the network in it.  If you run the script directly, it will now search for the specified wifi network, and if it finds one, it will close the ad-hoc network and connect to the infrastructure network instead.  If you want this to run at startup, simply append a line to <code>/bin/wifi_setup.sh<code> that goes something like:</p>
<pre><code>/home/default/wifi/autoconnect.sh &#038;</code></pre>
<p>Be warned however, if an infrastructure network is available but the drone can't complete a connection to it, it will keep trying, possibly locking any ad-hoc connections out until you move the drone out of range.  Anyway, it's all free for anyone to use/adapt as they wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/68/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fixing an SQLite version mismatch between Subversion and PHP5</title>
		<link>http://www.snowbotic.com/archives/61</link>
		<comments>http://www.snowbotic.com/archives/61#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:36:13 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Hardware Hacking]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=61</guid>
		<description><![CDATA[If you are running an Apache2 server and mod_dav_svn, and you upgrade to the latest version of subversion, you might suddenly lose the ability to access newly created respositories, but still be able to access your older repositories. When you access the new repositories, you will get: svn: Could not open the requested SVN filesystem [...]]]></description>
				<content:encoded><![CDATA[<p>If you are running an Apache2 server and mod_dav_svn, and you upgrade to the latest version of subversion, you might suddenly lose the ability to access newly created respositories, but still be able to access your older repositories.</p>
<p>When you access the new repositories, you will get:</p>
<pre><code>svn: Could not open the requested SVN filesystem
</code></pre>
<p>And when you look in <code>/var/log/apache/error_log</code>, you will see:</p>
<pre><code>[Wed Apr 21 15:19:18 2010] [error] [client xx.xx.xx.xx] (20014)Internal error: SQLite compiled for 3.6.11, but running with 3.3.7
[Wed Apr 21 15:19:18 2010] [error] [client xx.xx.xx.xx] Could not fetch resource information.  [500, #0]
[Wed Apr 21 15:19:18 2010] [error] [client xx.xx.xx.xx] Could not open the requested SVN filesystem  [500, #200030]
[Wed Apr 21 15:19:18 2010] [error] [client xx.xx.xx.xx] Could not open the requested SVN filesystem  [500, #200030]
</code></pre>
<p><span id="more-61"></span></p>
<h2>Problem:</h2>
<p>What is happening here is that the libphp5.so loaded by Apache loads its own out-of-date implementation of libsqlite. Then mod_dav_svn.so calls the sqlite functions from php instead of the libsqlite.so it was build against, and that the svn excutables on the machine are using.  The real problem here is that if the repository uses a newer SQLite version, it might be unreadable when accessed by the older version.</p>
<p>Several people have suggested recompiling version things to fix this, either by removing one of the sqlite libraries, or linking both to the same version:</p>
<ul>
<li><a href="http://www.feedface.com/?news=343">[feedface]</a></li>
<li><a href="http://mail-archives.apache.org/mod_mbox/subversion-users/200912.mbox/%3C20091215101717.2ae4fb61@leroy%3E">[subversion-users]</a></li>
<li><a href="http://markmail.org/message/nvptyambv6tomrwf#query:+page:1+mid:63tt4bo3ok7etxzt+state:results">[org.tigris.subversion.users]</a></li>
</ul>
<h2>Solution:</h2>
<p>However, there is a much simpler solution that can work &#8212; for the same reason that the older repositories work.  Mod_dav_svn doesn&#8217;t seem to actually care if it&#8217;s linked against the wrong library unless the DB it is accessing uses some feature it doesn&#8217;t have access to.  So if you create your new repository with a little backwards compatibility, the older SQLite can access it just fine and everyone is happy.  Thus, I did the following when creating my new repo:</p>
<pre><code># svnadmin create --pre-1.6-compatible /path/to/repos
</code></pre>
<p>This seemed to solve the problem just fine.</p>
<h2>Alternative Solution:</h2>
<p><strong>topop99</strong> suggested another solution, which is to reorder the php5 and dav_svn modules are loaded by apache2.  This presumably allows dav_svn to use the correct libsqlite before php5 comes in and ruins everything.  Thus, open up <code>httpd.conf</code> and order the two as such:</p>
<pre><code>LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule php5_module modules/libphp5.so</code></pre>
<p>I haven&#8217;t tried this myself, but it might be useful to someone else out there.  Thanks <strong>topop99</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/61/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Making a cheap electrical wire caddy</title>
		<link>http://www.snowbotic.com/archives/51</link>
		<comments>http://www.snowbotic.com/archives/51#comments</comments>
		<pubDate>Thu, 18 Mar 2010 03:40:56 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hardware Hacking]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=51</guid>
		<description><![CDATA[For many hobbyists, having a bit of wire around is a must.  But outside of the lab, I&#8217;ve always had trouble finding useful ways to store wire in my kits.  Finally, I got frustrated and lightly modded a line spool box, used for fishing, to do the trick.  Here&#8217;s what I ended up with: Materials: [...]]]></description>
				<content:encoded><![CDATA[<p>For many hobbyists, having a bit of wire around is a must.  But outside of the lab, I&#8217;ve always had trouble finding useful ways to store wire in my kits.  Finally, I got frustrated and lightly modded a line spool box, used for fishing, to do the trick.  Here&#8217;s what I ended up with:</p>
<p><a href="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1191.jpg"><img class="aligncenter size-medium wp-image-52" title="Wire caddy" src="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1191-300x225.jpg" alt="My wire caddy" width="300" height="225" /></a></p>
<h2><span id="more-51"></span>Materials:</h2>
<ul>
<li><strong>1</strong> &#8211; <a title="Plano Line Spool Box" href="http://www.amazon.com/Plano-1084-00-Line-Spool-Box/dp/B001ECQPS4">Plano line spool box</a></li>
<li><strong>1</strong> &#8211; 1.5&#8243; thick piece of <a title="very-soft polyurethane foam" href="http://www.mcmaster.com/#foam/=69jij5">very-soft polyurethane foam</a> (the soft skinless foam used for packaging)</li>
<li><strong>4 &#8211; </strong> 100&#8242; spools of UL1213 26AWG stranded wire (but you can use anything that comes on 1.5&#8243; wide spools)</li>
</ul>
<h2>Instructions:</h2>
<ol>
<li>Cut a 6.25&#8243; x 2&#8243; piece of the foam.  This will be used to hold the spools in place. <a href="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1195.jpg"><img class="aligncenter size-medium wp-image-53" title="Cutting a foam block" src="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1195-300x225.jpg" alt="" width="300" height="225" /></a></li>
<li>Open the line spool box and put your four spools on the bottom row.</li>
<li>Take your foam piece and wedge it into the top half of the line spool box, as close to the hinge as possible.  It should fit snugly.</li>
<li>Take the wire from each of the spools and thread it through the grommets on the top half of the box.  The result should look like the following: <a href="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1196.jpg"><img class="aligncenter size-medium wp-image-54" title="Assembled wire caddy." src="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1196-300x225.jpg" alt="" width="300" height="225" /></a></li>
<li>Carefully close the box, and the foam should lightly push against your spools, holding them in place.  That&#8217;s it, you have a lightweight, neat little wire caddy to take with you.  <a href="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1191.jpg"><img class="aligncenter size-medium wp-image-52" title="Wire caddy" src="http://www.snowbotic.com/wp-content/uploads/2010/03/img_1191-300x225.jpg" alt="My wire caddy" width="300" height="225" /></a></li>
</ol>
<h3>Tips:</h3>
<ul>
<li>You can play with the thickness of the foam to vary the tension</li>
<li>If one of your spools is really sticky, make sure it is seated correctly, and not riding on one of the ridges along the bottom of the box.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/51/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Amazon AMI images for ROS</title>
		<link>http://www.snowbotic.com/archives/46</link>
		<comments>http://www.snowbotic.com/archives/46#comments</comments>
		<pubDate>Thu, 04 Feb 2010 03:41:21 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.snowbotic.com/?p=46</guid>
		<description><![CDATA[Simulating large numbers of robots can be a pain. I&#8217;ve decided to experiment with building Amazon Machine Instances of ROS to enable me, and anyone else, to quickly launch any number of pre-installed ROS machines and simulate running robots. I&#8217;m not sure if this will work, so bear with me&#8230; Steps Sign up for Amazon [...]]]></description>
				<content:encoded><![CDATA[<p>Simulating large numbers of robots can be a pain.  I&#8217;ve decided to experiment with building Amazon Machine Instances of ROS to enable me, and anyone else, to quickly launch any number of pre-installed ROS machines and simulate running robots.  I&#8217;m not sure if this will work, so bear with me&#8230;</p>
<p><span id="more-46"></span></p>
<h2>Steps</h2>
<ol>
<li>Sign up for Amazon Web Services.  There are lots of tutorials on how to do this, it&#8217;s pretty easy.</li>
<li>Run the machine instance for a version of Ubuntu.  Canonical <a href="http://uec-images.ubuntu.com/releases/karmic/release/">makes and packages these</a>.</li>
<li>sudo apt-get upgrade</li>
<li>Follow instructions on ROS web site for <a href="http://http://www.ros.org/wiki/ROS/Installation">building and installing ROS</a>.</li>
<li>Do whatever secondary installation you want on the new node</li>
<li><em>TODO</em>: Repackage the instance as a nice clean AMI.</li>
</ol>
<p>That&#8217;s all I have so far, let&#8217;s see how this goes!</p>
<h2>UPDATE: 2010-03-19</h2>
<p>So ROS released their <a href="http://www.willowgarage.com/blog/2010/03/02/ros-distributions-box-turtle-release">box-turtle release</a>, which provides a package repository for more recent version of Ubuntu! This means that making an AMI with ROS is as simple as using the stock Ubuntu AMI, then adding the ROS repository and adding the box-turtle base packages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/46/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ubuntu 9.10 on the BeagleBoard</title>
		<link>http://www.snowbotic.com/archives/33</link>
		<comments>http://www.snowbotic.com/archives/33#comments</comments>
		<pubDate>Mon, 25 Jan 2010 19:37:46 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Hardware Hacking]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.snowbotic.com/?p=33</guid>
		<description><![CDATA[Since there don't appear to be any clear step-by-step instructions for doing this, I figured I would make a nice instructional post for people that don't spend their whole day hacking embedded hardware.  This assumes you have basic linux knowledge and a BeagleBoard you don't mind completely gutting out to put on Ubuntu.]]></description>
				<content:encoded><![CDATA[<p>Since there don&#8217;t appear to be any clear step-by-step instructions for doing this, I figured I would make a nice instructional post for people that don&#8217;t spend their whole day hacking embedded hardware.  This assumes you have basic linux knowledge and a BeagleBoard you don&#8217;t mind completely gutting out to put on Ubuntu.</p>
<p><span id="more-33"></span></p>
<h2>Things you need:</h2>
<ul>
<li>BeagleBoard (Mine is a Rev B7)</li>
<li>Uboot-mkimage (Ubuntu has this as a package)</li>
<li>An SD card reader on a machine with ext2/3 support</li>
</ul>
<h2>Step 1: Formatting your card</h2>
<p>Because the BeagleBoard firmware (u-boot) can only easily read FAT32, and Ubuntu is much happier with EXT2/3, the first step is to make two partitions on your SD card.  I was able to do this using the Disk Utility on my Mac, after installing <a href="http://sourceforge.net/projects/fuse-ext2/">fuse-ext2</a>, but any partition manager should be able to do this.  You want the following setup:</p>
<ul>
<li><strong>Partition 1:</strong> 50MB &#8211; FAT32</li>
<li><strong>Partition 2:</strong> The rest &#8211; EXT2/3</li>
</ul>
<p>The exact setup isn&#8217;t that important, the main thing is that the FAT partition is <em>first</em> and <em>large enough to hold the boot kernel</em>.</p>
<h2>Step 2: Upgrading the firmware</h2>
<p>Since I have no idea what crazy firmware my BeagleBoard came with, the next thing to do was upgrade my board to some known, reasonable version.  You will use the FAT partition on your newly formatted SD card for this purpose:</p>
<h4>Go to the <a href="http://code.google.com/p/beagleboard/downloads/list">BeagleBoard downloads page</a> and get the latest versions of the following files:</h4>
<ul>
<li>x-load.bin.ift</li>
<li>MLO</li>
<li>u-boot-flash.bin (sometimes named u-boot-f)</li>
<li>uImage.bin</li>
</ul>
<p>(When you download these, these files will have version information stuck on them, like &#8220;x-load_revc_v3.bin.ift&#8221;.  You should rename them to look exactly like the file names above.  This is so that in the next step, the commands we use will have the correct filenames.)</p>
<h4>Copy the files to the SD card:</h4>
<p>All of the above files should be copied to the <em>root</em> of the <em>FAT partition</em> of your SD card.  There shouldn&#8217;t be anything in that partition other than these 4 files, named exactly as above.</p>
<h4>Upgrade the firmware:</h4>
<p>Connect to the BeagleBoard over the serial interface, so you can use the console.  The Beagleboard serial interface is 115200 baud, 8N1.  I like to connect using GNU Screen, so I do the following:<br />
<code><br />
screen -U /dev/ttyUSB0 115200<br />
</code><br />
Now, plug the SD card into the BeagleBoard, and let it start up the boot process.  When you see it get to the prompt about autoboot, press a key to interrupt it:</p>
<pre><code>Texas Instruments X-Loader 1.41
Starting OS Bootloader...

U-Boot 1.3.3 (Jul  8 2008 - 16:29:02)

OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle Board + LPDDR/NAND
DRAM:  128 MB
NAND:  256 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial
Audio Tone on Speakers  ... complete
Hit any key to stop autoboot:  0
OMAP3 beagleboard.org #
</code></pre>
<p>Now, at this point, you have all the things you need to follow the BeagleBoard NAND flashing instructions.  There are several versions, but I found the <a href="http://code.google.com/p/beagleboard/wiki/BeagleNANDFlashing">Google code version</a> to be the best for x-loader and u-boot, and the <a href="http://elinux.org/BeagleBoardNAND">e-linux.org wiki version</a> better for the kernel image (uImage). You will do 3 write sequences, one for<em> x-loader</em>, one for <em>u-boot</em>, and one for <em>uImage</em>.</p>
<h2>Step 3: Putting Ubuntu on the SD card</h2>
<p>The details of making a custom Ubuntu image can be found on the <a href="http://elinux.org/BeagleBoardUbuntu">e-linux.org wiki</a>.  However, I just used the demo images linked on the wiki, as I didn&#8217;t really need a custom image with a ton of stuff.  So first, I downloaded an unzipped the <a href="http://rcn-ee.net/deb/rootfs/ubuntu-9.10-minimal-armel-1.1.tar.7z">tarball of the Karmic (9.10) demo image</a>.  It uses 7Z compression, so you might need to <a href="http://www.howtoadvice.com/Ubuntu7zip">install 7zip</a> if you don&#8217;t have it.  Included in the tarball are two files, a <em>vmlinuz-*</em> file that will be the kernel image, and a large <em>armel-rootfs-*.tar</em> that will be the root file system.</p>
<p>The installation details are <a href="http://elinux.org/BeagleBoardUbuntu#Development_PC:_Setup_SD_Partition.27s">hidden on the wiki</a>, but I will reiterate them for clarity:</p>
<ul>
<li>Install the ubuntu package <em>uboot-mkimage</em>.
<pre><code>sudo apt-get install uboot-mkimage</code></pre>
</li>
<li>Use the <em>vmlinuz-*</em> file to make a <em>uImage</em> file.
<pre><code>mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d ./vmlinuz-* ./uImage</code></pre>
</li>
<li>Create a boot script file called <em>ubuntu.cmd</em> with the following lines (note: if you use ext2, change the reference in the second line of this script from ext3 to ext2):
<pre><code>setenv bootcmd 'mmcinit; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 ro vram=12M omapfb.mode=dvi:1280x720MR-16@60'
boot</code></pre>
</li>
<li>Compile the <em>ubuntu.cmd </em>script into an <em>ubuntu.scr </em>file.
<pre><code>mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ubuntu 9.10" -d ./ubuntu.cmd ./ubuntu.scr</code></pre>
</li>
<li>You should  now have two files, <em>uImage</em> and <em>ubuntu.scr</em>.  Clear off everything else in the FAT partition of your SD card and copy both of these files there, and rename <em>ubuntu.scr</em> to <em>boot.scr</em>.  Your FAT partition should just contain two files: <em><strong>uImage</strong> </em>and <em><strong>boot.scr</strong></em>.</li>
<li>Finally, copy the root filesystem to your EXT partition.  You can do this directly from the tar archive:
<pre><code>sudo tar xfp armel-rootfs-[<em>fill this in</em>].tgz -C [<em>SD card EXT mount</em>]</code></pre>
</li>
</ul>
<p>Lastly, there are a couple of quick hacks that need to be done for Karmic (9.10) to work.  The e-linux guide is pretty clear about this part, so I&#8217;ll just post the <a href="http://elinux.org/BeagleBoardUbuntu#Karmic:_.289.10.29_boot_fixup">relevant link to their wiki section</a>.  Basically, you just need to edit a couple of config files on your EXT partition so that the kernel mounts it correctly and doesn&#8217;t freak out. Be careful with the paths though, if you forget the <strong>./</strong>, you could easily end up editing your<em> own machine&#8217;s config files instead</em>!</p>
<p>Now finally, at this point, you can plug the SD card into the BeagleBoard, and you should get to a login prompt.  Awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/33/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Removing packages + dependencies from Synaptic in Ubuntu</title>
		<link>http://www.snowbotic.com/archives/26</link>
		<comments>http://www.snowbotic.com/archives/26#comments</comments>
		<pubDate>Wed, 11 Nov 2009 01:29:09 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.snowbotic.com/?p=26</guid>
		<description><![CDATA[So, a complaint that has come up a number of times over the years is the fact that you can open up Synaptic package manager, browse through the history, find a package you installed and all of the dependencies that came with it, and... nothing.  Well that's annoying, what can we do about it?]]></description>
				<content:encoded><![CDATA[<p>So, a complaint that has come up a <a href="http://brainstorm.ubuntu.com/idea/6370/">number</a> <a href="http://ubuntuforums.org/showthread.php?t=21144">of</a> <a href="https://lists.ubuntu.com/archives/ubuntu-users/2005-May/036699.html">times</a> over the years is the fact that you can open up Synaptic package manager, browse through the history, find a package you installed and all of the dependencies that came with it, and&#8230; nothing.  It&#8217;s just a text log, you can&#8217;t select or un-install those packages.</p>
<p>Now, aptitude auto-remove almost solves this problem, but there are still cases where for one reason or another, auto-remove is fudged up or something, or you just want to uninstall a few packages.</p>
<p>For these situations, I offer the following simple, terminal-based hack solution:</p>
<ol>
<li>Open Synaptic package manager, go to File&gt;History, and browse around until you find the packages you want.</li>
<li>Select the packages and copy them (or just select them and use the magic middle click buffer)</li>
<li>Open up a text file, say <em>foobar.log</em>, and paste the list of packages into this file</li>
<li>Run the following command in a terminal:</li>
</ol>
<pre><code>sudo aptitude remove `cat <em>foobar.log</em> | awk '{gsub(/\(.*\)/,"");print}' | xargs echo`</code></pre>
<p>This will tell aptitude to remove all of the entries that you pasted into <em>foobar.log</em>.  Awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/26/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing AP handover on the Gumstix Verdex + wifi module</title>
		<link>http://www.snowbotic.com/archives/20</link>
		<comments>http://www.snowbotic.com/archives/20#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:15:00 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Hardware Hacking]]></category>

		<guid isPermaLink="false">http://blog.snowbotic.com/?p=20</guid>
		<description><![CDATA[I was using my Gumstix Verdex to control an iRobot Create with the ever handy <a href="http://www.acroname.com/robotics/parts/I24-10601.html">Element Sticky board</a> when I encountered a serious problem.   The Marvell 88W8385 (the wireless module used by the Verdex) has no such support in its driver/hardware for handovers between APs.  So I used wpa_supplicant and a custom script to simulate this behaviour in software.]]></description>
				<content:encoded><![CDATA[<p>I was using my Gumstix Verdex to control an iRobot Create with the ever handy <a href="http://www.acroname.com/robotics/parts/I24-10601.html">Element Sticky board</a> when I encountered a serious problem.  The network setup around here has a ton of access points with the same SSID.  When you move throughout the network, most sane wireless hardware does what is called a &#8220;handover.&#8221;  The wireless adapter detects that the signal to the current access point is weak, and then scans and reassociates with a stronger AP.  The process isn&#8217;t always seamless, but it <em>happens</em>.  Apparently, the Marvell 88W8385 (the wireless module used by the Verdex) has no such support in its driver/hardware.  So as the Create trundles along, the wifi signal just keeps getting weaker, until it starts dropping out.  As another wonderful feature of the driver, when the wifi signal has dropped out, the module <strong>refuses</strong> to execute any commands.  That&#8217;s right, you can&#8217;t even <em>ifdown wlan0</em> to reset/reassociate the stupid thing.  If you try, you get a helpful: <em>NETDEV WATCHDOG: wlan0: transmit timed out</em>.</p>
<p>What&#8217;s a roboticist to do?  Well, obviously, create a software hack that <em>forces</em> the gumstix to reassociate when its signal strength to the current AP gets low!</p>
<p><span id="more-20"></span> At first, this seemed to be a little tricky, as it is kind of a pain to deal with the parsing minutia necessary to figure out which access point is the best.  Luckily, Gumstix/OpenEmbedded has a solution, in the form of wpa_supplicant.  This little daemon is designed to allow connections to WPA-enabled networks, which is not useful, except for a nifty little hidden feature: it automatically re-associates with the best AP if the hardware &#8220;happens&#8221; to do a scan.  Well, we can force that using <em>iwlist wlan0 scan</em>!</p>
<p>So, the solution is twofold:</p>
<ol>
<li>Write a background script that measures RSSI and runs <em>iwlist </em>when signal gets weak.</li>
<li>Configure wlan0 to use wpa_supplicant on the Verdex.</li>
</ol>
<p>The first part isn&#8217;t too bad.  We need to write a script that loops, checking the RSSI of the current AP, and starts scanning <em>only</em> when the RSSI gets low.  Using copious amounts of text hackery, I wrote the following script to do exactly that:</p>
<pre><code>
#!/bin/sh

echo STARTING SCAN-O-MATIC
while [ 1 ]
do
	RSSI=`iwconfig wlan0 | grep Signal | awk '{print $4}' | cut -d ":" -f 2`
	if [  ${RSSI} -lt "-60" ]
	then
		iwlist wlan0 scan &gt; /dev/null
		sleep 5
	else
		sleep 2
	fi
done
</code></pre>
<p>For convenience later on, I saved this script as <em>/etc/wpa_supplicant/scan.sh</em>.  With that done, the next step isn&#8217;t too tricky either.  wpa_supplicant ships with the gumstix-basic-image, so as long as you are using that, you probably already have wpa_supplicant.  To get it to run with wireless (wlan0), you just have to change a couple of config settings.  Create the file <em>/etc/wpa_supplicant.conf</em>.  This file will contain the configurations for the networks you want wpa_supplicant to try to join.  Since I only have one network, mine looks like this:</p>
<pre><code>
ap_scan=1
fast_reauth=1
network={
	ssid="FOOBAR"
	key_mgmt=NONE
}
</code></pre>
<p>If you have weirder settings, just look up the docs for wpa_supplicant.  Note the <em>ap_scan=1</em>.  I think that is important for ensuring that wpa_supplicant will reassociate networks when you scan.  Next, we just have to tell the Gumstix that we want to use this stuff when we activate wlan0.  So, we put the following into <em>/etc/network/interfaces</em>:</p>
<pre><code>
auto wlan0
iface wlan0 inet dhcp
      pre-up wpa_supplicant -Dmarvell -iwlan0 -c/etc/wpa_supplicant.conf -Bw
      up /etc/wpa_supplicant/scan.sh &amp;
      down ps | grep scan.sh | grep -v grep | xargs kill `awk '{print $1}'`
      down killall wpa_supplicant
</code></pre>
<p>This should look very similar to the WPA example that gumstix provides.  However, you can see that we also start our scanning script in the background, and kill it when the interface goes down.  Make sure you comment out any other iface block for wlan0, as having multiple definitions will screw things up.</p>
<p>Now, just reup the interface and voila, wpa_supplicant will come up and associate to the best access point.  If the RSSI drops below our threshold (-60dB in the above), then our scan script will run, and wpa_supplicant will use the results to associate to a better access point.  It seems to work fine for running around pretty dense wireless network areas, with about a 3 second delay every time it actually tries to switch networks.  So have fun and let your robots run free!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARToolkit Plus recipe for Gumstix Verdex</title>
		<link>http://www.snowbotic.com/archives/13</link>
		<comments>http://www.snowbotic.com/archives/13#comments</comments>
		<pubDate>Wed, 16 Sep 2009 22:32:26 +0000</pubDate>
		<dc:creator>pkv</dc:creator>
				<category><![CDATA[Hardware Hacking]]></category>
		<category><![CDATA[ARToolkit]]></category>
		<category><![CDATA[bitbake]]></category>
		<category><![CDATA[gumstix]]></category>
		<category><![CDATA[openembedded]]></category>

		<guid isPermaLink="false">http://blog.snowbotic.com/?p=13</guid>
		<description><![CDATA[After much messing around, I've got a surprisingly compact bitbake recipe for compiling ARToolkit Plus in OpenEmbedded.]]></description>
				<content:encoded><![CDATA[<p>After much messing around, I was able to create a surprisingly compact bitbake recipe for compiling ARToolkit Plus in OpenEmbedded.  Since qmake and qt3-embedded are already well-supported packages, it was just a matter of creating the right patch to the bizarrely placed &#8220;build/linux/options.pro&#8221; file.  This turned out to be quite easy.</p>
<p>The two key things to know are that qmake really wants to use gcc for linking, and that hidden in the options.pro file are the cpu architecture flags.  That just means the following options are needed:</p>
<pre><code>QMAKE_CXXFLAGS = -march=armv5te -mtune=xscale
LIBS += -lstdc++ -lm</code></pre>
<p>Then, it&#8217;s a matter of convincing qmake to use the existing qt3-embedded mkspec file.  This was a bit tricky, and I&#8217;m still not sure I did it right.  My solution was to throw a couple of exports into the recipe:</p>
<pre><code>export ARTKP=${S}
export QMAKE="${STAGING_BINDIR_NATIVE}/qmake"</code></pre>
<p>Then, voila, we have a recipe that yields an ipk that installs ARToolkit Plus into /usr/lib on our gumstix!  If anyone wants it, feel free to grab the tarball and stick it in user.collections/packages.</p>
<p><strong>Tarball of recipe:<a href="http://blog.snowbotic.com/wp-content/uploads/blog.snowbotic.com/2009/09/artkplus.tar.gz"> <a href="http://www.snowbotic.com/wp-content/uploads/2009/09/artkplus.tar.gz">artkplus.tar.gz</a></a></strong></p>
<p><strong>IPK binary package: <a href="http://blog.snowbotic.com/wp-content/uploads/blog.snowbotic.com/2009/09/libartoolkitplus2_2.1.1-r0_armv5te.ipk"><a href="http://www.snowbotic.com/wp-content/uploads/2010/01/libartoolkitplus2_2.1.1-r0_armv5te.ipk">libartoolkitplus2_2.1.1-r0_armv5te.ipk</a></a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowbotic.com/archives/13/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.006 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-23 13:07:18 -->
