Saturday, February 6, 2010

Some set-up justifications

So why have I chosen IronPython as my development language? When I started in my quest to build my home SES I was loaned a Digi ConnectPort X4 (by some parties sharing my interests and needing some software) to explore the possibilities of communicating with a variety of sensors around my house. These sensors would monitor things like light levels, temperature, current and voltage loads at various points, movement sensors, etc., none of which have been built yet, but we know they are going to be communicating through XBee Digi Mesh transmitters/receivers. There would also be some simple control like, for example, being able to control whether or not aany particular outlet in my house is powered or not... a kinda of fancy programmable socket, as well as a fully programmable thermostat that would use other sensor data to optimize the HVAC system. Anyway, to cut a long story short the X4 runs on Python and the plan was to develop Python scripts to achieve all our communications/control requirements. So I read a number of books on Python (Python: Visual Quickstart Guide, Python for Dummies, Programming in Python 3, Beginning Python Visualization, Rapid GUI Programming with Python and Qt).

Armed with these books I developed some simple scripts for the X4 to query a test modem and collect a bit of data. I also wrote some simple scripts to dump the data on Amazon's Simple DB, as my longer term vision has my local control system dumping sensor and network configuration data into SimpleDB so that remote control and monitoring software can be developed. Anyway, when trying to load my SimpleDB Python scripts onto the X4 I realized that the X4 has little or no support for the Python Standard Library, and that simple things were going to be rather more complicated on the X4. I haven't the time for such inefficiencies as this is all being done is spare time (and why would you consciously choose a setup that would force you to reinvent the wheel a hundred times over? Most issues that I expect to come up have already been solved by cleverer developers then me, and they have been kind enough to make their libraries available for free!), and decided to dump the X4 in favor of something that runs a full blown version of Python and perhaps a full operating system. I'd gotten to like Python so I decided to stay with it as my main development language.

Then Andy suggested I look at IronPython, i.e., Python that can make use of the .NET libraries. Given that I have done considerable development using .NET this got me excited. Then to further discover that IronPython was compatible with Mono was just too much to bear. I could develop my IronPython SES software on my Windows PC and it would most likely run on Linux (the OS of the PlugPC I plan to use to replace the X4) and Mac OSX... seems to good to be true... so the journey begins. First job: install all the relevant packages and run a few test cases to convince me that this might actually work!

2 comments:

  1. Do I understand you would have python running on the ConnectPort to collect the data from remote sensors, and another python program on the plugpc storing the data locally as well as on amazon?

    ReplyDelete
  2. Hi Topapilot

    Apologies for the very tardy response. I'm not using the ConnectPort at all. The plan is to only use the plugpc for all data collection and tool hosting.

    As it happens, as I more comfortable with VB, and that VB will run fine (mostly) on Linux (under Mono), I decided to move all my development over to VB to speed things up a little (have made lots and lots of progress that I need to write up when I get a chance).

    I'm also looking at alternative thin clients, one that runs Windows 7. The downside of W7 think clients is price (few hundred dollars vs. few tens of dollars), but for me, development is much much faster. I expect I will still port to something like the Marvel Sheevaplug too.

    Thanks for your interest, and I'll try to report some of my progress soon.

    Kurt

    ReplyDelete