Failed experiments and bad code for physical computing, data visualization and video delivery.

Bluetooth + GPS + Python + ActionScript - Part 2 - Hooking Up

Posted: November 6th, 2008 | Author: Barton | Filed under: AS3, Bluetooth, GPS, Physical Computing, Python, Twisted | Tags: | No Comments »

Overview

After having built the hardware in Part 1, it is fairly useless without a way to get the GPS data from the device somewhere else in order to do something useful with it.  For this project, the end result will be a visualization of the GPS data in Flash Player on a Mac.  There are myriad ways to accomplish this, however very few approaches can easily encapsulate all of these steps in a single language.  This is because both low-level system access (to read the serial data) and some sort of server (to serve the data to Flash Player) are required.  While it is definitely possible to use any number of other languages such as Java, Processing, C++, etc., performing all of these tasks with those languages would require significant amounts of code.

With that said, I opted for Python not only because I love it, but also because it is quite straightforward to use it to read from a serial port using the pyserial module and also to establish any number of different types of servers including standard HTTP and socket servers.  While there are built-in libraries for creating and managing servers, I ultimately decided on creating a socket server using Twisted.  Twisted is an enormously powerful networking framework that simplifies the creation of all sorts of servers.

Why add another framework when a standard HTTP server would suffice for serving up data to the Flash Player?  The implementation of a standard HTTP server would require Flash Player polling the service to determine if data had been updated.  So, rather than rely on that sub-par solution, Twisted makes the creation of socket servers very easy, which then allows the Flash Player to receive data in real-time via an XMLSocket connection.  Not only that, but one of the coolest aspects of Twisted is that it makes it fairly easy to write multi-user socket servers, which will be a nice addition for future enhancements

Here is what the overall system architecture ends up looking like when all of that is considered:

However, before diving into these details, the first step is to hook up the device to the Mac via a serial Bluetooth connection and verifying that everything is working so far.

Read the rest of this entry »


Thanks for all the Fish

Posted: July 24th, 2008 | Author: Barton | Filed under: Uncategorized | 2 Comments »

I greatly appreciate everyone’s comments and input on my article on Bluetooth and GPS
.  It is quite nice to have the exposure from Make and also to have one’s efforts peer reviewed as it leads to productive introspection around one’s work.

Allow me to respond to those who took the time to comment on my little project:

To Tam, David and Snoopy:
No, I didn’t actually short out the entire board by connecting VCC+ and GND.  That is a mistake in my first attempt to draw out a schematic in Illustrator.  So to those that are copying this project word-for-word - please don’t follow the diagram exactly.  I’ll update it in the next couple of days when I have a chance.  As an aside, I’d be curious to hear from others about what they use for drawing circuit diagrams.  I just use Illustrator because that’s what I know from my days long past as a designer.

To Siftah and Arto:
What I’ve done is most definitely available as a commercial product and most likely for less than I invested in the various components.  However, I just happen to be a nerd and am quite interested in learning from products and devices that may exist for an equal or greater price.

Because I cobbled my project together from off-the-shelf components, I can continually break down and re-combine any of the components I utilized into more-and-more interesting and complicated projects.  With a consumer product, I would be beholden to whatever the particular manufacturer of that consumer product dictated the functionality of a given device to be.

Additionally, while I’m not entirely familiar with what is on the market with regards to Bluetooth GPS devices, it’s much cooler, in my opinion, to be able to do whatever I want with the IMEA codes that I ingest and store from a piece of hardware via my own drivers and software as compared with what a GPS hardware/software vendor happens to expose via a crippled API in response to what their marketing team thinks that I might be interested in doing with said data that I collected via blood, sweat and tears on the trail.  Isn’t that why we all read and love Make?

Birds have dominated the sky since the day that they evolved to become flying creatures.  However, since man has gazed upon them, we have looked to them for  inspiration and in envy, often (unsuccessfully) invoking their form in an attempt to share the currents and soar above.  So, while I could theoretically transmute into a bird (or purchase one) to create an exact replica of something that already exists, by creating a reasonable facsimile I can learn how exactly it works, improve upon it and have fun doing it.


Bluetooth + GPS + ActionScript - Part 1 - Hardware

Posted: March 16th, 2008 | Author: Barton | Filed under: AS3, Bluetooth, GPS, Physical Computing | 19 Comments »

Overview
For this project, my goal was to get GPS data into my Mac for some visualization experiments with ActionScript. After some initial prototypes that worked well using an RS232-to-USB converter, I decided that wasn’t slick enough and had it too many wires. I like things nice and clean around my desk, so I opted for adding Bluetooth in place of a USB converter.

After experimenting with some different methods, some using microprocessors and some not, I opted for the simpler route, eliminating the microprocessor. A microprocessor doesn’t add anything other than cost for the basic purpose of this project. Although stay tuned for another posting about integrating a similar configuration with the Make Controller and Arduino microprocessors.


Read the rest of this entry »


Remount an External Hard Drive in Leopard

Posted: March 14th, 2008 | Author: Barton | Filed under: General Technology, leopard | No Comments »

This may seem like a fairly outlandish edge case for external hard drives, but it’s one that I’ve run recently. Suppose you have an external Firewire drive connected to your MacBook Pro and then daisy-chained via Firewire to that, you have several more Firewire drives. Then suppose you’ve accidentally ejected that first drive that everything else is daisy-chained to. Then suppose that you’re currently in the middle of a render to one of the other down-stream drives and really need some files off of the drive that was unmounted. That removes the possibility of physically disconnecting the first drive to then reconnecting it to remount it, since the act of disconnecting would fubar the render.

Read the rest of this entry »


Arithmetik Garden

Posted: October 29th, 2007 | Author: Barton | Filed under: RFID | 1 Comment »

I just returned from a trip to Japan and while in Tokyo I attended an exhibition at the Mori Art Museum that was simply amazing. The show was called Roppongi Crossing 2007: Future Beats in Japanese Contemporary Art and overall the artists that participated were fantastic, with most of them creating pieces specifically for the show. However, the exhibition included one piece in particular that stands out as the best artistic use of RFID that I have seen.

Read the rest of this entry »


Flex 3 + AIR + RFID + AMFPHP + SMS

Posted: October 13th, 2007 | Author: Barton | Filed under: AIR, AS3, Flex, RFID, Web Services | 5 Comments »

I had originally wanted to build this project with my Parallax RFID reader, but since I can’t interface it with the Make Controller until Liam at MakingThings fixes the serial BLOB implementation fixed in mchelper 2.0, I decided to complete a proof-of-concept with a Phidgets RFID reader. The application is pretty straightforward - it consists of an RFID tag embedded in a cell phone that is read for its unique ID, prompts a user to enter some data and then remembers their personal data when they return. While the premise is simple, there are a few moving parts required to stitch it together.

Read the rest of this entry »


Make Controller, mchelper 2.0 and /serial/ Issues

Posted: October 2nd, 2007 | Author: Barton | Filed under: GPS, Make Controller | No Comments »

I’ve been attempting to hook up a serial GPS device to my Make Controller and read in data using OSC commands from mchelper prior to interfacing it with AS3 (as an aside, it’s really nice to be able to do this with the new version of mchelper). While I’ve been able to write to the serial port successfully using both /serial/char and /serial/block, reading from it always yields some sort of disaster.
Read the rest of this entry »


Starting Over with the Make Controller + AS3 - Part 1

Posted: September 8th, 2007 | Author: Barton | Filed under: AS3, Make Controller | 1 Comment »

MakingThings just released a bunch of software updates involved with Flash and the Make Controller that nullifies a lot of my previous work with AS3 and flosc. While some of the components still seem a bit buggy, they represent some major improvements. The best news to come out of this round of releases is that the flosc socket server can now be ditched (sorry, Ben Chun) in favor of connecting to the Make Controller using a new version of mchelper. Additionally it is now possible, from Flash, to connect to a board using either USB or Ethernet. As a result, I’m starting my series over to take these latest developments into account.
Read the rest of this entry »


Flex 2 and WSDL Overloading

Posted: August 21st, 2007 | Author: Barton | Filed under: Flex, Web Services | No Comments »

On a project that I am currently working on, the team was having some issues consuming JBoss SOAP services. The root of the problem took a while to figure out, as apparently there are very few people that try to consume SOAP services experience the same issue we were encountering and The Google revealed few clues. At first we thought that perhaps the difference was between WSDL 1.1 and WSDL 2.0 and Flex’s lack of support for WSDL 2.0, as that is what the SOAP services were generating. After some initial investigation, we thought we eliminated that as a possibility. Then we discovered that the WSDL that we were consuming contained overloaded methods. Some reinvestigation at the W3C was done to see if perhaps a difference between the WSDL 1.1 or 2.0 specifications was support for WSDL overloading. It turns out the the specs are silent on this issue, so again we eliminated the difference in WSDL versions. Some additional searching after that determined that Flex definitely lacks support for WSDL overloading.
Read the rest of this entry »


AS3 + Make Controller Important Update (AKA Not Part 5)

Posted: August 20th, 2007 | Author: Barton | Filed under: AS3, Make Controller | 8 Comments »

As those of you that have been reading along with the series might extrapolate, this post is supposed to be Part 5. However, given some things that I’ve discovered in the Fwiidom AS3 implementation as well as some issues in the MakingThings AS2 classes, which I then ported to AS3 and in the process propogated those bugs, this is now an update on some progress made with some collaboration and refactoring.

Read the rest of this entry »