<?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>char1es.net &#187; Geek out</title>
	<atom:link href="http://char1es.net/category/geek-out/feed/" rel="self" type="application/rss+xml" />
	<link>http://char1es.net</link>
	<description>musings of a peripatetic</description>
	<lastBuildDate>Thu, 19 Jan 2012 22:57:56 +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>Headless modem control on ARM</title>
		<link>http://char1es.net/2012/01/03/headless-modem-control-on-arm/</link>
		<comments>http://char1es.net/2012/01/03/headless-modem-control-on-arm/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 03:52:41 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=519</guid>
		<description><![CDATA[It seems so long ago that I first bought a EDGE/HSDPA modem so I could work on the train between Durham and Lancaster.  Linux was my OS of choice at the time and I used wvdial to control EDGE/HSDPA Modems. These days WWAN connections seem more common and I was very happy to see NetworkManager [...]]]></description>
			<content:encoded><![CDATA[<p>It seems so long ago that I first bought a EDGE/HSDPA modem so I could work on the train between Durham and Lancaster.  Linux was my OS of choice at the time and I used wvdial to control EDGE/HSDPA Modems.  These days WWAN connections seem more common and I was very happy to see NetworkManager add support.  Even thought it was a little clunky I would still periodically use wvdial for headless machines where I needed to script connections from the command line.  Recently I&#8217;ve been doing some work with a beagleboard which has an ARM processor; wvdial is currently broken on ARM architecture and ppp was giving me a headache.  After numerous emails trying to find a work around, I learned that nmcli has gives you control from the command line, and if you have the keyfile plugin enabled in NetworkManager.conf, global connections are written out .ini-style in /etc/NetworkManager/system-connections/</p>
<p>e.g. /etc/NetworkManager/system-connections/GrammeenPhone</p>
<p><pre><code>[connection]
id=GrameenPhone
uuid=b68882db-7e97-4fa3-a811-9234f64098f6
type=gsm
autoconnect=false
timestamp=1316411329

[ipv4]
method=auto

[serial]
baud=115200

[gsm]
number=*99#
apn=gpinternet</code></pre><br />
The end result is that it&#8217;s possible to connect with a simple command</p>
<p>#nmcli con up id GrameenPhone</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2012/01/03/headless-modem-control-on-arm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Next Billion</title>
		<link>http://char1es.net/2011/05/13/the-next-billion/</link>
		<comments>http://char1es.net/2011/05/13/the-next-billion/#comments</comments>
		<pubDate>Fri, 13 May 2011 13:13:29 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=489</guid>
		<description><![CDATA[Mobile phones are everywhere in Bangladesh. It&#8217;s been so successful here because it fits  well into the culture of gab, aggregates the purchasing power of Bangladeshi&#8217;s, and the infrastructure is able to avoid many of the problems pervasive in Bangladesh. Recently I wrote a post about the barriers to information transfer in the developing world [...]]]></description>
			<content:encoded><![CDATA[<p>Mobile phones are everywhere in Bangladesh. It&#8217;s been so successful here because it fits  well into the culture of gab, aggregates the purchasing power of Bangladeshi&#8217;s, and the infrastructure is able to avoid many of the problems pervasive in Bangladesh.  Recently I wrote a <a title="State of the computer in the Developing World" href="http://char1es.net/2011/04/26/state-of-the-computer-in-the-developing-world/">post</a> about the barriers to information transfer in the developing world and made the point that the current ways of working in the west, particularly mobile devices and bandwidth intensive web apps, aren&#8217;t as accessible in the developing world.  That was a statement of the current situation, but I&#8217;d like to point out a trend.   Two years ago I would have said that simple phones are most common, but now I&#8217;m not sure.  At that time Nokia was the clear winner.  It was very clearly the brand to own.  The big spenders used expensive Nokia sets which helped Nokia to sell their entry level phones. While proper smart phones are still in distinct minority, the new high-end devices I&#8217;m seeing are iPhones and Android devices. There are still a fair amount of mid-range Nokia sets, but Chinese and Indian sets with more functionality are popping up everywhere.  The village I live in has mud huts and inconsistent power, but some of  the young men have mobile sets that play music and movies, support multiple sim cards, have bluetooth and are capable of  basic internet access.</p>
<p>Last year I had a motorcycle accident and broke my 3rd metacarpal in my right hand.  At the same time my power cable for my laptop went out and getting a warranty claim processed in Bangladesh takes longer than it should. I was without my primary computer, and I couldn&#8217;t use a keyboard like I normally did.  The biggest single reason I bought an Android device is that it works as a standalone device, and during that time, that functionality served me well.  For several weeks, my Nexus One became my primary computer.  I used it one handed, and it turned out that for many things I wasn&#8217;t really limited.  There was a big criticism about tablets was consume content rather than create content.  I think has largely faded being I don&#8217;t read as much about that anymore.  High end phones are just as capable processing wise as the tablets and maybe a more important question is whether the device functionally complete: is the device able complete a task without physical access to another general purpose computer.  While my Nexus One was my primary device, I couldn&#8217;t access peripherals such as flash storage and USB devices and I couldn&#8217;t develop on the Android for the Android.<a id="tnb1" href="#tnbref1"><sup>1</sup></a> These issues are basically the same on iOS as well, but the times they are a changing.  Smart phones are becoming increasingly standalone devices.  I&#8217;ve now got a Python environment on Android through Scripting Library for Android and the recent announcement of Android ADK is going to allow a plethora of hardware options.  Apple with it&#8217;s proprietary connecter offers a good deal of input output options and dongles like camera connection kit allow you to move data on and of a device.   Recently I even saw that Oscium makes an oscilloscope/logic analyzer for iOS, which is something I would find useful.</p>
<p>As these phones become functionally complete, they&#8217;re going to start replacing computers.  As low end phones gain functionality and processing power, Android is going to start showing up in the developing world.  I wonder if Microsoft realizes how truly irrelevant it is becoming.  Desktops and laptops here run either open source or pirated software, but there are over a billion people who want to buy phones in the Indian subcontinent and another billion in China.  While I don&#8217;t think Apple is going to go after the developing world market, I suspect that Apple will continue to transition iOS toward a standalone OS which would position them with the option.<a id="tnb2" href="#tnbref2"><sup>2</sup></a> The personal computer of the developing world is a phone made in Shenzhen, and I wonder who&#8217;s thinking about that.</p>
<p><a id="tnbref1" href="#tnb1">1</a> Not including a linux environment on a rooted handset.<br />
<a id="tnbref2" href="#tnb2">2</a> My bet for the North Carolina Datacenter.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2011/05/13/the-next-billion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>State of the computer in the Developing World</title>
		<link>http://char1es.net/2011/04/26/state-of-the-computer-in-the-developing-world/</link>
		<comments>http://char1es.net/2011/04/26/state-of-the-computer-in-the-developing-world/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 14:04:34 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=481</guid>
		<description><![CDATA[You&#8217;ve probably notice two trends in the developed world. The first is toward web or cloud based software and the second is a move toward mobile devices and content in both cases the trend is toward greater network connectivity. Maybe I&#8217;m just getting old, but I haven&#8217;t seen anything that compelling in desktop software design [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve probably notice two trends in the developed world.  The first is toward web or cloud based software and the second is a move toward mobile devices and content in both cases the trend is toward greater network connectivity.  Maybe I&#8217;m just getting old, but I haven&#8217;t seen anything that compelling in desktop software design recently.  Sure the apps look nicer, but there hasn&#8217;t been that much added in terms of daily functionality.  The causes for that which maybe aren&#8217;t that important, but the reality is that the paradigm of the desktop is increasingly becoming irrelevant. The interesting things are happening on the web and on mobile devices.  In general I think this is good for consumers, but there are some practical issues when it comes to the developing world.  Bangladesh is what I know about, so let&#8217;s look there.   Practically Bangladesh has one internet connection, Sea-me-we 4 which is an undersea cable and the primary internet backbone between South East Asia, the Indian subcontinent, the Middle East and Europe.   For a lot of reasons, Bangladesh currently doesn&#8217;t have much in the way of content creation and content distribution so all traffic needs to go out of Bangladesh.  This means that bandwidth costs are slow and expensive.  The result being that I probably didn&#8217;t watch the youtube video you emailed me.  At the end of the day these issues slow knowledge transfer.  Access to knowledge has always been a barrier to development and even in an internet age, the content created in the developed world is still difficult to access in the developing world.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2011/04/26/state-of-the-computer-in-the-developing-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android apps in the Developing world</title>
		<link>http://char1es.net/2011/04/12/android-apps-in-the-developing-world/</link>
		<comments>http://char1es.net/2011/04/12/android-apps-in-the-developing-world/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:08:45 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=474</guid>
		<description><![CDATA[Amazon has been doing some really interesting things with technology in the last 5 years.  Some part of still me thinks of them as an online book store, but many of their own technology products have been consistently innovative and unique.  Until the kindle, most of those like the EC2 (virtual servers on an hourly rate) and [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon has been doing some really interesting things with technology in the last 5 years.  Some part of still me thinks of them as an online book store, but many of their own technology products have been consistently innovative and unique.  Until the kindle, most of those like the EC2 (virtual servers on an hourly rate) and S3 (pay by use data storage) were only things a geek could love.  I was stunned recently to find out about their cloud player which lets you upload music to the web and stream it to any device with a network connection and Adobe Air support.  While it currently only works in the US, if it survives legal challenges, it could turn out to be pretty significant.  The recently announced appstore for android might seem like that not a big of an issue since there are other options for getting Android apps.  However there is one very significant issue which as ramifications in the international context.  The Google market is tied to providers while the amazon appstore is tied to customer accounts.  If I swap SIM cards in my mobile phone, I see different applications available in the Google market.  On the other hand, the appstore seems to be tied to my credit card.  In Bangladesh, paid apps don&#8217;t show up in the mobile version of the market, but they do show up in the app store.  Net net that means I can actually buy applications here.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2011/04/12/android-apps-in-the-developing-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar</title>
		<link>http://char1es.net/2011/03/21/solar/</link>
		<comments>http://char1es.net/2011/03/21/solar/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 05:31:52 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=462</guid>
		<description><![CDATA[It&#8217;s starting to get hot and as a result power outages are getting more frequent.  Last year with more than 12hour daily power outages and only 3 or 4 during daylight hours it was hard to get any work done.  This year however, we got a solar system setup and I hope that makes things [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; margin-right: auto; margin-left: auto;" src="http://char1es.net/wp-content/uploads/2011/03/wpid-IMG_20110321_111823.jpg" alt="image" /></p>
<p>It&#8217;s starting to get hot and as a result power outages are getting more frequent.  Last year with more than 12hour daily power outages and only 3 or 4 during daylight hours it was hard to get any work done.  This year however, we got a solar system setup and I hope that makes things go smoother.  There are still some quirks to work out, but we seem to have a system that is giving us consistent power through the day.  We have 960W array and a 48V 400ah battery pack.  The interesting bit is the charge controller, a Su-kam PCU 2k48.  I haven&#8217;t seen anything quite like it and it seems like a fairly ideal system for our situation.  There&#8217;s no net metering policy in Bangladesh, and even if there was, the grid power is so inconsistant that you would need some sort of battery backup anyway.   This unit ties together PV, grid and a batteries.  I haven&#8217;t tested inverter efficiency yet, but the design seems like about the most sane way to do it.  The documentation is fairly confusing, but there are two paths though it. There&#8217;s the PV -&gt; Charge controller/Battery-&gt;  Inverter path which it prefers, but in the event that it can&#8217;t supply enough from that source, it fails over to the other path which is Grid power, also there is a battery charger which can charge your pack at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2011/03/21/solar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7</title>
		<link>http://char1es.net/2010/08/25/7/</link>
		<comments>http://char1es.net/2010/08/25/7/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 13:37:08 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=367</guid>
		<description><![CDATA[Seven years ago I was playing around and I wrote my first post on a blog. I had a website even earlier, but having a blog made it easier to write posts. It&#8217;s had several homes since then, I looked in the archives and it&#8217;s a pretty good list of stories from over the years. [...]]]></description>
			<content:encoded><![CDATA[<p>Seven years ago I was playing around and I wrote my <a href="http://char1es.net/2003/08/25/first-post/">first post</a> on a blog. I had a website even earlier, but having a blog made it easier to write posts. It&#8217;s had several homes since then, I looked in the <a href="http://char1es.net/archives/">archives</a> and it&#8217;s a pretty good list of stories from over the years.  I hope there will be many more.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2010/08/25/7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time well spent?</title>
		<link>http://char1es.net/2010/04/02/time-well-spent/</link>
		<comments>http://char1es.net/2010/04/02/time-well-spent/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 15:58:54 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Babbling]]></category>
		<category><![CDATA[Geek out]]></category>
		<category><![CDATA[Wanderlust]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=344</guid>
		<description><![CDATA[I just got to Macau this evening.   So very good to be back here.  I left Cambodia yesterday.   I really enjoyed my time there.   So drastically different from Bangladesh, but in some ways very similar.  I put some photos up on flickr.  Probably the most notable event though was that I have a neice now, [...]]]></description>
			<content:encoded><![CDATA[<p>I just got to Macau this evening.   So very good to be back here.  I left Cambodia yesterday.   I really enjoyed my time there.   So drastically different from Bangladesh, but in some ways very similar.  I put some photos up on <a href="http://www.flickr.com/photos/ncharles/sets/72157623734986706/">flickr</a>.  Probably the most notable event though was that I have a neice now, which makes me an Uncle.</p>
<p>I spent another day in Kaula Lumpur, however that was mostly a non event.  I stayed out at LCCT and while I did go in to the town center, I didn&#8217;t see much.  This morning I camped out in a Starbucks taking advantage of their free wifi.  I&#8217;ve been thinking about a redesign of the old blog for a while now, something a little more minimalist and this seemed like a good way to use a slow morning.  I&#8217;ve been reading Dive into mark and I&#8217;m liking a lot of his thoughts, especially things like <a href="http://diveintomark.org/archives/2010/02/23/simplicity-is-hard-lets-go-shopping">Simplicity is hard lets go shopping</a>.  So I started hacking this morning and by check in time I had something that looks like his site, maybe too much, even if it is the MIT license.   I&#8217;m not sure how important blog design is these days, I mean I use RSS feeds for most of my friends blogs.  It&#8217;s fun to have something that looks good though, or at least that I think looks good.  If it doesn&#8217;t look good, well, stop using Microsoft explorer, or let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2010/04/02/time-well-spent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>twitterd in Python</title>
		<link>http://char1es.net/2009/07/08/twitterd-in-python/</link>
		<comments>http://char1es.net/2009/07/08/twitterd-in-python/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 04:24:57 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Code Hacking]]></category>
		<category><![CDATA[Geek out]]></category>
		<category><![CDATA[twitter finger]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=273</guid>
		<description><![CDATA[So a while ago I decided that twitter is the new finger albeit more palitable for the masses and wrote twitterd in perl. I&#8217;ve been using this to update my twitter and facebook status ever since. A couple of months ago I decided to rewrite it in Python. Next stop C? #!/usr/bin/python &#34;&#34;&#34; twitterd Author: [...]]]></description>
			<content:encoded><![CDATA[<p>So a while ago I decided that <a href="http://char1es.net/2008/03/09/twitter-is-the-new-finger-a-bedtime-story-for-little-hackers/">twitter is the new finger</a> albeit more palitable for the masses and wrote twitterd in perl.  I&#8217;ve been using this to update my twitter and facebook status ever since.  A couple of months ago I decided to rewrite it in Python.  Next stop C?   </p>
<p><pre><code>#!/usr/bin/python
&quot;&quot;&quot;
twitterd
Author: Nathan Charles &lt;ncharles at gmail dot com&gt;
Version: 0.1
This program twits the contents of a file when it&#039;s time stamp is updated.&nbsp;&nbsp;
The functionality is similar to that of finger/.plan in days of yore.
Requires:
&nbsp;&nbsp; pytwitter
&nbsp;&nbsp; configobj
This program has no warranty to the full extent of the law
&quot;&quot;&quot;

import pytwitter
from sys import exit, argv
from os import path
from time import sleep

POLLINT = 60
READLEN = 140

def setEnv():
&nbsp;&nbsp;&nbsp;&nbsp;from configobj import ConfigObj
&nbsp;&nbsp;&nbsp;&nbsp;from os import environ
&nbsp;&nbsp;&nbsp;&nbsp;import getopt
&nbsp;&nbsp;&nbsp;&nbsp;env = {}
&nbsp;&nbsp;&nbsp;&nbsp;HOME = environ.get(&quot;HOME&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;config = ConfigObj(HOME + &#039;/.twitrc&#039;)
&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;watchfile&quot;] = HOME + &#039;/.plan&#039;
&nbsp;&nbsp;&nbsp;&nbsp;try:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;username&quot;] = config[&#039;username&#039;]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;password&quot;] = config[&#039;password&#039;]
&nbsp;&nbsp;&nbsp;&nbsp;except:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#.twitrc doesn&#039;t exist not nessarily a problem
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass

&nbsp;&nbsp;&nbsp;&nbsp;try:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;optlist&quot;], args = getopt.getopt(argv[1:], &#039;dfh&#039;,[&quot;username=&quot;,&quot;password=&quot;])
&nbsp;&nbsp;&nbsp;&nbsp;except getopt.GetoptError:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usage()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;called exception&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1)
&nbsp;&nbsp;&nbsp;&nbsp;for o,a in env[&quot;optlist&quot;]:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if o == &quot;--username&quot;:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;username&quot;]=a
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if o == &quot;--password&quot;:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env[&quot;password&quot;]=a

&nbsp;&nbsp;&nbsp;&nbsp;if not &quot;username&quot; in env:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;username is not set&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1)
&nbsp;&nbsp;&nbsp;&nbsp;if not &quot;password&quot; in env:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;password is not set&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1)
&nbsp;&nbsp;&nbsp;&nbsp;return env

def watch(username, password, watchfile):
&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;Updates a twitter feed with the contents of a file when the timestamp is updated.
&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;try:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeStampInitial = path.getmtime(watchfile)
&nbsp;&nbsp;&nbsp;&nbsp;except:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#file doesn&#039;t exist setting to 0 because it might exist in the future
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeStampInitial = 0
&nbsp;&nbsp;&nbsp;&nbsp;while 1:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeStampIncrimented = path.getmtime(watchfile)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#file still doesn&#039;t exist
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeStampIncrimented = 0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (timeStampInitial==timeStampIncrimented):
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(POLLINT)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeStampInitial = timeStampIncrimented
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#update status
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTxt = file(watchfile).read(READLEN)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client = pytwitter.pytwitter(username=username, password=password)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rc = client.statuses_update(status=statusTxt)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print rc

def usage():
&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;Prints when called with no arguments or with invalid arguments
&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&quot;&quot;usage: twitterd [options]
&nbsp;&nbsp; -d&nbsp;&nbsp;&nbsp;&nbsp;daemonize
&nbsp;&nbsp; -f&nbsp;&nbsp;&nbsp;&nbsp;run in forground
&nbsp;&nbsp; -h&nbsp;&nbsp;&nbsp;&nbsp;help

&nbsp;&nbsp; twitterd must have twitter username/password set. this can be set via .twitrc

&nbsp;&nbsp; --password&nbsp;&nbsp;&nbsp;&nbsp;set username
&nbsp;&nbsp; --username&nbsp;&nbsp; set password&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;

if __name__ == &quot;__main__&quot;:
&nbsp;&nbsp;&nbsp;&nbsp;g = setEnv()

&nbsp;&nbsp;&nbsp;&nbsp;if g[&quot;optlist&quot;]:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for o,a in g[&quot;optlist&quot;]:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if o == &#039;-h&#039;:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usage()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if o == &#039;-d&#039;:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#run in background
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import daemon
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;daemon.daemonize()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if o == &#039;-f&#039;:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#run in forground
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;Running in Foreground&quot;
&nbsp;&nbsp;&nbsp;&nbsp;else:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usage()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1)

&nbsp;&nbsp;&nbsp;&nbsp;watch(g[&quot;username&quot;], g[&quot;password&quot;], g[&quot;watchfile&quot;])</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2009/07/08/twitterd-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Low cost data logging with Arduino</title>
		<link>http://char1es.net/2009/05/24/low-cost-data-logging-with-arduino/</link>
		<comments>http://char1es.net/2009/05/24/low-cost-data-logging-with-arduino/#comments</comments>
		<pubDate>Sun, 24 May 2009 13:09:18 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Code Hacking]]></category>
		<category><![CDATA[Geek out]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[temperature]]></category>
		<category><![CDATA[thermistor]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=242</guid>
		<description><![CDATA[I&#8217;ve been wanting to play around with an Arduino for a while, so I bought a Duemilanove without a set goal in mind. Recently I&#8217;ve been working with Solar thermal and I needed to measure several temperatures simultaneously so decided this would be as good a project as any. I bought some &#8220;4700 ohm&#8221; thermistors [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to play around with an Arduino for a while, so I bought a <a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove">Duemilanove</a> without a set goal in mind.  Recently I&#8217;ve been working with Solar thermal and I needed to measure several temperatures simultaneously so decided this would be as good a project as any.  I bought some &#8220;4700 ohm&#8221; thermistors and hooked them up with some  other 4700 ohm resistors in a voltage divider configuration.  The output of which is hooked up to the analog inputs on the Arduino.  I found a <a href="http://www.arduino.cc/playground/ComponentLib/Thermistor">Thermistor Example</a> in the Arduino playground which I had to modify somewhat to make work with my configuration.  I was confused for about a day as to why my thermistor equation <img src='http://s.wordpress.com/latex.php?latex=T%3D%5Cfrac%7B%5Cbeta%20%7D%7B%5Cln%20%5Cleft%20%28%20%5Cfrac%7BR_%7BT%7D%7D%7BR_%7B25C%7D%7D%5Cright%20%29%2B%5Cfrac%7B%5Cbeta%7D%7B298.15%7D%7D-273.15&#038;bg=T&#038;fg=000000&#038;s=0' alt='T=\frac{\beta }{\ln \left ( \frac{R_{T}}{R_{25C}}\right )+\frac{\beta}{298.15}}-273.15' title='T=\frac{\beta }{\ln \left ( \frac{R_{T}}{R_{25C}}\right )+\frac{\beta}{298.15}}-273.15' class='latex' /> was giving me garbage.  After doubting my ablity to do math pretty severely I finally figured out that my math was indeed correct and as it turns out the &#8220;4700 ohm&#8221; thermistor package was incorrectly labeled and were actually only 470 ohm.  Anyway, I modified the code so it would work with my thermistors and pass multiple temperatures back across the serial line.  </p>
<p><a href="http://char1es.net/code/therm.pde">Arduino Thermistor Sketch</a></p>
<p>Then I wrote some quick and dirty python code to read the values coming off the serial line and write it to a csv file which I could open with OpenOffice.</p>
<p><pre><code>import serial
import time
ser = serial.Serial(&#039;/dev/tty.usbserial-A6008dxP&#039;, 9600, timeout=1)
logfile = open(&#039;test.csv&#039;, &#039;a&#039;)

while 1:&nbsp;&nbsp; # read a &#039;\n&#039; terminated line 
&nbsp;&nbsp; line = ser.readline()&nbsp;&nbsp; # read a &#039;\n&#039; terminated line
&nbsp;&nbsp; if not line:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break
&nbsp;&nbsp; words = line.split()
&nbsp;&nbsp; now = time.strftime(&quot;%d/%m/%Y %H:%M:%S&quot;, time.localtime())
&nbsp;&nbsp; a =&nbsp;&nbsp;&quot;%s, %s&quot; % (now, line)
&nbsp;&nbsp; if line.find(&#039;,&#039;) != -1:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logfile.write(a)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logfile.flush()

logfile.close()
ser.close()
</code></pre></p>
<p>The resolution isn&#8217;t that great because the inputs are only a 10bit ADCs but it&#8217;s more than enough to get trends.  Without a more accurate thermometer, I can&#8217;t tell for certain how accurate it is, but as far as I can tell it reads faster and more accurately than the mercury thermometer we have.  In university I would have done this with a fairly expensive LabVIEW system. The impressive thing is that I can get good enough information for what I need with Python and less than $30US in parts including the Arduino.  </p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2009/05/24/low-cost-data-logging-with-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office to AKB</title>
		<link>http://char1es.net/2009/04/05/office-to-akb/</link>
		<comments>http://char1es.net/2009/04/05/office-to-akb/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 12:56:38 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[Geek out]]></category>
		<category><![CDATA[Wanderlust]]></category>
		<category><![CDATA[AKB]]></category>
		<category><![CDATA[Bogra]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[LPK]]></category>

		<guid isPermaLink="false">http://char1es.net/?p=230</guid>
		<description><![CDATA[Phil and I biked out to Adarsho Kamar Bari tonight and I recorded the route to there from the office and back. You can check out the route with Google Earth.]]></description>
			<content:encoded><![CDATA[<p>Phil and I biked out to Adarsho Kamar Bari tonight and I recorded the route to there from the office and back.  You can check out the <a href="http://char1es.net/wp-content/uploads/2009/04/r134327593.kml">route</a> with Google Earth.</p>
]]></content:encoded>
			<wfw:commentRss>http://char1es.net/2009/04/05/office-to-akb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

