Skip to content

Running Puredata on the Raspberry Pi

2012 June 1
by Tedb0t

I’m thrilled to say that today I succeeded in getting Puredata running on my Raspberry Pi. Here’s how!

First, follow this guide to get your Pi set up for the first time.  Make sure your Pi is connected to the internet, and now we can install Puredata.  We’ll start with Vanilla, since pd-extended is not maintained for ARM (as far as I can tell).  I’ll explore getting pd-extended working in a future post (hopefully very soon).

sudo apt-get update
sudo apt-get install puredata

Easy. What’s not easy is getting sound working. This took me about half the day but here’s what worked:

sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835

Note that the modprobe line needs to be run every time the Pi is booted, so you can add it to an .rc file if you want.  Now connect some speakers, turn them down for safety, and run this to make sure sound works:

sudo aplay /usr/share/sounds/alsa/Front_Center.wav

If it works, good! You can now run a Pd patch like so:

pd -nogui -noadc -alsa testPatch.pd

For convenience, here’s my test patch (testPatch.pd) that outputs an LFO’d sine wave. *Important!* Notice in the patch that the loadbang is delayed by 100ms! This is deliberate to avoid a bug in Pd regarding ALSA.

Please let me know if this worked for you.  Happy hacking!  Next up, I’ll be trying to build Pd-extended and then tackling the Raspberry Pi’s General Purpose I/O.


You’ll notice that the sound quality out of the 1/8″ jack is messed up in some cases (most in my experience).  I’ve heard from various sources that the R-Pi does not use a “real” DAC (Digital-to-Analog-Converter) and that you should get better sound from a USB adapter or from the HDMI output.  Still following up on this.

Getting Started with the Raspberry Pi

2012 June 1
by Tedb0t

The Raspberry Pi is a very low-cost, very small computer capable of running Linux that also provides GPIO (General Purpose Input/Output).  As such, it’s something of a hacker’s dream and there’s been a ton of buzz around it.  I ordered two a couple of months ago and just got them in.  Here’s what you need to get started. read more…

How to get the signal strength of 2 XBees in Processing

2012 May 24
by Tedb0t

I put together a little sketch here on Github that tells you the RSSI (Received Signal Strength Indicator) of a remote XBee in Processing.  All the instructions are there (and here); check it out and let me know what you think.  Post a comment with what you make! read more…

Solved: Mounting Synology DiskStation SMB Share from Ubuntu

2012 May 22
Comments Off on Solved: Mounting Synology DiskStation SMB Share from Ubuntu
by Tedb0t

Today I received my brand new Synology DiskStation DS411 NAS and I was eager to start transferring files off my old Ubuntu server onto it.  I immediately ran into a problem with Ubuntu: though my DiskStation showed up in Network > Windows Shares, I got the dreaded “Unable to mount location: Failed to retrieve share list from server” message.  I hacked on this for the next hour and managed to successfully mount my DiskStation shares in Ubuntu. Read on! read more…

How I Got a Tornado App Running on Heroku in 10 Seconds

2012 April 26

I’d been wanting to try out Heroku and Tornado for a while, so why not try them together?  I found a nice starter repo by Mike Dory, co-author of the O’Reilly Tornado book, so I figured I’d use that.  I forked it and rearranged it a bit, and it worked perfectly!  Here’s what I did:

  1. I’m on a brand new computer, so I had to install some basic stuff first:
    1. Setuptools:
      sudo curl | sudo python
    2. PIP:
      sudo curl | sudo python
  2. Get the starter repo.
  3. Make a Heroku account if you don’t have one and set it up.
  4. Make runnable:
    chmod +x
  5. Run
  6. That should be it, and your Heroku app is live!

Let me know if this works for y’all!

How to Build clj-processing

2012 March 1
Comments Off on How to Build clj-processing
by Tedb0t

Recently I wrote up a tutorial on getting started programming Processing sketches in Clojure. The clj-processing bindings require a slightly involved build process, which I’m detailing here.  I have since created a quick-start project that contains the pre-built binary, so unless you want to build a newer version of the processing.core.jar library, you can use that.  So here’s how to build it. read more…

Getting Started with Clojure & Processing

2012 February 28
by Tedb0t

For the past little while here at the studio, there’s been a lot of buzz and conversation about Clojure, a modern LISP language that runs on the Java Virtual Machine.  It’s a fascinating language that can help anyone learn about functional programming.  There are a variety of interesting resources for learning Clojure, but I find it’s most fun when your code can make something happen on your screen instantly, like Processing does for Java.

As such, my friend Tims Gardner and I were talking about putting together a class on Clojure & Processing using Roland Sadowski’s clj-processing bindings and Arthur Edelstein’s Clooj IDE.  So, to make things as fast and easy as possible for people to get started, I made a Clooj/Processing Starter Project that you can download and start using right away!  Here’s what you need to do. read more…

Kitchen Table Coders in The Atlantic

2012 February 28
Comments Off on Kitchen Table Coders in The Atlantic
by Tedb0t

My studiomates and I do workshops most weekends on various (sometimes esoteric) coding and hacking subjects, and recently The Atlantic ran a story about us on their blog.

Awesome!  For more information on Kitchen Table Coders, check out our website and our EventBrite page.

Event: First Symposium on Research Art

2012 February 9
Comments Off on Event: First Symposium on Research Art
by Tedb0t

The New York Society for Research Art presents a gathering of artists, curators, gallerists and theorists to investigate and debate the role of scientific and technological experiment in contemporary art practice—when is an artwork a science project, and when is a science project an artwork?  Our guest speakers will present a variety of perspectives on the topic, ranging from historical to curatorial to practical to economical.  The talks will be followed by an open panel discussion to address and debate the presented ideas interactively with the audience.

The event is free and open to the public! Register on EventBrite (and please consider a donation!).  Also check out the Facebook Event.

Confirmed speakers include:

  • Georgia Krantz, Education Manager, Guggenheim
  • Kyle McDonald, Artist
  • Luther Davis, Artist
  • Keynote by Ted Hayes and Alex Dodge, Artists

Presenter Biographies:

Georgia Krantz works full-time as the Education Manager for Adult Interpretive Programs at the Guggenheim Museum.  She is an art historian with extensive teaching experience from Ancient to Contemporary Art.  She is Adjunct Professor at the New School as well as ITP, and lectures at the Guggenheim, the Museum of Modern Art and the International Center of Photography.  Over the past few years she has been involved in several outside projects including an NEA-funded educational website for the Rubin Museum of Himalayan Art, and Vital Visionaries, a study by the National Institute on Aging on the value of art for promoting intergenerational communication.  She has an MA in Art History (Northern Renaissance and Baroque Art), and is working on her Ph.D dissertation in Modern Art.

Kyle McDonald works with sounds and codes, exploring translation, contextualization, and similarity. With a background in philosophy and computer science, he strives to integrate intricate processes and structures with accessible, playful realizations that often have a do-it-yourself, open-source aesthetic.

Welcome Disqus Comments!

2012 January 15
tags: ,
by Tedb0t

I just implemented Disqus comments for the entire blog, which should make things a bit nicer, since there’s been a lot of discussion on some posts.  Let me know what you think!

Wireless Positioning & Location Awareness: An Overview

2011 December 21

For one of my major projects I’m tasked with figuring out how we can locate mobile wireless devices within a limited location, and it seems a lot of other people I’ve talked to are in the process of figuring out the same thing, so here’s an overview of what I’ve learned so far. read more…

Using the RN-XV WiFi Module as a Remote Switch

2011 December 20
by Tedb0t

It’s been a struggle, but I finally figured out how to use a Roving Networks RN-XV WiFi module as a remote switch.  It’s not hard now that I know how it works, but figuring out was quite difficult, as the manual is apparently incorrect and the firmware it shipped with was causing problems.  Read on for the solution!


Simple! Here’s all you need:

  • An XBee breakout board (so you can plug it into your breadboard)
  • An XBee Explorer (not necessary with ad-hoc mode, but I had one around so this tutorial will use it)
  • 3.3V regulator (ONLY—the module has a 10% tolerance, so anything beyond that will either not work or damage the module).
  • 10µF and 0.1µF capacitors for good measure (clean power is especially important when using radio devices)
  • Power and Ground (Pins 1 and 10, the top and bottom pins on the left side of the module)
  • An LED connected to pin 9.  In practice you’d want to put a current-limiting resistor on it, i.e. 220 ohms, but for a quick test it won’t matter.  The module only drives 8mA on this pin.
  • That’s it!
Although the module has an ad-hoc setup mode, where it broadcasts its own ad-hoc wifi network that you connect to with your computer, I found it faster to just plug it in directly to my computer using a serial adapter such as the XBee Explorer.  When you connect with ad-hoc mode, you talk to the module over telnet, when you use direct serial, you use a serial terminal such as CoolTerm, which the following instructions will use.
With your module plugged into USB, open up the port in CoolTerm.  You may see some data from the unit or a status message (it’s ok if you don’t).  Type $$$ (without hitting return) to enter command mode.  Now you can setup the module’s wifi settings (hit return after each command):
set wlan phrase <your wpa password>
set wlan ssid <your ssid>


The module will power-cycle and the green status LED will start blinking.  After 5-10 seconds it should start blinking more slowly, which indicates that it has successfully connected to your WiFi network.  If your terminal session is still open, you should see a status message that indicates its success and its IP address (which you’ll need soon).
Now we need to update the firmware.  Luckily, they made this extremely easy!  Just do this:
ftp u
And it will take care of the rest—connecting to the Roving Networks FTP server, downloading the newest firmware image and ‘installing’ it.
Once that’s done, you can transfer your module to your breadboard.  The rest of the work happens over telnet, so make sure your computer and module are connecting to the same WiFi network!  When the module is on your board and it’s joined your network, open a shell on your computer and do:
telnet <module's ip address> 2000
You should see a ‘*HELLO*’ message.  Congratulations!  Now you can talk to your breadboarded module from anywhere!  To switch the LED on and off, first set the I/O direction mask:
set sys mask 0x21f2
This adds GPIO (General-Purpose Input/Output) Pin 1 (hex 0x2) to the default mask, setting it as an output.  To switch it high, do:
set sys output 2 2
Similarly, to switch it low:
set sys output 0 2
And that’s it!  You can now, for instance, have a web server connect directly to that port and issue those commands dynamically to control your hardware remotely.  Try hooking up a relay to switch a house light!


Getting Started Developing with the WiMM One

2011 December 16
Comments Off on Getting Started Developing with the WiMM One
tags: ,
by Tedb0t
We just received a Developer Preview of the new WiMM One wearable touchscreen device, and dove into developing for it.  It runs Android so you have to get the Android SDK set up.  Here are our notes so far.
  1. Install Eclipse.  I had the “Galileo” version which I found out the hard way isn’t supported, so I downloaded the newest as of writing (“Indigo”).
  2. Install the Android SDK.
  3. Install the Android Developer Tools (ADT) plugin for Eclipse.
  4. Download the WiMM Android Add-On (make a free developer account first to get it).
  5. Put the WiMM Add-On folder in the add-ons folder in the Android SDK.
  6. Run the Android SDK Manager from Eclipse > Window.
  7. Select and install Android 2.1 (API 7) and the Android SDK Platform Tools.
  8. Make a WiMM Android Virtual Device with SD card 2 GiB and resolution 160×160.
  9. You can now make new projects that target the WiMM One Add-On.

Building and Running on the Emulator

  1. Open a terminal at [your-android-sdk]/add-ons/addon_wimm_one_7/tools and run ./emu.
  2. Wait for the emulator to boot up (it takes a minute).
  3. Hit “Run” in Eclipse.
    1. If you get an expired certificate error, look here.
  4. If you’re prompted to choose a device, choose the emulator.

Building and Running on the Device

  1. On your WiMM, go to Settings > Advanced and turn on “Allow USB debugging”
  2. Plug in your WiMM.
  3. Open a terminal at addon_wimm_one_7/tools and run ./android update adb.
  4. Go to addon_wimm_one_7/platform-tools and run ./adb kill-server and ./adb start-server.
  5. Now run ./adb devices and you should see your hardware device listed as well as any running emulators.
  6. Now when you run your app from Eclipse, you can choose your hardware device!

Getting started with the RN-XV WiFi Module & Node.js

2011 December 7

The RN-XV WiFi module is a nifty little WiFi module designed to fit the same pinout as an XBee, so it’s intended to be a drop-in replacement.

Tonight I whipped up a little test of the module to get a joystick to talk to a Node.js server over WiFi.  I attached +3V power and ground to the module (pins 1 and 10, respectively), pin 2 (TX) to Arduino digital pin 0 (RX), and pin 1 (RX) to Arduino digital pin 1 (TX).  That’s all the hardware setup you need.

I used this WiFly library to handle the connection.  All it does is talk to the WiFly module over serial and send control commands, so the library abstracts that a bit.  Here’s the Arduino sketch I built: read more…

PQLabs Multitouch Screen Not Working in Windows 7? Enable It

2011 November 21
Comments Off on PQLabs Multitouch Screen Not Working in Windows 7? Enable It
by Tedb0t

I just discovered that, in order to get a PQLabs Multitouch screen in Windows 7 to properly report multitouch events (to Adobe AIR/Flash, in my case), one must go to Settings > Pen and Touch, go to the Touch tab, and check “Enable multi-touch gestures and inking.”  Thanks, Windows. >:-|

Controlling Deluge Auto-Management and File Priorities via Python

2011 November 15
by Tedb0t

Today I was working away from my home file server which runs the BitTorrent server Deluge.  My Deluge Web UI stopped working for some reason (and it never worked that well in the first place) and I really needed to start a torrent at home.  Deluge has an “Auto Managed” feature that’s enabled by default, but since I seed a lot of torrents, it actually prevents a new torrent from starting to download automatically, so I have to disable that and the resume the torrent after adding it.  Thankfully Deluge has a Python client interface we can use to write our own scripts.

Here’s an example script that adds a URL from an argument with auto_managed turned off:

#!/usr/bin/env python
# encoding: utf-8

Starts a new Deluge torrent from a URL.

Created by Ted Hayes.


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

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

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


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

print "Using filename: %s" % filename

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

def added(s):
    print "Added status: ",s

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

def disconnect():
    print "disconnecting"

# We add the callback to the Deferred object we got from connect()

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

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

# Run the twisted main loop to make everything go

I still have to figure out how to then automatically resume the torrent.

Here are some helpful links:

UIClient Documentation

UIClient Example 




Tools for Disassembly and Reverse Engineering

2011 November 12
Comments Off on Tools for Disassembly and Reverse Engineering
by Tedb0t

Following Trammell Hudson’s excellent introductory workshop on assembly and reverse engineering, here are my notes on what I had to do to get things up and running.

I was doing this on my Ubuntu 10.04 Linode instance, and we were targetting ARM processors, so first I had to install the appropriate gcc toolchain.  I didn’t have add-apt-repository, so I had to install python-software properties first.  The last install is to get libc (stdio, etc).

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:linaro-maintainers/toolchain
sudo apt-get install gcc-4.5-arm-linux-gnueabi
sudo apt-get install libc6-armel-cross libc6-dev-armel-cross

Then I used these commands for compiling, disassembling and looking for interesting strings:

arm-linux-gnueabi-gcc-4.5 -O3 -c helloWorld.c
arm-linux-gnueabi-objdump -D helloWorld.o | less
strings -t x helloWorld.o

Eagle Error: old version of device set is not present in the new version of this device set.

2011 November 10
Comments Off on Eagle Error: old version of device set is not present in the new version of this device set.
by Tedb0t

Today I was attempting to paste parts of an Eagle schematic I found online into a new schematic, and I was getting the following error message:

Package variant PTH1 in the old version of device set RESISTOR is not present in the new version of this device set.

This is caused by a library in the original schematic having some different package definition than the library in the new schematic.  The fix is easy: In the original schematic, go to Library > Update All.  Then you can copy and paste without the error!

Arduino Serial.print sends numbers instead of letters

2011 October 11
tags: ,
by Tedb0t

Recently I experienced a somewhat baffling, unexpected problem. I was using a line like:


And getting a series of numbers like 25536 instead of the expected text. It turned out the problem was just the use of the ‘ instead of a “. Sigh.

AVRdude Verification Error Solution

2011 October 11
Comments Off on AVRdude Verification Error Solution
by Tedb0t

If you’ve been getting an Arduino error like this:

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0007
         0xff != 0x7f
avrdude: verification error; content mismatch

It may be as simple a fix as moving your USB cable from a hub directly to your computer—that fixed it for me!

More information: I had also been getting errors like this from avrdude:

avrdude: 2 retries during SPI command