Archive for the 'Computing' Category

Police Scanner and GNURadio

Sunday, November 9th, 2008

Keeping and eye on the police has never been so much fun! Recently, my friend John lent me his USRP, allowing me to play with GNURadio. From wikipedia:

The Universal Software Radio Peripheral (USRP) is a high-speed USB-based board for making software radios.

USRP

GNURadio is a free software, software radio. Essentially, the USRP allows you to tune or transmit any radio signal, given the correct tuner/transmitter attachment. Currently it is anything in the 0-5.9Ghz range. The USRP John lent me came with a FM/TV tuner — meaning I can listen to anything between 80Mhz and 800Mhz.

What exists between 80Mhz and 800Mhz? Lots of stuff! For example, normal FM radio is between ~87Mhz - 108Mhz, all of which can be demodulated using GNURadio. Also, analog TV transmits in that range, allowing you to watch or listen to any of that on your computer.

But! It gets even more interesting. For instance, San Jose International Flight Control exists around 124Mhz (although, I have not heard much there…). Or, you can even listen to Police Central at 460.4Mhz. Listening to the police has been pretty fun. So far, Sam and I heard about a stabbing at a local restaurant, and plenty of phone number / license plate checks.

Anyway, so far I have not done much hacking on the device — there are a lot of example applications to do the FM demodulation. The one thing I did figure out was now to remove the FM static when the channel is not in use. It took me awhile to figure out, mainly because I did not know the correct terminology. Turns out, the term is “squelch“, and gnuradio implements a block to do this. All I had to do was create a squelch handling block, put it as part of the rest of the processing chain. Looks something like this (inside the usrp_wfm_rcv.py example program):

squelch = gr.simple_squelch_cc(0, 5e-3)

Then add the squelch to the rest of the connect chain:

self.connect(self.u, squelch, chan_filt...

This thing is super cool — and I’m excited to see what else I can make it do.

Videobooth shell script

Thursday, October 23rd, 2008

Just a quick note to point out my, now open sourced, videostrip generator.

My dream goal would be able to generate these using a webapp and then let the site grow. I originally implemented a flash recorder, but now my flash trial has expired and I am unable to continue messing with it. Guess that means it is time to start hacking on a firefox-addon/ogv/icecast stack to replace the existing flash-plugin/flv/flash-server stack! It’s 2008, why is flash still the only solution for streaming video out to the web??

Makers Faire timelapse, using CHDK and mencoder

Wednesday, October 22nd, 2008

Last weekend I went to Austin, TX, for the Makers Faire. There, Pat, David, and I make a crap load of custom ice cream scoops. The process involved filling a dixie cup with whatever ingredients you wanted, including fun stuff like chayanne pepper and BBQ sauce (some people made normal ice cream, too), and then instantly freezing it with liquid nitrogen. The kids loved it!

Just as a note, this was a promotion for Pat’s just published book, the Hungry Scientist Handbook. The book is meant for foodie/geeky types — I’d definitely check it out if you self identify with either of those groups.

Anyway, I made a timelapse of the setup. Here, you can see us getting ready and serving for about half a day (then my battery died).

After discovering CHDK, I’ve started messing with timelapses. Here is how I created the above timelapse:

  • Installed CHDK on my Camera
  • Added this script to my CHDK/SCRIPTS directory
  • Set it to take a picture every 15 seconds, and run it until the battery runs out
  • Copied all the resulting photos off my SD card into a folder on my computer
  • Ran the following command (requires mplayer): mencoder "mf://*.JPG" -vf scale=640:480 -o timelapse.avi -of lavf -ovc lavc -lavcopts vcodec=mjpeg -lavfopts format=avi
  • And tada! You now have timelapse.avi.

Videobooth project

Tuesday, October 14th, 2008

I’ve been casually hacking on a videobooth project that will generate videostrips (analogous to photobooth and printing photo strips). Here are the full results of the free culture conference, where I got to test the system out last weekend. Check it out at, videobooth.me/fc2008/.

Eye-fi Video Support using CHDK

Thursday, September 11th, 2008

Yesterday I demoed this to the team at Eye-fi, and they said I was the first person to show them video sent over wireless from a consumer camera (+eye-fi). One of the first implementations of wireless video on consumer cameras, I’m pretty stoked! It means you can use your cheap Canon camera to auto post data to youtube, or some other video sharing service.

If you are not familiar with Eye-fi, it is a special SD card that allows you to upload photos over wireless as you take them. It does not, however, upload videos as you take them. This is because it only looks for valid JPGs. I was able to achieve video uploading by creating a spoofed JPG with CHDK that embedded the video. Eye-fi uploaded the JPG, then the AVI was decoded client side.

To use this, you will need to make sure your camera is supported by CHDK (see table on the homepage). I’ve posted the patch over on the CHDK forums. You can get a built firmware for my camera (SD700IS) here.

Building a personal favicon collection, or Running 16×16 locally, or an AppEngine Tutorial

Sunday, May 18th, 2008

The favicoop (my site running 16×16) has completely exceeded my expectations. With only ~75 add-on users, we are quickly approaching 10,000 hashably unique favicons in the collection. I think this is the largest favicon collection on the internet.

While this project has a lot to do with collecting favicons, I was mainly motivated to build it to learn about various technologies. It’s built with many Google services (AppEngine, code hosting, groups, hosted apps, analytics, etc). I’m pretty sure it is the only tool on AppEngine app that integrates with a Firefox add-on — even serving add-on updates. It is a great tool if you want to learn about AppEngine, Firefox add-on integration, and all the free Google services. To top things off, it can all be ran locally with the AppEngine SDK — so you can learn about these tools too!

With that, if you’re interested in collecting favicons you browse AND learning about how to run an AppEngine app — continue reading!

Step 0: Background

I assume you know how to install things on your computer, including add-ons, handle a few basic shell commands, and use SVN.

Step 1: Download stuff

You will need to grab three things, the Google AppEngine SDK, the 16×16 sources, and the packaged add-on. To grab the SDK, visit http://code.google.com/p/googleappengine/. Note: it requires python2.5. On OSX 10.4, I had to install that manually.

After you download/install the SDK, grab my sources from here:

svn checkout http://16x16.googlecode.com/svn/trunk/ 16x16-read-only

Last, you need to install the add-on. Do this by dragging this link to the URL bar (Firefox 3 only).

If you did all that, you should have everything you need to get started.

Step 2: Local environment tweaks

You will need to do some house-keeping to get things working on localhost. First, lets update the add-on upload-uri pref. This will cause the add-on to send your favicons to localhost. Hit about:config and modify the extensions.favicon.upload-uri pref. The pref should be changed to:

http://localhost:8080/send/

Next, cd into the app/ directory (of the svn repo) and copy the settings.py.dist to settings.py.

cd app/
cp settings.py.dist settings.py

Now we need to modify the app slightly to display images off of localhost — and not the production favicoop. In templates/index.html, find the line that reads:

// for running locally
// var domains = ['localhost:8080'];

Uncomment the var domains line, so it reads:

// for running locally
var domains = ['localhost:8080'];

This will cause the javascript to load the images locally.

Step 3: Launch the development environment

To launch the development environment, run the following command from the app/ directory.

python2.5 /usr/local/bin/dev_appserver.py ../app/ # you may have to modify this a bit for your SDK install

Now try hitting http://localhost:8080/. If you see “(error)”, browse to a few different websites (non-https) to load up some favicons into the collection. A good way to test is to bounce back and forth between tabs with favicons, as the add-on will send the favicon every time.

dev_appserver.py should spit out some debugging information. For instance, when a favicon is sent from the add-on to the server, you should see a request like this:

INFO 2008-05-19 04:05:48,967 dev_appserver.py] "POST /send/ HTTP/1.1" 200 -

Note the 200 status code, that means it worked! If it is returning 500, that means something is messed up. The dev_appserver.py should spit out the errors to help with debugging.

That’s it!

Refresh localhost a few times to see the new favicons being added to the collection as you browse. If you’re able to get it up and running locally, please let me know!

If you have any questions/comments, feel free to mail the shiny new discussion list. If you encounter any bugs, please let me know here, and if you are really interested — commits are here, and bugmail is here.

Side Project Conference?

Wednesday, May 14th, 2008

Wouldn’t it be neat if there was a conference dedicated to everyone’s side projects? Bring in speakers to talk about the stuff they work on in their free time. There would definitely be some interesting projects… hmm…

Favicon Collective breaks 500 favicons!

Monday, April 14th, 2008

Woohoo! After my last post, and a few additional users, we now have over 500 unique favicons in the favicon collection. I think if we can push through 1000 favicons, we will have the largest favicon collection on the internet.

If you would like to help add to the collection, install the Firefox 3 add-on.

This project has been a good skill-set tester… as it has required me to hack in Javascript/XUL, Firefox 3 apis (devmo++), google app engine, python, and django. If you find any bugs while interacting with this sausage factory, please be sure to file a bug on my google code project.

Help me create a huge favicon collection

Wednesday, April 9th, 2008

I really like favicons. So, I created a Firefox 3 add-on that sends all my favicons to a web service. Then, the stars aligned, and google released app engine. Now we’re enabled to collect all the favicons in the world. But I cannot do it alone, I need your help.

You can see the progress here. If you want to add favicons that you encounter (in Firefox 3), please see this page.

The add-on is alpha alpha alpha, so please let me know if you run into any issues.

Explaining Creative Commons

Tuesday, September 18th, 2007

On my way to Japan I was trying to explain creative commons to the person sitting next to me. My approach involved explaining the notion of “all rights reserved”, and then the licenses that CC offers. I think he got the idea, but it was convoluted and confusing.

Today, I was reading an editorial by Joi Ito (coincidently about recent events in Japan), and noticed how they explain CC: Creative Commons, a nonprofit group that develops flexible copyright arrangements.

That works too!