<?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>Blogging to Nowhere &#187; UoA</title>
	<atom:link href="http://webworxshop.com/tag/uoa/feed" rel="self" type="application/rss+xml" />
	<link>http://webworxshop.com</link>
	<description>cat /dev/brain &#62; /dev/null</description>
	<lastBuildDate>Sat, 05 May 2012 21:57:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>UoA ECE Department ‘DonKey’ on Linux</title>
		<link>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux</link>
		<comments>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:02:24 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[auckland]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[DonKey]]></category>
		<category><![CDATA[ECE]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[microcontrollers]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UoA]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=153</guid>
		<description><![CDATA[<p>Introduction: Since finishing my Part IV Project, I&#8217;ve been threatening to do some embedded/microcontroller stuff in my spare time at home. I&#8217;ve now finally go around to it and I thought I&#8217;d start by playing with a few components I had left over from a Uni project a while back. I&#8217;ve also ordered an Arduino [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Introduction:</strong> Since finishing my Part IV Project, I&#8217;ve been threatening to do some embedded/microcontroller stuff in my spare time at home. I&#8217;ve now finally go around to it and I thought I&#8217;d start by playing with a few components I had left over from a Uni project a while back. I&#8217;ve also ordered an Arduino board (see below), but it hasn&#8217;t arrived yet. When it does, I think I&#8217;m going to have a go programming it in C rather than the random Arduino language, as I have much more experience of programming embedded systems than your average Arduino user. I&#8217;ll report on my progress when I have some!</em></p>
<p>In the Electrical and Computer Engineering Deaprtment of the University of Auckland, where I work we have a little device, internally known as the &#8216;DonKey&#8217;. The purpose of this is to allow easy programming of Atmel AVR based microcontrollers via USB, rather than the simpler serial interface. We also have some internally developed software to program microcontrollers via the device, unfortunately this software is pretty much windows only (we did have a successful attempt to compile it for Linux, but this was quite a while ago, a better solution would be to use a native Linux application).</p>
<p>Internally the DonKey uses an FTDI based USB to UART chip (specifically the FT232R) to communicate with the microcontroller. This presents some problems as, despite being the basis of the programmer on incredibly popular Arduino boards, the main Linux programming tool (AVRdude) has no official FTDI support. I think this is largely due to the use of a bootloader on the Arduino boards, which negates the need of the programming tool to directly flash the board. If however you brick the AVR on the Arduino, you would be out of luck and would need a physical programmer (more on this below).</p>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 480px"><a href="http://blog.webworxshop.com/wp-content/uploads/2010/01/donkey.jpg"><img src="http://blog.webworxshop.com/wp-content/uploads/2010/01/donkey.jpg" alt="The DonKey" title="The DonKey" width="470" height="224" class="size-full wp-image-164" /></a><p class="wp-caption-text">The DonKey in all it's glory.</p></div>
<p>In this howto I&#8217;ll cover how to get the DonKey working on Linux with AVRdude. Luckily, while researching how I might go about this I found that a large part of the work had been done for me, due to the fact that the Arduino also uses these chips. I found instructions on <a href='http://doswa.com/blog/2009/12/20/avrdude-58-with-ftdi-bitbang-patch-on-linux/'>doswa.com</a> on how to patch and compile AVRdude for just this purpose (so you could flash a bootloader to a new AVR).</p>
<p>These instructions work quite well for the DonKey, up until you get to running the &#8216;./configure&#8217; command, I replaced this with:</p>
<p><code>$ ./configure --prefix=$HOME/.local</code></p>
<p>to setup the code to do a local install in my home directory (as I want this to be my primary version of AVRdude, but not to screw with things on the root filesystem).</p>
<p>Next I followed the instructions on modifiying the makefile and compiling AVRdude via the &#8216;make&#8217; command. After &#8216;make&#8217; I also typed:</p>
<p><code>$ make install</code></p>
<p>to install into the directory setup earlier. Now AVRdude is installed, the next thing to do is a bit of configuration, firstly you&#8217;ll want to make sure it&#8217;s on your $PATH so add the following to your ~/.bashrc file:</p>
<p><code>export PATH=$HOME/.local/bin:$PATH</code></p>
<p>and run the command:</p>
<p><code>$ source ~/.bashrc</code></p>
<p>to re-read the file.</p>
<p>The next issue is that you may wish to remove any copy of AVRdude that is otherwise installed (I found that sometimes my shell would run the wrong one &#8211; especially if you use &#8216;sudo&#8217; to run it):</p>
<p><code>sudo apt-get remove --purge avrdude</code></p>
<p>Now, I just mentioned above that you might use &#8216;sudo&#8217; to run AVRdude, well according to the doswa article you do need to use sudo when using the FTDI based programmers. I&#8217;m not sure why this is, but it&#8217;s not very useful if you want to be able to call AVRdude from a Makefile or the like.</p>
<p>I solved this by setting a &#8216;suid root&#8217; on my AVRdude binary. For those that don&#8217;t know what this is, the suid bit is a Unix permission setting that makes any program with it run under it&#8217;s owning user rather than the user who called it. If the owner happens to be root, the program runs as root even if the user who calls it isn&#8217;t. This is probably really insecure if you do it a lot, but you should be OK in this case.</p>
<p><b>WARNING: Despite what I say, it might not be OK. Allowing any program unrestricted root access has the potential to hose your system and scatter all your data to the winds. FOLLOW THESE INSTRUCTIONS AT YOUR OWN RISK!!</b></p>
<p>So here we go:</p>
<p><code>$ sudo chown root:root ~/.local/bin/avrdude<br />
$ sudo chmod u+s ~/.local/bin/avrdude</code></p>
<p>Now you should be able to successfully run AVRdude on FTDI based devices without resorting to using sudo every time.</p>
<p>But, what of the DonKey I hear you cry! Well all we have to do to support the DonKey is give AVRdude a little bit of configuration which tells it what the DonKey actually is. This can go in ~/.avrduderc, and looks a bit (well exactly) like this:</p>
<p><code>programmer<br />
  id    = "donkey";<br />
  desc  = "University of Auckland ECE DonKey";<br />
  type  = ft245r;<br />
  miso  = 1; # D1<br />
  sck   = 2; # D2<br />
  mosi  = 3; # D3<br />
  reset = 4; # D4<br />
;</code></p>
<p>OK, now you should be able to successfully use the DonKey with AVRdude, using a command similar to this:</p>
<p><code>avrdude -c donkey -p m8 -P ft0 -U myawesomeavrproject.hex</code></p>
<p><em>Note: this command is for the ATMega8 as denoted by the &#8216;-p m8&#8242;, check the AVRdude manual page for the correct -p option if you are using a different type of AVR.</em></p>
<p>OK, well that&#8217;s pretty much it, I&#8217;ll post back soon regarding my other progress with some microcontroller stuff. Bye for now!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=153&amp;md5=d2c0f012c7c959bc03e42040fb96d207" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2010/01/29/uoa-ece-department-donkey-on-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2010%2F01%2F29%2Fuoa-ece-department-donkey-on-linux&amp;language=en_GB&amp;category=text&amp;title=UoA+ECE+Department+%E2%80%98DonKey%E2%80%99+on+Linux&amp;description=Introduction%3A+Since+finishing+my+Part+IV+Project%2C+I%26%238217%3Bve+been+threatening+to+do+some+embedded%2Fmicrocontroller+stuff+in+my+spare+time+at+home.+I%26%238217%3Bve+now+finally+go+around+to+it+and+I...&amp;tags=arduino%2Cauckland%2CAVR%2CDonKey%2CECE%2Cfoss%2Cmicrocontrollers%2Cubuntu%2CUoA%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Turnitin.com, wtf?</title>
		<link>http://webworxshop.com/2009/10/06/turnitin-com_wtf</link>
		<comments>http://webworxshop.com/2009/10/06/turnitin-com_wtf#comments</comments>
		<pubDate>Mon, 05 Oct 2009 20:41:22 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[turnitin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UoA]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=106</guid>
		<description><![CDATA[<p>Sorry about this but I really have to say something about this. We had to submit an assignment yesterday via <a href="http://turnitin.com">turnitin.com</a> and it broke on me because I wasn&#8217;t using a &#8216;supported operating system&#8217;, I was using <a href="http://ubuntu.com">Ubuntu</a>.</p> <p>When I logged in I got a message warning me that it might not work, [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry about this but I really have to say something about this. We had to submit an assignment yesterday via <a href="http://turnitin.com">turnitin.com</a> and it broke on me because I wasn&#8217;t using a &#8216;supported operating system&#8217;, I was using <a href="http://ubuntu.com">Ubuntu</a>.</p>
<p>When I logged in I got a message warning me that it might not work, but I honestly don&#8217;t see the reason why. Shouldn&#8217;t it just be browser specific, not OS specific? I then proceeded to upload my PDF and it seemed to think it actually wasn&#8217;t a PDF! Switching to a Windows XP machine and uploading the same PDF worked fine which is the really random thing.</p>
<p>I don&#8217;t even see why <a href="http://www.auckland.ac.nz">our University</a> has to use a third party service for this anyway, I&#8217;m sure they have the resources to do this in house. Then there is the whole <a href="http://http://en.wikipedia.org/wiki/Turnitin#Possible_violation_of_student_copyright">copyright</a> thing, which I&#8217;m not altogether happy with either.</p>
<p>Anyway, at least it seems Ubuntu isn&#8217;t alone in this, according to a friend Windows 7 also triggers the same error message (albeit without the PDF fail).</p>
<p>Again, sorry for the rant.</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=106&amp;md5=b4dffb870f7c3f8c8dcfa03e962eab8d" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/10/06/turnitin-com_wtf/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2009%2F10%2F06%2Fturnitin-com_wtf&amp;language=en_GB&amp;category=text&amp;title=Turnitin.com%2C+wtf%3F&amp;description=Sorry+about+this+but+I+really+have+to+say+something+about+this.+We+had+to+submit+an+assignment+yesterday+via+turnitin.com+and+it+broke+on+me+because+I+wasn%26%238217%3Bt+using...&amp;tags=crap%2Cfail%2Cfoss%2Cturnitin%2Cubuntu%2CUoA%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Quickly change Debian repositories</title>
		<link>http://webworxshop.com/2009/06/03/quickly-change-debian-repositories</link>
		<comments>http://webworxshop.com/2009/06/03/quickly-change-debian-repositories#comments</comments>
		<pubDate>Wed, 03 Jun 2009 08:30:30 +0000</pubDate>
		<dc:creator>Rob Connolly</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UoA]]></category>

		<guid isPermaLink="false">http://blog.webworxshop.com/?p=82</guid>
		<description><![CDATA[<p>Apt is awesome. Plain and simple.</p> <p>But it is kinda static. By this I mean it&#8217;s not particularly suited to environments where things change frequently. For example, we have a local mirror at uni, which of course it much faster than using the external Ubuntu or Debian ones, however as this is only available from [...]]]></description>
			<content:encoded><![CDATA[<p>Apt is awesome. Plain and simple.</p>
<p>But it is kinda static. By this I mean it&#8217;s not particularly suited to environments where things change frequently. For example, we have a local mirror at uni, which of course it much faster than using the external Ubuntu or Debian ones, however as this is only available from internal University of Auckland IP addresses I would have to change my /etc/apt/sources.list file if I wanted to install something from home.</p>
<p>Today I knocked together a quick Python script to fix this, all it does is basically manipulate a symlink which points to the real /etc/apt/sources.list file, but I thought I&#8217;d share it anyway:<span id="more-82"></span></p>
<p><code>#!/usr/bin/env python<br />
import sys, os<br />
def usage():<br />
print "Usage: %s " % (sys.argv[0],)<br />
def main(argv):<br />
if argv[1] != None:<br />
sources_path = "/etc/apt/sources.list.%s" % (argv[1],)<br />
if os.path.exists(sources_path):<br />
os.unlink("/etc/apt/sources.list")<br />
os.symlink(sources_path, "/etc/apt/sources.list")<br />
print "SUCCESS: Don't for get to run 'sudo apt-get update'"<br />
return 0<br />
else:<br />
print "ERROR: Unknown repository set '%s'" % (argv[1],)<br />
usage()<br />
else:<br />
usage()<br />
return 1<br />
if __name__ == '__main__':<br />
sys.exit(main(sys.argv))</code></p>
<p>Unfortunately wordpress screwed with my formatting there (which kinda matters in a python script) so here is the file (<a href="http://blog.webworxshop.com/wp-content/uploads/2009/06/repo-switch.py">repo-switch.py</a>). You&#8217;ll need to download it and put it somewhere in your $PATH. Then make it execuatable:</p>
<p><code>chmod +x repo-switch.py</code></p>
<p>The next step is to set up your lists of repositories. Each list will have a suffix which the script will use to identify it. First I copied my main repositories (for the NZ Ubuntu mirrors):</p>
<p><code>sudo cp /etc/apt/sources.list /etc/apt/sources.list.nz</code></p>
<p>Obviously replace &#8216;nz&#8217; with a suffix of your choice. Then I dropped the list of repos for the local mirror into another file (in my case /etc/apt/sources.list.ece). You can set up as many different sets as you like, but I only need two.</p>
<p>Next step is to practice switching between them:</p>
<p><code>sudo repo-switch.py nz</code></p>
<p>&#8230;sets apt to use the file /etc/apt/sources.list.nz by changing /etc/apt.sources.list to a symlink pointing to the relevant place. Calling the script again with a different set (e.g. &#8216;ece&#8217; in my case) will set it up to use one of your other sets.</p>
<p>Obviously, you&#8217;ll need to run &#8216;sudo apt-get update&#8217; each time to make apt work with the new repos, but I added a line to the script to remind you!</p>
<p>Magic!</p>
 <p><a href="http://webworxshop.com/?flattrss_redirect&amp;id=82&amp;md5=87f40cd2f29019d072a9d6f502100aea" title="Flattr" target="_blank"><img src="http://blog.webworxshop.com/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://webworxshop.com/2009/06/03/quickly-change-debian-repositories/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=robconnolly&amp;popout=1&amp;url=http%3A%2F%2Fwebworxshop.com%2F2009%2F06%2F03%2Fquickly-change-debian-repositories&amp;language=en_GB&amp;category=text&amp;title=Quickly+change+Debian+repositories&amp;description=Apt+is+awesome.+Plain+and+simple.+But+it+is+kinda+static.+By+this+I+mean+it%26%238217%3Bs+not+particularly+suited+to+environments+where+things+change+frequently.+For+example%2C+we+have+a...&amp;tags=apt%2Cawesome%2Cdebian%2Cfoss%2Cpython%2Cubuntu%2CUoA%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

