Main

Development Archives

June 18, 2008

Mac Pro Optical Digital Audio Output and the Mute button

One of the great things about the new Mac Pro is its full size optical digital output, which feeds pure and clean digital audio to my receiver and on to the speakers in the office or main room. The downside of this is that the implementation is such that there is no master volume or mute capability; the optical out is a direct hard line out of whatever your apps hand it. Controlling volume with iTunes is no big deal, but it's really really annoying when you open a website with blaring loud awful music and have no way to quickly mute the sound. The best way I know is to open the System Prefs and change the audio output. So I figured what better time to hack a little AppleScript to at least automate the output switch.

I've only touched AppleScript on one other occasion, and I must say it's a bit of a mystery to me. It's sort of like the developers tried so hard to make the code like English that it turns into a confusing mess of pseudocode, and I've yet to find any comprehensive reference of what's possible in quick glances at what seems to be a maze of documentation. (Any pointers to such a reference would be much appreciated, BTW) But, there's always Google. To be fair, I've only spent a few moments with it and was able to figure out what I needed to make my mute button work, albeit with a big chunk of copy and paste from the O'Reilly Mac Devcenter blog.

So, without further ado, here's the code. You'll need to use AppleScript Utility (in /Applications/Applescript) to "Enable GUI Scripting" for this to work (the script will help you out with this if you haven't already done so). Use the Applescript Editor (also in /Applications/Applescript) to save the code (it seems to do some compilation in the process).

The long lines are hard to read here on the site, so the code is also available here.

(*
Modified from the script found at http://www.oreillynet.com/mac/blog/2006/07/applescript_audio_output_switc.html to
switch between Digital output and Internal speakers, to act as a mute when using Digital out
*)

(*
This script toggles between two audio outputs in the "Sound" pane in "System Preferences" and adjusts the volume. 
Modified from a script at http://forums.macosxhints.com/showthread.php?t=45384 
to add volume control and GUI scripting detection. --David Battino, www.batmosphere.com.

USES GUI SCRIPTING; "ENABLE ASSISTIVE DEVICES" OPTION MUST BE CHECKED IN THE "UNIVERSAL ACCESS" PREFERENCE PANE
*)

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events"
	if UI elements enabled then
		try
			tell application process "System Preferences"
				tell tab group 1 of window "Sound"
					click radio button "Output"
					if (selected of row 3 of table 1 of scroll area 1) then -- Digital out is selected
						set selected of row 1 of table 1 of scroll area 1 to true
						tell application "Finder"
							set volume 0
						end tell
					else
						set selected of row 3 of table 1 of scroll area 1 to true -- Internal speakers are selected
						tell application "Finder"
							set volume 2
						end tell
					end if
				end tell
			end tell
			tell application "System Preferences" to quit
		on error
			tell me to activate
			display dialog "Problem selecting audio device." buttons {"Whoops!"} default button 1
		end try
	else --GUI scripting is disabled
		tell application "System Preferences"
			activate
			set current pane to pane "com.apple.preference.universalaccess"
		end tell
		display dialog "Please check the box called \"Enable access for assistive devices.\"" buttons {"Okay"} with icon 1 default button 1
	end if
end tell

The script opens the System Preferences dialog, clicks on Sound, selects the Output tab, and toggles between outputs 1 and 3, which in my case are "Internal Speakers" and "Digital Out". When setting the output to the internal speakers it also sets the volume to 0 (mute). Perfect.

Now with a Quicksilver trigger, the script runs when I press F10 (in my case fn+F10, since I have the other special keys enabled) and mute is toggled. I also used the Quicksilver triggers and the iTunes plugin to map F11 and F12 to iTunes volume up and down. Not quite as nice as master volume + mute, but hey, it's digital to the amp — worth a little annoyance.

June 10, 2008

Multiple Database Connections in Ruby on Rails

I've been doing a lot of work in Ruby on Rails lately and absolutely love it. In the past few days I've needed to port an existing database over to a new schema for comparisons and benchmarking. It took a bit of digging to find what turned out to be a typical RoR (read: elegant) answer to the related problem of maintaining connections to multiple databases in Rails, so I thought I'd offer a link to Dr Nic here.

May 19, 2007

The ghost of Jimmy Kimmel...

...on the ORB!

Jimmy and his team were great. We shot a short interview which should air on Jimmy Kimmel Live! within the next couple of weeks. Jimmy said he "felt like the Mona Lisa" and that his mug on the ORB was "the most beautiful thing I've ever seen". MAKE!

May 14, 2007

En route.

This comes to you from a quiet hotel lounge on the east side of Denver on our way to the MAKE Magazine Maker Faire, where we will join some 400 makers (including a handful of ITP'ers such as Andrew Schneider, Team Botanicalls, Giana Gonzalez, Tom Igoe, and last but not least, FabInfo instructors Toru Hasegawa and Mark Collins) with ORB and ultraORB in hand and ready to exhibit. A few tens of thousands of attendees are expected of all ages and all walks of life and I'm expecting a fantastic time sharing our work with the curious as well as exploring the rest of the exhibits. I'm also slated to give a talk/demo on Thursday's Maker Day, a day of events held specifically for the exhibitors and other presenters and organizers.

Maker Faire is held at the San Mateo Fairgrounds in San Mateo California and is open to the public on May 19-20. Advance tickets are $15 for adults, $10 for students 21 and under, and $5 for children 12 and under ($20/$15/$5 respectively on-site). Hope to see you there.

May 8, 2007

One final ITP all nighter

Just for old times' sake...

May 6, 2007

ultraORB Thesis Presentation

The presentation of the ultraORB at ITP Thesis week is now online and can be streamed here or downloaded here. I'm working now to improve the programming, moving toward displaying controlled geometric objects Tuesday and Wednesday at the ITP Spring Show.

May 3, 2007

Double spin (1/2).

Moving forward — a quick spin with one of the two boards. Now on to connect the brushes to power up the other half. More later...

May 2, 2007

Goodnight

The initial mockup. Time for bed.

May 1, 2007

Lights.

LEDs are soldered and testing is underway. There are a few minor bugs to tweak out with the lighting and then it's on to full assembly and programming. The color balance is a bit askew, but that's an issue for another day. 48 hours to go...

April 30, 2007

12.5%

Here's a view of 1/8th of the final assembly with LEDs in place. 280 LEDs to go.

Resting atop the PCB is the CNC machined aluminum board mount, holding in the foreground one of the four DC-DC stepdown converters from short-circuit.com. The board mount is topped by the three conductor commutator assembly, handmade from readily available materials and a few custom laser cut plexiglas spacers. The commutator mates with a set of brushes to deliver +15VDC, GND, and a timing signal from one of a pair of hall effect sensors mounted on the assembly rotating about the vertical axis (each quadrant of each PCB also has its own hall effect sensors to sense rotation about the horizontal axis).

April 29, 2007

ultraORB Concept Video

For those of you who haven't been following along with the in-person presentations, here's a little clip of video that was shot about a month and a half ago, showing the ultraORB concept in action. This is a demo and concept test with 4 single-color LEDs — the version due to be presented this coming week will have a total of 320 tri-color LEDs under microprocessor control to create a truly three dimensional persistence of vision display.

April 15, 2007

The view from the solder station

After a couple of days of intense soldering, the first major task is complete. The 960 0201 LEDs are all in place. It's funny, after two days of work, the boards look almost entirely the same to the naked eye. While I can barely focus on the screen to write this (seriously — now I understand what it's like to need glasses, if thankfully temporarily), the upside is that after soldering almost 1k 0201 parts, the 0402 package parts look like bricks and are easier than ever to handle. In any case, I'm here to say that it is very possible to hand solder 0201 parts. Time to go clear the head and get ready for another day of soldering tomorrow. In the meantime, here's the view from the soldering station:

April 14, 2007

Convert .bin + .cue -> .iso on Mac OSX

I had a need recently to convert a .bin/.cue CD Image pair to .iso for mounting on OSX. I was considering writing a quick utility to handle the task, but in the process of researching the file formats, I found BinChunker, a GPL-licensed piece of code that does exactly what I need, simply and directly. The official site has the source code and RedHat RPM's, but if you are on OSX, I did a quick compile of the latest version which you can download here.

Once you download the utility, issue this command from a shell prompt in the directory where you downloaded the file:

sudo cp bchunk /usr/bin/

This will copy the file into a location where the system can find it at will (a.k.a. the path). Then, to convert a .bin/.cue pair to a .iso, you can issue this command:

bchunk myinputfile.bin myinputfile.cue myoutputfile

Short, sweet, and simple — and lightweight too, weighing in at only 20k.

UPDATE: As commenter Frederik has pointed out, this can give a permission denied error if your user account does not have execute permissions on the file. Execute this command after copying the file to /usr/bin/ to solve this problem:

sudo chmod a+x /usr/bin/bchunk

If you are getting a not found error, make sure that /usr/bin/ is in your path. To check this, type echo $PATH and look for /usr/bin/ in the result. If it isn't there, type sudo nano /etc/profile and add /usr/bin; to the PATH=... line. Then press CTRL+x followed by Y to confirm and the enter key to verify the filename to save and exit nano. Then execute source /etc/profile to refresh the path.

April 12, 2007

Wuhan Direct

The circuit boards are here, having made the trip from the GoldPhoenix fab in Wuhan, China to Manhattan in about 36 hours. The parts are here, a day early in typical DigiKey fashion. Now it's time to start burning some flux. Before I do, though, here are a couple of quick photos from the unpacking process.


The virgin board. I have a pair of these to solder, with at a guess maybe 3-4k SMD pads each. It looks like I won't be seeing much daylight for the next week or two.


If you've ever wondered what $2k in DigiKey parts looks like, wonder no more. Not all that impressive on the surface, eh?

April 8, 2007

Forward Progress

Finally there is some positive progress to report on the latest ORB. The circuit boards have been designed and ordered (thanks, as usual, to Shane @ GoldPhoenix) and the CNC milled aluminum circuit board supports are completed and in hand. Many thanks to David Gotter (bio) and Rob Klaus of D&R Machine for their excellent work and patience in helping me through my first design for CNC fabrication. Check out David's other project, Further OPTIONS developing "innovative vehicle entry systems for wheelchair-bound individuals". D&R offers extremely capable and affordable machining services and is open for long-distance business via Internet and mail order. Contact them for your next project.

I'm also very excited to say that this piece has become a three-generation project. In addition to my collaborator and father, Ron Sears, my grandfather Jim McCoy is contributing his masterful woodworking and finishing skills to this project. Everything is in line for a beautiful piece.

This week, my biggest test thus far will begin: a massive soldering undertaking centering around 320 surface mount RGB LEDs, and a matching 960 resistors in 0201 packages. That's 0.024" x 0.012" for those of you keeping score at home. In addition, the design utilizes sixteen 80-pin PIC microcontrollers and a slew of other circuitry. If I can still focus my eyes well enough to see the audience at thesis week, I'll call it a victory. Starting later this week, when the parts and boards arrive, I'll be posting photos and possibly video of the assembly process right here on this blog.

For now though, here's a peek at one of the pair of aluminum board mounts fabricated at D&R Machine. There's much, much more to come, culminating in an initial exhibition at the ITP Thesis Week and Spring Show, on May 3 and May 8-9, respectively.

March 19, 2007

Maybe the best reason to boot Windows

One of the technological highlights of TED was Microsoft's Photosynth. A way of mapping user-submitted photos to 3D models as a novel way of photo-mapping the world, it was absolutely stunning. The demo, linked above, runs in IE or Firefox, but only on Windows, but it's worth the trouble, both as an actual experience and as a hint of what's to come. The presenters had a great attitude regarding the common anti-MS sentiment of the world ("Who would ever have thought that there would be a Microsoft talk at a session called 'Simplicity'?"), and once they started showing their work, they clearly had no reason for concern. Take a look for yourself and be impressed.

Vista on the MacBook Pro

I recently came across a gifted copy of Windows Vista Ultimate. As it turns out, I needed a copy of Windows for some CAD work on my MacBook Pro, so I figured I'd give it a shot. Vista isn't officially supported by Apple's Boot Camp, but after a bit of Googling, it seemed relatively safe, so I continued.

Installation was flawless. I inserted the Vista CD when Boot Camp asked for XP, and everything proceeded smoothly. It is a big installation though, consuming almost half of the 20GB I allotted to it. I followed these instructions to get the Apple drivers installed (not seamless, but it works) and everything is up and running.

I've only been using it for a few days, but all in all, I'm rather impressed. As a relatively recent Windows to OSX convert, the interface isn't so bad. I still prefer the Mac in terms of usability, but I have to admit, Vista is sort of pretty. It is hard though to miss the tail chasing that's going on here by Microsoft. The new Windows menu file system layout is oddly reminiscent of Finder. Even one of the bundled screensavers is a pretty apparent clone of the default OSX saver. The new desktop modules basically put Dashboard on the desktop, and the new Aero window management features add some 3D eye candy to Expose, albeit at the expense of hot corners — not a good tradeoff for my habits, but admittedly pretty. It almost makes me wonder, do the Windows designers run OSX at home? Either way, to me, a little more Apple flavor in Windows is a welcome addition, but not necessarily a source of honor and pride for Microsoft.

IE7 also copies its killer app from Safari: both are best used to download FireFox. IE7 does have one nice feature that I've noticed in the few minutes I've used it though: you can spawn a new tab by clicking a little stub button on the tab bar. A nice feature, although this Firefox extension does the trick as well.

Performance-wise, I'm satisfied. The new visual effects run smoothly on the MBP, although it should — the Pro has an ATI Radeon X1600 GPU with 256MB of dedicated graphics RAM. CAD apps possibly marginally less snappy than with a barren XP install, but all in all very usable, even in cases where the apps aren't officially Vista-rated.

I first installed Vista under Parallels in Mac OSX. This worked, but in the interest of saving space and not having redundant installs, I deleted the image to install it in a separate Boot Camp partition. After doing this, I found that the current version of Parallels doesn't support booting from a Vista Boot Camp partition. I'm looking forward to this feature, as it's nice to be able to quickly jump into Windows, but have the option for a full boot for more demanding apps like 3D CAD.

Would I pay $400 for Vista Ultimate? Probably not, unless I absolutely had to use a Windows-only application. It's nice, but so is OSX and for that matter Ubuntu, given enough patience and skill in setup and configuration. That leads to what is, for me, really the biggest problem with Windows these days: I miss the UNIX console. Having to download a separate ssh client and install my own scp seems completely unreasonable, especially considering the 9GB+ install footprint with everything but the kitchen sink (and UNIX terminal standards) thrown in.

I look forward to the day when Ubuntu and other Linux distros truly reach consumer-ready status, and that day is coming. Even today though, it blows my mind to see kiosks proudly displaying the blue screen of death. I would never pay thousands of dollars for Windows licenses for something like subway car displays or even Times Square signage when the simple GUI and configuration arguments should realistically be thrown out the window, much like they are in most of the web servers of the world, in favor of reduced cost and increased stability.

To continue to thumb its nose at the Linux community's technology is Microsoft's mistake, and recently I've started to think it would be a fatal one. Vista continues Microsoft's commitment to this grand mistake, but also shows that they still have some fight to bring to the ring.

March 6, 2007

Everything old is new again

Maybe there's a correlation to the fact that I'm not a big Twitter fan and the fact that never in my life have I used wall. And that, on the other hand, find / | grep is always right at my fingertips.

From 'sfearthquakes' on Twitter: By Marc Hedlund

One of my favorite business model suggestions for entrepreneurs is, find an old UNIX command that hasn't yet been implemented on the web, and fix that. talk and finger became ICQ, LISTSERV became Yahoo! Groups, ls became (the original) Yahoo!, find and grep became Google, rn became Bloglines, pine became Gmail, mount is becoming S3, and bash is becoming Yahoo! Pipes. I didn't get until tonight that Twitter is wall for the web. I love that.

(Via O'Reilly Radar.)

February 20, 2007

DigiKey OpenSearch Plugin

I was doing the first of many parts orders from DigiKey, a massive online supplier of electronic components, for the semester, and finally decided to make an OpenSearch plugin for Firefox. This lets you search for DigiKey parts from the search bar in the upper-right corner of OpenSearch compatible browsers. I've only tested this in Firefox 2.0.0.1, and I'm pretty sure that it won't work in IE7 (surprise!) because IE7 doesn't support POST requests for OpenSearch plugins. Get Firefox.

Install this plugin now or view the XML.

The format for creating these plugins is a very straightforward XML file. You can find the docs on how to create your own on developer.mozilla.org.

NOTE: This plugin is in no way supported by the Digi-Key corporation. Please do not bother them with help requests if it doesn't work properly (probably because you are running IE). Contact the author with any questions or problems - at which time I will probably just tell you to Get Firefox.

January 30, 2007

ssh/scp Login Without Password

I'd been wanting to figure this out for awhile, and yesterday finally took a few minutes to dig up the answer, which I found most clearly stated here by Mathias Kettner.

If you want to be able to login to multiple machines, you still only have to do the first step once. After you've created the public and private key files once, you can copy the same public key to each server using the steps that follow.

NOTE: I've slightly modified these directions from Mathias' copy to be more pertinent to the specific case of a local copy of Mac OSX connecting to remote servers, but the resulting commands are identical.

First open a terminal session on your Mac and generate a pair of authentication keys. Do not enter a passphrase:

your-computer:~> ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A


Now use ssh to create a directory ~/.ssh as user myusername on myserver.com. (The directory may already exist, which is fine):

your-computer:~> ssh myusername@myserver.com mkdir -p .ssh

myusername@myserver.com's password:


Finally append your new public key to myusername@myserver.com:.ssh/authorized_keys and enter myusername's password one last time:

your-computer:~> cat .ssh/id_rsa.pub | ssh myusername@myservername.com 'cat >> .ssh/authorized_keys'

myusername@myservername.com's password:


From now on you can log into myservername.com as myusername from your terminal without a password:

your-computer:~> ssh myusername@myservername.com

myservername:~>


January 29, 2007

Filesystem Sharing Between OSX and Ubuntu

As an update to my last post regarding my hpmount debacle, I've found a pretty good solution for my problem. I've got a dual-boot Ubuntu/Windows desktop, which I almost always run in Ubuntu, a MacBookPro running OSX, and a LaCie external USB hard disk. I want to be able to share the disk across computers without the 4GB file size limitation of FAT32 and would ideally keep the disk running HFS+ since it is primarily to be used for my Mac. Windows compatibility would be a nice bonus, but isn't really a priority.

The simple answer is this. The disk can be formatted in HFS+, but journaling has to be disabled for Ubuntu to mount it read/write. This seems to be actually doable safely on the fly, such that the disk could normally be used journaled, as long as journaling is disabled prior to attempting to write to it from Ubuntu. This can be done from the command line as follows:

sudo /usr/sbin/diskutil disableJournal /Volumes/MyDisk

for a volume named MyDisk

After mounting and working with the disk normally in Ubuntu, journaling can be reenabled in on the Mac as follows:

sudo /usr/sbin/diskutil enableJournal /Volumes/MyDisk

Info found in the Apple docs.

hpmount, du, and df

After trashing the HFS+ partition on my brand new (but loaded with important data, of course) LaCie USB hard disk by trying to mount it read/write in Ubuntu with hpmount so I could copy my music folder without having to go over the network (my advice: pretend hpmount doesn't exist), I was pleased to find that I could at least mount it read only in Ubuntu to save my data before reformatting the drive. This was after trying all of the OSX disk utility and fsck standard stuff to no avail.

To make a long story somewhat shorter, in the process of copying all the data off to my Ubuntu drive, I learned a few nice options of du and df, the unix disk usage and disk free space commands. The highlight for me is -h for human-readable. Here's the link to the rest.

Now I get to not only move the music folder over the network, but all the stuff that was originally on my removable drive. Fantastic.

January 22, 2007

Orb @ ITP

The Orb will be on display at ITP for the remainder of the Spring semester. Here are a few photos and a video of it in its new home.

Video (Quicktime, 1280x720, 98MB, 1:00) - Link

December 26, 2006

The Orb Makes the Virtual Rounds

Since the warm reception at the ITP Winter Show The Orb has been getting a good amount of attention around the blogosphere. Here are some of the mentions of which I'm aware (in rough order of appearance):

keeyool.com
MAKE Magazine
Hack A Day
notcot
Core77
Gizmodo
TodayNow
Ize.hu (can anyone translate?)
An Unreasonable Man

It's also been YouTubed (thanks to MaximusNYC):

December 17, 2006

Sneak Preview

With 7 hours and change to spare, the Orb is ready for showtime...

December 3, 2006

Illustrations for the New York Times published today


View the interactive version.

The illustrations I did for the New York Times in collaboration with Lisa Strausfeld of Pentagram were published in today's edition of the New York Times magazine. The illustrations, created in Processing, are the result of a physics-based model of keywords connected by springs. The strength of the virtual spring connecting a pair of keywords together is dependent upon their rate of cooccurrence on the Internet, a measure of their degree of relationship to each other. In addition to the three tiles shown above which are featured in the online version of the article, the cover of the magazine and the following pages of the print article all feature different views of the model.

Similar views, populated with data collected from internal networks, could be used by intelligence agencies in their efforts to determine terms that are interconnected and being discussed by diverse and disconnected agents.

The article also begins with an interview with ITP's Matthew Burton.

December 1, 2006

GumSpots - Live from Copenhagen


Today, tomorrow, and Sunday we are presenting GSPS from the ITP Fall 2005 show at Nordic Exceptional Trendshop at ITU in Copenhagen, Denmark.

This is my first trip to Europe and after taking a few hours yesterday to explore a bit on foot, I'm struck with the beauty and friendliness of Copenhagen — a truly wonderful city. The same goes for everyone involved from the university and especially the people of Innovation Lab who have been most welcoming and helpful.

November 18, 2006

Orb: First glimpses

I'm back in St. Louis (Jersevyille actually) and just got to see the frame for the Orb for the first time about an hour ago. It looks fantastic. Here are a couple of photos. I can't wait to start putting the pieces together. The red and amber streaks are just a pair of LEDs rotating on the frame in 3D space. 64 tri-colors addressing somewhere between 16k and 32k points in space should be pretty mindblowing.

P1000312sm.jpg

P1000311sm.jpg

November 12, 2006

OrbPCB

The PCBs for the 3D spherical display are in, and here's a sneak preview of the beginning stages of assembly:

As I get farther into the assembly process (the entire system will use four identical copies of this board) I will attempt to get some action photos detailing my surface mount soldering process. This is my first time soldering a .5mm pitch QFP package (the PIC18LF8722) and I was pleased to find that it wasn't bad at all. The only remaining question mark then is the 8CASON package of the 64Mbit Atmel flash memory (shown at left upside-down next to its final home). It fits an SOIC-8 footprint, but with no width to spare, and it is a leadless package, so there is no pad or lead for me to solder with my iron. I'm optimistic about soldering it with ITP's rumored hot air station, so hopefully tomorrow you will be seeing photos of at least one fully completed board and one smiling student, and maybe a hot-air soldering tutorial from a rookie's perspective.

Otherwise, all is proceeding well. Here's a preview shot of the fantastic frame and support mechanism that my father is currently crafting for the project. This photo is a few days old, and the piece is coming along great. We should be starting to put all the pieces together within the next few weeks. Stay tuned...

Update:

I should also mention that I am trying Kester 331 Water Clean flux and the matching solder for the first time and it is incredible. At the first impression at least, soldering is just as easy as with the standard 44 flux/solder that I have been using for years, but the flux residue comes off the boards with a hot water rinse almost instantly. It's far easier to clean 331 with hot water than it is to clean 44 with acetone and alcohol, and obviously much more appropriate to do so in my apartment. I highly recommend it. Of course it is still leaded solder, so don't forget to wash your hands.

November 5, 2006

PCB Tools Overview

Michael Ang and I are teaching a DriveBy at ITP on Monday the 13th about electronics without breadboards, which is to say PCB design, production, and surface mount soldering. In the meantime, I thought I'd give a quick overview of my toolchain from PCB design to production. More details to come, both at the DriveBy and on this site. But for now...

PCB Design

CadSoft Eagle (Mac version requires X11 from Apple)

The freeware version of this package lets you draw boards up to 4" x 3.2". It's a great package, with solid part libraries, and good functionality to easily add your own custom patterns. It's equally at home with surface mount or through-hole designs, and it's the tool we will focus on at the DriveBy.

There are a few quirks to the interface that take some getting used to. First, in order to act on a group defined by the Group tool, you need to right click. On the Mac, this is substituted with a command-click (Make sure 'Emulate three button mouse' is active in the X11 Preferences). So to move a group of items, group them with the Group tool, then switch to the Move tool, command-click, and you're off.

Secondly, the Copy tool oddly only works with single items. To copy a whole group, you first use the Group tool to select them, then switch to the Cut tool. Command-click (note that this doesn't cut in the sense that Windows users are used to, but actually is more like copy), and then switch to the Paste tool to lay down the copy.

The next stumbling block is getting your files exported in the right format to get PCBs manufactured. Virtually always this means Gerber files. Here is a good tutorial from SparkFun about this. For my recent project, a 3D dimensional spherical surface display (PCB shown at left), I actually used the .cam file from the tutorial to do my export. The job is still processing, so we'll see how it goes.

Panelizing Jobs

For my last few projects, I have used Gold Phoenix PCB for production, and have been very satisfied with the service. They can go down to 4 mil trace/space (for an extra fee), and also have cool extras like colored soldermask (also for an extra fee), and a good expedited service (also for an extra fee - surprise?).

The special at Gold Phoenix typically is for one board of around 1 square foot. This means that, since the free version of Eagle can't handle designs over about 3"x4", we need a way to combine multiple designs after the fact into one panel.

GerbMerge to the rescue. This is a Python app that takes the Gerber files exported from Eagle and combines them into a single design using random placement to find a near-optimal layout.

It requires mxBase 2.0.4 and SimpleParse to install. Once installed, you control it using a configuration text file, which you have to customize to the specifics of your project (filenames, number of copies of each board, etc.). There is a sample configuration file in the documentation that will help you get started. Here is mine from this last project, if it might help.

Viewing Gerbers

Finally, once your boards are designed and panelized, you will want to take one last look at your files to make sure that all is correct before sending them (and your money) off to have the PCBs fabricated. There are a number of ways to accomplish this, but my favorite of the moment is gerbv, an open source package created specifically for this task.

There is a Windows port linked from the SourceForge page, but for Mac, the easiest way to get it is through DarwinPorts. It grabbed a whole list of dependencies for me completely seamlessly. You will have to add /opt/local/bin to your path if it isn't already included, though.

When it is all installed you can run it with the files you want to see as command-line parameters, giving you a view of your output files like the one shown here.

More...

This skips about 99% of the process of designing a board, but hopefully will be helpful in getting some tools setup and being able to start playing. Again, the DriveBy on Monday the 13th will cover this and more in more detail, so come with your questions or feel free to post them in the comments to this entry.

October 18, 2006

The Musings of Paul Graham

I just came across an article by Paul Graham (who, among many other endeavors is a partner in Y Combinator) entitled How to Start a Startup. I was going to pull a few quotes and write an informative summary, but as it turned out I copied and pasted most of the article. So just go read it for yourself. Here's the intro to get you warmed up:

You need three things to create a successful startup: to start with good people, to make something customers actually want, and to spend as little money as possible. Most startups that fail do it because they fail at one of these. A startup that does all three will probably succeed.

And that's kind of exciting, when you think about it, because all three are doable. Hard, but doable. And since a startup that succeeds ordinarily makes its founders rich, that implies getting rich is doable too. Hard, but doable.

If there is one message I'd like to get across about startups, that's it. There is no magically difficult step that requires brilliance to solve.

October 17, 2006

Web 1.0 (beta), continued

Basic Description:

Nodes:

Microcontrollers (in this case PICs) programmed with identical code. Physicality (pin layouts, etc) may differ from node to node within certain restrictions.

Protocols:

The network uses the standard RS-232 serial protocol for data transfer, with the addition of a proprietary signaling system that uses the same wire to send ready-to-send, ready-to-receive, and receive-success messages. Each packet consists of the target node address, the address of the sending node, the hopcount, and a four byte payload.

Transport:

Data is transfered serially using a wired connection.

Addresses:

In the protocol, locations are specified by an eight bit address, allowing up to 255 nodes. In the current hardware implementation, however, the nodes are addressed at boot time by hard-wiring four pins of the microcontroller, thus limiting the network to the four low-order bits of the address, or 16 nodes.


Network Stack:

The stack for this implementation is very simple, as (using the Internet comparison) only levels up to and including the IP level of the stack are included. A TCP-like protocol could be constructed atop this stack, and then any desired application protocols further atop that protocol. As it stands, however, the network implements:

[End to end addressed packet transfer]
[RS-232 plus additional signaling]
[TTL logic I/O]


Visual Explanation:


Each processor in the video is connected to a set of three LEDs, enabling the viewer to see network traffic in process.

Red -> Node is transferring data
Yellow -> Node is receiving data
Green (in combination with Red or Yellow) -> Transfer / Receive succeeded
Blinking green and yellow -> Packet arrived at ultimate destination

Each node has a local address (in this case, 0-5). Each node can then send a packet of data to any other address in the network. The transport protocol is simple (and unreliable) and consists simply of handing the packet off to a random node, attempting first to connect to any node which is not the source of the data. Thus if node 0 sends a packet to node 4, if the packet is not addressed to node 4, node 4 will attempt to pass the packet on to any node connected to it that is not node 0. If this fails, it will pass the packet back to node 0.

The video shows 5 packets being sent from the lower right node of the network to the node in the upper left corner. This shows the variable routing and a few of the possible routes a packet can take in the process.

Full Description:

The network was designed to be a lowest common denominator of mesh network design - a basis for possible future development. As such, it is a success. With a limited number of nodes, packets move from point A to point B in a reasonable number of hops, but it is clear that a good deal more work would be in order to develop a scalable network.


Fig. 1 - Schematic of TX/RX circuit

The network consists of PIC microcontrollers communicating via RS-232 serial with the addition of the ability to use that same data line for signaling from the recipient both of ready to listen and data received signals. This is achieved using the circuit shown in Fig. 1. The transmit pin for each data line is connected via a resistor to a second pin of the microcontroller which is configured as an input. Then this second pin is connected to the receive pin of the remote device. Then when a node wants to transmit, it asserts its TX pin high, which also raises TXACK and RX to high through the resistor. Then, assuming the there is a remote device connected that is not busy and sees the signal, it asserts its RX pin low, which pulls the TXACK pin on the transmitting device low as well (the resistor prevents an over-current between the two driven outputs). The transmitting device sees this ready signal, waits a specified small amount of time for the receiver to enter listening mode and then sends the data. After the data is sent a similar exchange takes place to confirm receipt.

Routing takes place via an extremely simple protocol. Each device can be connect to as many as three other devices. These connections are sensed each time a packet is sensed via the protocol described above. When a packet originates, it is sent randomly to one of the three possible connections or the first one that successfully receives it. If the packet is not at its ultimate destination, it is forwarded to another random node, with precedence given to nodes that are not the node from which it was received. This prevents two node looping. Even this one simple rule provides an enormous reduction in hop count over a purely random scheme and creates a somewhat usable, if poorly scaling, network.


Fig. 2 - Probabilty calculations for arrival in 5 hops or less across 6 nodes

As you can see in Fig. 2, for one particular simple six node topology, the probability of a packet arriving from one extreme of the network to the other in 5 hops or less (without making a loop) is 75%. In Fig. 3, two nodes are added, and while the similar case (no loop) entails only one more hop, delivery only succeeds within six hops 56% of the time.


Fig 3. - Probabilty calculations for arrival in 6 hops or less across 8 nodes

On the other hand, in the six node example, by tolerating a single loop which allows up to 9 hops, the probability of success increases to 93.75%, which can be seen in Fig. 4. Analysis of the eight node example quickly becomes difficult because of the greater number of combinations of loops, but it seems that allowing one loop (up to around 12 hops) increases its chances of success to around 78%. Time permitting, computer simulation would allow a better analysis of larger networks of this type.


Fig 4. - Probabilty calculations for arrival in 12 hops or less across 8 nodes

I did not have a specific numeric estimate of performance prior to construction and analysis, but the six node network performs somewhat better than I expected and the eight node network somewhat worse. This horrendous scaling could be improved with a topological shift to a small world system, where a number of these meshes could be connected together via specifically designated router nodes with the address space configured such that it can be deduced from the address whether a packet should stay within a subnet or propagate onward to another. The relative success of the mesh with small-scale networks suggests that this could be a workable solution, although the benefits over a more standard non-mesh topology are dubious given the rudimentary routing system.

The routing system itself could be improved if the size of each subnet remained relatively small by implementing a backpropagation system, wherein each packet was tagged with the address of each node through which it passed. Upon receipt of the packet, this information could be sent back to each of the nodes that were involved in the original transaction, and the hopcount of the outbound and inbound packets could be compared with any hopcounts of previous steps that were stored in memory to, over time, find an optimal next hop to reach any node in the network. This activity may need to be limited in order to balance the risk of flooding the network with optimization messages with the desire to adapt quickly to changes in topology.

After this first foray into mesh networking, I must say that I am pleased at the results of the basic implementation and would like to spend more time in the future to investigate and experiment with various learning schemes that could improve performance and scalability.

October 12, 2006

jumpWORD.com on O'Reilly Radar

Last week, jumpWORD.com, the site I worked on for much of the summer, was featured on O'Reilly Radar:

Jumpword is a powerful set of tools for use with your phone. I really like the strong tie-in to the web. They are currently working to make the modules MySpace compliant (the script tags cause them to be blocked). They also aim to provide you with more control over the look of the modules -- a necessary improvement.

I think that most people will not grok how to use these tools or how to set them up on the Jumpword website. I think that Jumpword is going to have to build some applications with their tools or get more games to use them (or become the next MySpace fad!). They are still looking for business models, but are currently considering offering the service to corporations in need of a mobile toolkit for events.

Read the full post on radar.oreilly.com

August 21, 2006

jumpWORD devBlog

Today marks the beginning of the jumpWORD developer blog, a site for updates and discussion about all the services we are building at jumpWORD.com. Bookmark it or subscribe to the Atom feed to keep up to date with the rapid development of the newest platform for distributing content targeted at and coming from mobile devices.

August 20, 2006

lastFM Artist Cloud

I just finished a perl script, based on a script by Adriaan Tijsseling, that grabs from the Recently Played feed (mine was empty) to create a cloud of artists from last.FM's XML feed of most played artists. You can see the script in action at the bottom of the right hand sidebar of this page.

You can get the script here. You will have to rename the file with a .pl extension, change 'relevante' (my username) to your lastFM username, change the user agent on line 3, set your domain on line 4, and set the file path on line 5 to point to an appropriate directory on your server. Then run the script on a cronjob and include the output file in your blog or webpage (if you are using PHP, you can use <?php include("/path/to/thefile.txt"); ?>). Then everyone can see all the crappy music you REALLY listen to.

Ubuntu Dual-display with an Apple Cinema Display

A few days ago I switched my PC to Ubuntu Linux. It's a slick distro - very easy to install and pretty out of the box. After a little poking around in the xorg.conf file, I was able to get a Cinema Display and an old Dell CRT working together in a nice dual monitor setup with a dual-head ATI Radeon 8500 graphics card. Here's the xorg.conf.

I also found a nice page about theming Ubuntu to look like Mac OSX. Pretty.

Finally, I wanted to set the box up as an AFP server so I could easily access fileshares from my MacBook. There's an open source project called Netatalk that does just that. However the binary version that installs using Ubuntu's apt-get lacks the authentication mechanism required to allow logins (it worked but only with guest access). Here's a thread from the Ubuntu forums that details how to download and compile the correct version from source code.

August 12, 2006

jumpWORD.com

My latest project has been working with Ta-Da Inc. to develop, among other things, jumpWORD.com which has just reached alpha. jumpWORD is a platform for distribution and exchange of content targeted at mobile phones. There are easy tools to get your content to users' phones as well as from your phone to the web.

Here's one of my photographs formatted as a mobile phone wallpaper in a jDeliver module and published to the web. This can be updated from my email or phone at will and accessed from your phone, by sending a text message or email to relevante.asdf@jumpword.com. Try it out and create your own jumpwords free at jumpWORD.com.

April 11, 2006

Northern Lights Demo Applet

For Living Art and Nature of Code, I am working on a simulation of the Northern Lights with Anne Hong for an art piece (introduced in this post) by my father, Ron Sears. I have mocked up software using Java and the Processing libraries to start experimenting with algorithms to control the light. The applet is based upon a simulation of 32 fixed color high-output LEDs arranged on 4 PCBs that will be mounted behind a large plexiglass lens inside a frosted streetlight globe (simulated with a gaussian blur in the applet), and uses a combination of trig functions with varying relative phase to approximate the dancing effect of the Northern Lights.
The code has been developed with portability to PIC C in mind, using lookups into a 1024 point quarter-wave 8-bit rectified sine table instead of real-time trig computation in order to save processor time with the intention that the simulation can run along with interleaved 32 channel PWM control on a single PIC18F4520 running at 40MHz.

View the applet.

April 1, 2006

Google Image Writer

Spells out a phrase using the most relevant images on the web (according to Google Images). You might be amused or you might learn a little something about the culture of the web.
Try it here or
View previous queries
Digg it.

March 28, 2006

Processing in Eclipse

Processing is great as a library but the development environment leaves a bit to be desired. Features like auto-complete, real-time error detection as you type, a fully featured debugger and the like can save immense amounts of time and frustration. For this, the free, open-source Eclipse can come to the rescue. With a bit of setup, you can be on your way to the best of both worlds in no time.

Setup

Environment

  • Auto-complete
  • Error detection
  • Error correction

Debugger

  • Debug Perspective
  • Breakpoint
  • Step Into/Over

Export

  • FatJar
  • HTML Example
  • Java Version Settings

CVS

  • Repository Info
  • Share Project
  • Download Project
  • Commit (Save) / Update (Load)

March 14, 2006

Chaos -- Distributed Computing

I just released my new distributed application for chaos research for my NIME musical instrument at http://grid.jamesnsears.com/

Even a low res scan of suspected areas of initial interest of the 6-dimensional parameter space involves some 546875000000000 data points, so download the app and start contributing to the future of chaos in music today.

Click here for more information on the Chua project as a whole.

February 22, 2006

Attack!

3D life sim applet using rule based particle system to model carnivorous behavior. View the applet.

February 7, 2006

Attraction3D

Expanded last weeks Attraction applet into 3D. (view applet)

January 30, 2006

Simulating the Auroras - UCalgary Research

This work from the University of Calgary outlines a scientific approach for simulating the visuals of the Aurora Borealis. It is too computationally intense to run on PIC hardware, but the procedure can probably be simplified somewhat or else possibly it can run on an embedded PC system that talks to a PIC which controls the LED drivers. In any case the site, and particularly this Technical Report, is a good starting point and source of info about the simulation.

Simulated Aurora
Simultated images of Aurora Borealis

Attraction

For this week's Nature of Code assignment I am working on an applet called Attraction, a simple simulation of forces of attraction. Each type of object is attracted to objects of the other type and repelled from its own type. By clicking the mouse in the applet, you can reseed the world with a new random population.

I am considering the idea of expanding and adapting the simulation to be a visualization of genetic algorithms in action. Each being's size and attractive force would then become proportional to its fitness ratio so the user can see the evolution taking place, possibly clicking or mousing over to see details of the available solution. The forces would likely be manipulated somewhat to encourage more diversity in the breeding process. More to come...(maybe).

January 23, 2006

Modeling Chaos with Iterative Simulation

Chua Oscillator Applet (requires the JSyn browser plugin)
Previous Chua Work (includes video, photos of circuit, etc.)

Analog Chua Attractor X-Y plot of one of the Chua Attractors, created with analog circuitry

Perhaps the first tenet of chaos theory is that complex behavior need not arise from a complex source. More specifically, systems of relatively simple differential equations, impossible to solve classically, can be iterated in software or hardware to bring to life their nuanced behavior.

In my previous work, I used an analog circuit to solve Chua's equations, using the output as audio to act as a synthesizer for music and sound design work. I am currently investigating new interfaces for this system to make it more playable. My first vision is to track both of the users hands in three dimensions and to use each hand-dimension as a control input, allowing six parameters to be controlled simultaneously. In order to simplify the design, I intend to first realize the actual chaotic synthesis system in software, using iterative solutions, because achieving the finely-grained control of circuit parameters under microcontroller control necessary in the analog circuit will be a quite difficult problem in and of itself.

I am currently experimenting in Java and Processing with software realizations of Chua's equations and also intend to investigate the usability of other similar systems of equations. The screenshot below is from a first generation Processing applet, available here (requires the JSyn browser plugin). Move the mouse around to change parameters and control the system. If it runs out of bounds or stops, click the mouse button to reset it.


Digital Chua Attractor
X-Y plot of one of the Chua Attractors, created with Processing (applet) (code)

December 24, 2005

About Me

Me at ITP Winter Show 2005

Welcome. I have started this site for myself and others as a memoir of my trip through life and, for now, the Interactive Telecommunications Program experience and as a place to log the ideas and thoughts that otherwise seem to slip away. I look forward to comments and criticisms, helping and being helped, and whatever else comes my way. Life is good.


Contact me.

View my resume.

GSPS: GumSpots Positioning System

GSPS: GumSpots Positioning System

GSPS: GumSpots Positioning System is a project I worked on last semester with Jason Kaufman, also of the Interactive Telecommunications Program. Utilizing image recognition and pattern matching techniques, we use patterns of gumspots to determine the position and orientation of a user, who submits an image from a camera-enabled mobile phone.In addition to being exhibited in ITP's 2005 Winter Show, the project was featured in Engadget as well as a number of other technology sources.


Developed in Java using Eclipse.


Music

Where am I?

Recent Photos

Powered by
Movable Type 3.35