<?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>Limina.Log</title>
	<atom:link href="http://log.liminastudio.com/feed" rel="self" type="application/rss+xml" />
	<link>http://log.liminastudio.com</link>
	<description>Research &#38; Development at Limina.Studio</description>
	<lastBuildDate>Sun, 15 Jan 2012 21:25:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Welcome Disqus Comments!</title>
		<link>http://log.liminastudio.com/miscellaneous/welcome-disqus-comments</link>
		<comments>http://log.liminastudio.com/miscellaneous/welcome-disqus-comments#comments</comments>
		<pubDate>Sun, 15 Jan 2012 21:25:34 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Comments]]></category>
		<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=970</guid>
		<description><![CDATA[I just implemented Disqus comments for the entire blog, which should make things a bit nicer, since there&#8217;s been a lot of discussion on some posts.  Let me know what you think!]]></description>
			<content:encoded><![CDATA[<p>I just implemented <a href="disqus.com">Disqus comments</a> for the entire blog, which should make things a bit nicer, since there&#8217;s been a lot of discussion on some posts.  Let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/miscellaneous/welcome-disqus-comments/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Wireless Positioning &amp; Location Awareness: An Overview</title>
		<link>http://log.liminastudio.com/writing/research/wireless-positioning-location-awareness-an-overview</link>
		<comments>http://log.liminastudio.com/writing/research/wireless-positioning-location-awareness-an-overview#comments</comments>
		<pubDate>Wed, 21 Dec 2011 19:56:50 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[Location Awareness]]></category>
		<category><![CDATA[Location Fingerprinting]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[RFID]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[xbee]]></category>
		<category><![CDATA[ZigBee]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=965</guid>
		<description><![CDATA[For one of my major projects I&#8217;m tasked with figuring out how we can locate mobile wireless devices within a limited location, and it seems a lot of other people I&#8217;ve talked to are in the process of figuring out the same thing, so here&#8217;s an overview of what I&#8217;ve learned so far. Wireless Technologies [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my major projects I&#8217;m tasked with figuring out how we can locate mobile wireless devices within a limited location, and it seems a lot of other people I&#8217;ve talked to are in the process of figuring out the same thing, so here&#8217;s an overview of what I&#8217;ve learned so far.<span id="more-965"></span></p>
<p><strong>Wireless Technologies / Protocols</strong></p>
<ul>
<li>WiFi (802.11)</li>
<li>XBee/ZigBee (802.15.4)</li>
<li>BlueTooth (802.15.1)</li>
<li>RFID</li>
<ul>
<li>Near Field Communication (Two-Way RFID)</li>
</ul>
</ul>
<p>These are four of the principal wireless technologies in mainstream use today.  The goal is to determine within some degree of accuracy the position in 2 or 3 dimensions of a wireless node.  Most, if not all, of the available approaches utilize the RSSI (Received Signal Strength Indicator) of the target node&#8217;s connections to nearby nodes.</p>
<p>If you have fixed routers with known locations, you can use the RSSI values of their connections to the target node to calculate the distances from the fixed nodes to the target node.  However, any RSSI value will be heavily influenced by a number of factors that may be out of your control: interfering structures, interfering people (we are walking bags of water, which readily absorbs 2.4ghz radiation) and other interfering radio signals or noise.</p>
<p>Due to these issues, some smart folks developed a system called RADAR that uses &#8216;location fingerprinting&#8217; to take a bunch of readings of signal strengths under varying conditions and associate them with known locations.  There are a variety of algorithms to tabulate this information, one of which uses neural networks.</p>
<p>Here is a collection of extremely useful papers and links that describe these various approaches, techniques and technologies:</p>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://www.sis.pitt.edu/~dtipper/2011/Survey1.pdf">Survey of Wireless Indoor Positioning Systems</a> [pdf]</li>
<li><a href="http://www.sensor-networks.org/index.php?page=0827027001">Indoor Location using 802.15.4</a></li>
<li><a href="http://www.ece.ucdavis.edu/~chuah/classes/eec173B/eec173b-s05/students/BluetoothTri_ppt.pdf">Bluetooth Triangulation</a> [pdf]</li>
<li><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.124.3108&amp;rep=rep1&amp;type=pdf&amp;ei=jDbyTtTHO4Tz0gHl492zAg&amp;usg=AFQjCNHzIdwdyFqnY4nuSVz-ZFsj40Yn9Q&amp;sig2=YXe5yRHv3AXb9ZjySOeAEw">CS/RADAR: Indoor Location Discovery and Tracking</a> [pdf]</li>
<li><a href="http://crystal.uta.edu/~zaruba/winet_journal.pdf">Indoor location tracking using RSSI readings from a single Wi-Fi access point</a> [pdf]</li>
<li><a href="http://cial.csie.ncku.edu.tw/presentation/group_pdf/Location%20Estimation%20in%20ZigBee%20Network%20Based%20on%20Fingerprinting.pdf">Location Estimation in ZigBee Network Based on Fingerprinting</a> [pdf]</li>
<li><a href="http://www.cs.sunysb.edu/~pgupta/pdfs/COMSWARE_08.pdf">Experimental Analysis of RSSI-based Location Estimation in Wireless Sensor Networks</a> [pdf]</li>
<li><a href="http://www.freescale.com/files/microcontrollers/doc/brochure/PositionLocationMonitoring.pdf">Position Location Monitoring Using 802.15.4/ZigBee technology</a> [pdf]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/writing/research/wireless-positioning-location-awareness-an-overview/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the RN-XV WiFi Module as a Remote Switch</title>
		<link>http://log.liminastudio.com/itp/physical-computing/using-the-rn-xv-wifi-module-as-a-remote-switch</link>
		<comments>http://log.liminastudio.com/itp/physical-computing/using-the-rn-xv-wifi-module-as-a-remote-switch#comments</comments>
		<pubDate>Wed, 21 Dec 2011 00:40:57 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[RN-XV]]></category>
		<category><![CDATA[WiFi]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=959</guid>
		<description><![CDATA[It&#8217;s been a struggle, but I finally figured out how to use a Roving Networks RN-XV WiFi module as a remote switch.  It&#8217;s not hard now that I know how it works, but figuring out was quite difficult, as the manual is apparently incorrect and the firmware it shipped with was causing problems.  Read on [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://log.liminastudio.com/wp-content/uploads/2011/12/IMG_2464.jpg"  rel="lightbox[roadtrip]"><img class="alignleft size-medium wp-image-960" title="RN-XV remote switch" src="http://log.liminastudio.com/wp-content/uploads/2011/12/IMG_2464-224x300.jpg" alt="" width="224" height="300" /></a>It&#8217;s been a struggle, but I finally figured out how to use a Roving Networks RN-XV WiFi module as a remote switch.  It&#8217;s not hard now that I know how it works, but figuring out was quite difficult, as the manual is apparently incorrect and the firmware it shipped with was causing problems.  Read on for the solution!</p>
<p><strong>Hardware</strong></p>
<p>Simple! Here&#8217;s all you need:</p>
<ul>
<li>An <a href="http://www.sparkfun.com/products/8276">XBee breakout board</a> (so you can plug it into your breadboard)</li>
<li>An <a href="http://www.sparkfun.com/products/8687">XBee Explorer</a> (not necessary with ad-hoc mode, but I had one around so this tutorial will use it)</li>
<li>3.3V regulator (ONLY—the module has a 10% tolerance, so anything beyond that will either not work or damage the module).</li>
<li>10µF and 0.1µF capacitors for good measure (clean power is especially important when using radio devices)</li>
<li>Power and Ground (Pins 1 and 10, the top and bottom pins on the left side of the module)</li>
<li>An LED connected to pin 9.  In practice you&#8217;d want to put a current-limiting resistor on it, i.e. 220 ohms, but for a quick test it won&#8217;t matter.  The module only drives 8mA on this pin.</li>
<li>That&#8217;s it!</li>
</ul>
<div><strong>Setup</strong></div>
<div></div>
<div>Although the module has an ad-hoc setup mode, where it broadcasts its own ad-hoc wifi network that you connect to with your computer, I found it faster to just plug it in directly to my computer using a serial adapter such as the XBee Explorer.  When you connect with ad-hoc mode, you talk to the module over telnet, when you use direct serial, you use a serial terminal such as <a href="http://freeware.the-meiers.org/">CoolTerm</a>, which the following instructions will use.</div>
<div></div>
<div>With your module plugged into USB, open up the port in CoolTerm.  You may see some data from the unit or a status message (it&#8217;s ok if you don&#8217;t).  Type $$$ (without hitting return) to enter command mode.  Now you can setup the module&#8217;s wifi settings (hit return after each command):</div>
<div></div>
<pre>set wlan phrase &lt;your wpa password&gt;
set wlan ssid &lt;your ssid&gt;
save
reboot</pre>
<p>&nbsp;</p>
<div></div>
<div>The module will power-cycle and the green status LED will start blinking.  After 5-10 seconds it should start blinking more slowly, which indicates that it has successfully connected to your WiFi network.  If your terminal session is still open, you should see a status message that indicates its success and its IP address (which you&#8217;ll need soon).</div>
<div></div>
<div>Now we need to update the firmware.  Luckily, they made this extremely easy!  Just do this:</div>
<div></div>
<pre>ftp u</pre>
<div></div>
<div>And it will take care of the rest—connecting to the Roving Networks FTP server, downloading the newest firmware image and &#8216;installing&#8217; it.</div>
<div></div>
<div>Once that&#8217;s done, you can transfer your module to your breadboard.  The rest of the work happens over telnet, so make sure your computer and module are connecting to the same WiFi network!  When the module is on your board and it&#8217;s joined your network, open a shell on your computer and do:</div>
<div></div>
<pre>telnet &lt;module's ip address&gt; 2000</pre>
<div></div>
<div>You should see a &#8216;*HELLO*&#8217; message.  Congratulations!  Now you can talk to your breadboarded module from anywhere!  To switch the LED on and off, first set the I/O direction mask:</div>
<div></div>
<pre>set sys mask 0x21f2</pre>
<div></div>
<div>This adds GPIO (General-Purpose Input/Output) Pin 1 (hex 0&#215;2) to the default mask, setting it as an output.  To switch it high, do:</div>
<div></div>
<pre>set sys output 2 2</pre>
<div></div>
<div>Similarly, to switch it low:</div>
<div></div>
<pre>set sys output 0 2</pre>
<div></div>
<div>And that&#8217;s it!  You can now, for instance, have a web server connect directly to that port and issue those commands dynamically to control your hardware remotely.  Try hooking up a relay to switch a house light!</div>
<p><strong>References</strong></p>
<ul>
<li><a href="http://www.rovingnetworks.com/files/resources/WiFly-RN-UM.pdf">RN-XV User Manual</a> (API reference, etc.)</li>
<li><a href="http://www.rovingnetworks.com/files/resources/WiFly-RN-XV-DS.pdf">RN-XV Datasheet</a> (pinout and electrical characteristics)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/itp/physical-computing/using-the-rn-xv-wifi-module-as-a-remote-switch/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Getting Started Developing with the WiMM One</title>
		<link>http://log.liminastudio.com/programming/getting-started-developing-with-the-wimm-one</link>
		<comments>http://log.liminastudio.com/programming/getting-started-developing-with-the-wimm-one#comments</comments>
		<pubDate>Sat, 17 Dec 2011 00:23:34 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[WiMM]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=955</guid>
		<description><![CDATA[We just received a Developer Preview of the new WiMM One wearable touchscreen device, and dove into developing for it.  It runs Android so you have to get the Android SDK set up.  Here are our notes so far. Install Eclipse.  I had the &#8220;Galileo&#8221; version which I found out the hard way isn&#8217;t supported, [...]]]></description>
			<content:encoded><![CDATA[<div>We just received a Developer Preview of the new <a href="wimm.com">WiMM One</a> wearable touchscreen device, and dove into developing for it.  It runs Android so you have to get the Android SDK set up.  Here are our notes so far.</div>
<ol>
<li>Install Eclipse.  I had the &#8220;Galileo&#8221; version which I found out the hard way isn&#8217;t supported, so I downloaded the newest as of writing (&#8220;Indigo&#8221;).</li>
<li>Install the <a href="http://developer.android.com/sdk/index.html">Android SDK</a>.</li>
<li>Install the <a href="http://developer.android.com/sdk/eclipse-adt.html#installing">Android Developer Tools (ADT) plugin</a> for Eclipse.</li>
<li>Download the <a href="https://dev.wimm.com/developer/resources/sdk">WiMM Android Add-On</a> (make a free developer account first to get it).</li>
<li>Put the WiMM Add-On folder in the add-ons folder in the Android SDK.</li>
<li>Run the Android SDK Manager from Eclipse &gt; Window.</li>
<li>Select and install Android 2.1 (API 7) and the Android SDK Platform Tools.</li>
<li>Make a WiMM Android Virtual Device with SD card 2 GiB and resolution 160&#215;160.</li>
<li>You can now make new projects that target the WiMM One Add-On.</li>
</ol>
<p><strong>Building and Running on the Emulator</strong></p>
<ol>
<li>Open a terminal at [your-android-sdk]/add-ons/addon_wimm_one_7/tools and run ./emu.</li>
<li>Wait for the emulator to boot up (it takes a minute).</li>
<li>Hit &#8220;Run&#8221; in Eclipse.</li>
<ol>
<li>If you get an expired certificate error, <a href="http://stackoverflow.com/questions/2194808/debug-certificate-expired-error-in-eclipse-android-plugins">look here</a>.</li>
</ol>
<li>If you&#8217;re prompted to choose a device, choose the emulator.</li>
</ol>
<p><strong>Building and Running on the Device</strong></p>
<ol>
<li>On your WiMM, go to Settings &gt; Advanced and turn on &#8220;Allow USB debugging&#8221;</li>
<li>Plug in your WiMM.</li>
<li>Open a terminal at addon_wimm_one_7/tools and run ./android update adb.</li>
<li>Go to addon_wimm_one_7/platform-tools and run ./adb kill-server and ./adb start-server.</li>
<li>Now run ./adb devices and you should see your hardware device listed as well as any running emulators.</li>
<li>Now when you run your app from Eclipse, you can choose your hardware device!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/programming/getting-started-developing-with-the-wimm-one/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with the RN-XV WiFi Module &amp; Node.js</title>
		<link>http://log.liminastudio.com/programming/getting-started-with-the-rn-xv-wifi-module-node-js</link>
		<comments>http://log.liminastudio.com/programming/getting-started-with-the-rn-xv-wifi-module-node-js#comments</comments>
		<pubDate>Thu, 08 Dec 2011 04:08:54 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Sockets]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=951</guid>
		<description><![CDATA[The RN-XV WiFi module is a nifty little WiFi module designed to fit the same pinout as an XBee, so it&#8217;s intended to be a drop-in replacement. Tonight I whipped up a little test of the module to get a joystick to talk to a Node.js server over WiFi.  I attached +3V power and ground [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.sparkfun.com/products/10822">RN-XV WiFi module</a> is a nifty little WiFi module designed to fit the same pinout as an XBee, so it&#8217;s intended to be a drop-in replacement.</p>
<p>Tonight I whipped up a little test of the module to get <a href="http://www.sparkfun.com/products/9032">a joystick</a> to talk to a <a href="http://nodejs.org/">Node.js</a> server over WiFi.  I attached +3V power and ground to the module (pins 1 and 10, respectively), pin 2 (TX) to Arduino digital pin 0 (RX), and pin 1 (RX) to Arduino digital pin 1 (TX).  That&#8217;s all the hardware setup you need.</p>
<p>I used <a href="https://github.com/jcrouchley/WiFly-Shield">this WiFly library</a> to handle the connection.  All it does is talk to the WiFly module over serial and send control commands, so the library abstracts that a bit.  Here&#8217;s the Arduino sketch I built:<span id="more-951"></span></p>
<pre>#include "WiFly.h"

#define PIN_VERT      0  // analog
#define PIN_HOR       1  // analog

#define PIN_PUSH      2
#define PIN_LED_RED   3
#define PIN_LED_GRN   4

int vert = 0;
int hor = 0;
bool push;

char* ssid = "yourNetwork";
char* pass = "yourPassword";

char* serverAddress = "yourServer";
int serverPort = 1337;

Client client(serverAddress, serverPort);

void setup(){
  pinMode(PIN_PUSH, INPUT);
  pinMode(PIN_LED_RED, OUTPUT);
  pinMode(PIN_LED_GRN, OUTPUT);

  digitalWrite(PIN_PUSH, HIGH);    // set pull-up resistor
  digitalWrite(PIN_LED_RED, LOW);  // start off
  digitalWrite(PIN_LED_GRN, LOW);

  Serial.begin(9600);
  WiFly.setUart(&amp;Serial);
  WiFly.begin();

  if (!WiFly.join(ssid, pass, true)) {
    digitalWrite(PIN_LED_RED, HIGH);
    while (1) {
      // Hang on failure.
    }
  }

  digitalWrite(PIN_LED_GRN, HIGH);

  if (client.connect()) {
    client.println("ohai!");
    client.println();
  } else {
    // do nothing
  }
}

void loop(){
  vert = analogRead(PIN_VERT);
  hor = analogRead(PIN_HOR);
  push = digitalRead(PIN_PUSH);

  digitalWrite(PIN_LED_RED, !push);

  client.print(vert);
  client.print('\t');
  client.print(hor);
  client.print('\t');
  client.print(push);
  client.println();
  delay(10);
}</pre>
<p>And here&#8217;s the very basic Node.js server that just prints out the values it receives:</p>
<pre>var net = require('net');

var server = net.createServer(function(socket) { //'connection' listener
	console.log('server connected');

	socket.setEncoding('ascii');

	socket.on('end', function() {
		console.log('server disconnected');
	});

	socket.on('data', function(data){
		console.log(data);
	});
});

server.listen(1337, function() { //'listening' listener
	console.log('server bound');
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/programming/getting-started-with-the-rn-xv-wifi-module-node-js/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PQLabs Multitouch Screen Not Working in Windows 7? Enable It</title>
		<link>http://log.liminastudio.com/programming/pqlabs-multitouch-screen-not-working-in-windows-7-enable-it</link>
		<comments>http://log.liminastudio.com/programming/pqlabs-multitouch-screen-not-working-in-windows-7-enable-it#comments</comments>
		<pubDate>Mon, 21 Nov 2011 16:02:02 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Multitouch]]></category>
		<category><![CDATA[Solution]]></category>
		<category><![CDATA[Touchscreen]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=945</guid>
		<description><![CDATA[I just discovered that, in order to get a PQLabs Multitouch screen in Windows 7 to properly report multitouch events (to Adobe AIR/Flash, in my case), one must go to Settings &#62; Pen and Touch, go to the Touch tab, and check &#8220;Enable multi-touch gestures and inking.&#8221;  Thanks, Windows. &#62;:-&#124;]]></description>
			<content:encoded><![CDATA[<p>I just discovered that, in order to get a PQLabs Multitouch screen in Windows 7 to properly report multitouch events (to Adobe AIR/Flash, in my case), one must go to Settings &gt; Pen and Touch, go to the Touch tab, and check &#8220;Enable multi-touch gestures and inking.&#8221;  Thanks, Windows. &gt;:-|</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/programming/pqlabs-multitouch-screen-not-working-in-windows-7-enable-it/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling Deluge Auto-Management and File Priorities via Python</title>
		<link>http://log.liminastudio.com/programming/controlling-deluge-auto-management-and-file-priorities-via-python</link>
		<comments>http://log.liminastudio.com/programming/controlling-deluge-auto-management-and-file-priorities-via-python#comments</comments>
		<pubDate>Tue, 15 Nov 2011 21:27:58 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[BitTorrent]]></category>
		<category><![CDATA[Deluge]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=943</guid>
		<description><![CDATA[Today I was working away from my home file server which runs the BitTorrent server Deluge.  My Deluge Web UI stopped working for some reason (and it never worked that well in the first place) and I really needed to start a torrent at home.  Deluge has an &#8220;Auto Managed&#8221; feature that&#8217;s enabled by default, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was working away from my home file server which runs the BitTorrent server Deluge.  My Deluge Web UI stopped working for some reason (and it never worked that well in the first place) and I really needed to start a torrent at home.  Deluge has an &#8220;Auto Managed&#8221; feature that&#8217;s enabled by default, but since I seed a lot of torrents, it actually prevents a new torrent from starting to download automatically, so I have to disable that and the resume the torrent after adding it.  Thankfully Deluge has a Python client interface we can use to write our own scripts.</p>
<p>Here&#8217;s an example script that adds a URL from an argument with auto_managed turned off:</p>
<pre>#!/usr/bin/env python
# encoding: utf-8
"""
DelugeEasyAdd

Starts a new Deluge torrent from a URL.

Created by Ted Hayes.

"""

import urllib, os, sys, re
# Import the client module
from deluge.ui.client import client
# Import the reactor module from Twisted - this is for our mainloop
from twisted.internet import reactor

# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()

# Connect to a daemon running on the localhost
# We get a Deferred object from this method and we use this to know if and when
# the connection succeeded or failed.
d = client.connect()

PRIO_NORMAL = 1
PRIO_MAX = 5

torrentURL = sys.argv[1]
# btjunkie URLs use 'download.torrent' as the filename, get a better one
if re.search("btjunkie", torrentURL):
    filename = re.findall("torrent\/(.*?)\/", torrentURL)[0]
else:
    filename = os.path.basename(torrentURL)

print "Using filename: %s" % filename

def addTorrent():
    client.core.add_torrent_url(torrentURL, '/home/daleth/Downloads/'+filename, {'auto_managed':False}).addCallback(added)

def added(s):
    print "Added status: ",s
    #client.core.resume_torrent()
    disconnect()

# We create a callback function to be called upon a successful connection
def on_connect_success(result):
    print "Connection was successful!"
    addTorrent()

def disconnect():
    print "disconnecting"
    client.disconnect()
    reactor.stop()

# We add the callback to the Deferred object we got from connect()
d.addCallback(on_connect_success)

# We create another callback function to be called when an error is encountered
def on_connect_fail(result):
    print "Connection failed!"
    print "result:", result

# We add the callback (in this case it's an errback, for error)
d.addErrback(on_connect_fail)

# Run the twisted main loop to make everything go
reactor.run()</pre>
<p>I still have to figure out how to then automatically resume the torrent.</p>
<p>Here are some helpful links:</p>
<p><a href="http://dev.deluge-torrent.org/wiki/Development/UiClient">UIClient Documentation<br />
</a></p>
<p><a href="http://dev.deluge-torrent.org/wiki/Development/1.3/UIClient">UIClient Example </a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/programming/controlling-deluge-auto-management-and-file-priorities-via-python/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tools for Disassembly and Reverse Engineering</title>
		<link>http://log.liminastudio.com/uncategorized/tools-for-disassembly-and-reverse-engineering</link>
		<comments>http://log.liminastudio.com/uncategorized/tools-for-disassembly-and-reverse-engineering#comments</comments>
		<pubDate>Sat, 12 Nov 2011 22:11:18 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=940</guid>
		<description><![CDATA[Following Trammell Hudson&#8217;s excellent introductory workshop on assembly and reverse engineering, here are my notes on what I had to do to get things up and running. I was doing this on my Ubuntu 10.04 Linode instance, and we were targetting ARM processors, so first I had to install the appropriate gcc toolchain.  I didn&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>Following Trammell Hudson&#8217;s excellent introductory workshop on assembly and reverse engineering, here are my notes on what I had to do to get things up and running.</p>
<p>I was doing this on my Ubuntu 10.04 Linode instance, and we were targetting ARM processors, so first I had to install the appropriate gcc toolchain.  I didn&#8217;t have add-apt-repository, so I had to install python-software properties first.  The last install is to get libc (stdio, etc).</p>
<pre>sudo apt-get install python-software-properties
sudo add-apt-repository ppa:linaro-maintainers/toolchain
sudo apt-get install gcc-4.5-arm-linux-gnueabi
sudo apt-get install libc6-armel-cross libc6-dev-armel-cross</pre>
<p>Then I used these commands for compiling, disassembling and looking for interesting strings:</p>
<pre>arm-linux-gnueabi-gcc-4.5 -O3 -c helloWorld.c
arm-linux-gnueabi-objdump -D helloWorld.o | less
strings -t x helloWorld.o</pre>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/uncategorized/tools-for-disassembly-and-reverse-engineering/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eagle Error: old version of device set is not present in the new version of this device set.</title>
		<link>http://log.liminastudio.com/itp/physical-computing/eagle-error-old-version-of-device-set-is-not-present-in-the-new-version-of-this-device-set</link>
		<comments>http://log.liminastudio.com/itp/physical-computing/eagle-error-old-version-of-device-set-is-not-present-in-the-new-version-of-this-device-set#comments</comments>
		<pubDate>Thu, 10 Nov 2011 19:47:18 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Eagle]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=937</guid>
		<description><![CDATA[Today I was attempting to paste parts of an Eagle schematic I found online into a new schematic, and I was getting the following error message: Package variant PTH1 in the old version of device set RESISTOR is not present in the new version of this device set. This is caused by a library in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was attempting to paste parts of an Eagle schematic I found online into a new schematic, and I was getting the following error message:</p>
<pre>Package variant PTH1 in the old version of device set RESISTOR is not present in the new version of this device set.</pre>
<p>This is caused by a library in the original schematic having some different package definition than the library in the new schematic.  The fix is easy: In the original schematic, go to Library &gt; Update All.  Then you can copy and paste without the error!</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/itp/physical-computing/eagle-error-old-version-of-device-set-is-not-present-in-the-new-version-of-this-device-set/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Serial.print sends numbers instead of letters</title>
		<link>http://log.liminastudio.com/itp/physical-computing/arduino-serial-print-sends-numbers-instead-of-letters</link>
		<comments>http://log.liminastudio.com/itp/physical-computing/arduino-serial-print-sends-numbers-instead-of-letters#comments</comments>
		<pubDate>Wed, 12 Oct 2011 03:04:49 +0000</pubDate>
		<dc:creator>Tedb0t</dc:creator>
				<category><![CDATA[Physical Computing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://log.liminastudio.com/?p=934</guid>
		<description><![CDATA[Recently I experienced a somewhat baffling, unexpected problem. I was using a line like: Serial.println('test'); And getting a series of numbers like 25536 instead of the expected text. It turned out the problem was just the use of the &#8216; instead of a &#8220;. Sigh.]]></description>
			<content:encoded><![CDATA[<p>Recently I experienced a somewhat baffling, unexpected problem. I was using a line like:</p>
<pre>Serial.println('test');</pre>
<p>And getting a series of numbers like 25536 instead of the expected text.  It turned out the problem was just the use of the &#8216; instead of a &#8220;.  Sigh.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.liminastudio.com/itp/physical-computing/arduino-serial-print-sends-numbers-instead-of-letters/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

