<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Cutts: Gadgets, Google, and SEO &#187; Gadgets/Hack</title>
	<atom:link href="http://www.mattcutts.com/blog/type/gadgetshack/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattcutts.com/blog</link>
	<description>neat fun stuff</description>
	<lastBuildDate>Mon, 13 May 2013 16:17:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Playing with a USB Missile Launcher</title>
		<link>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/</link>
		<comments>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:45:43 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=4555</guid>
		<description><![CDATA[This is the last half-finished &#8220;hairball&#8221; blog post about USB devices on Linux. I actually did manage to get a working program that controlled a USB foam missile launcher. Unfortunately, I didn&#8217;t document all the steps, so this blog post just sort of stops at some point. I got a USB Missile Launcher for Christmas. [...]]]></description>
				<content:encoded><![CDATA[<p><em>This is the last half-finished &#8220;hairball&#8221; blog post about USB devices on Linux. I actually did manage to get a working program that controlled a USB foam missile launcher. Unfortunately, I didn&#8217;t document all the steps, so this blog post just sort of stops at some point.</em></p>
<p>I got a <a href="http://www.thinkgeek.com/interests/techies/8a0f/">USB Missile Launcher</a> for Christmas. The manufacturer, <a href="http://dreamcheeky.com/download-support">Dream Cheeky, provides software</a>&#8211;but only for Windows XP. And I thought to myself, &#8220;wouldn&#8217;t it be fun to practice some USB reverse engineering skills?&#8221; Because another Christmas present was a <a href="http://www.totalphase.com/products/">USB protocol analyzer</a> from Total Phase. I should note that <a href="http://code.google.com/p/pyrocket/">plenty of other people</a> have apparently already written drivers/<a href="http://sourceforge.net/projects/usblauncher/">software for USB missile launcher toys</a>, but I wanted to poke around myself.</p>
<p>Total Phase makes a high-speed <a href="http://www.totalphase.com/products/beagle_usb480/">USB 2.0 protocol analyzer</a> for $1200, or a regular-speed <a href="http://www.totalphase.com/products/beagle_usb12/">USB protocol analyzer</a> for $400. Here&#8217;s a trick someone mentioned: if you get the cheaper protocol analyzer and need to work with a high-speed USB device, you may be able to plug the high-speed device into a low-speed USB hub to slow the device down.</p>
<p>I decided to start with ladyada&#8217;s excellent guide to <a href="http://ladyada.net/learn/diykinect/">hacking a Kinect</a> by reverse engineering USB packets. So here&#8217;s what I did.</p>
<p>Step 1. Make sure the device works. It would suck to attempt to reverse engineer a broken device. I keep a Windows XP computer lying around, so I downloaded the <a href="http://dreamcheeky.com/download-support">software</a> for it, installed the program, and plugged in the USB rocket launcher. After the install, XP wanted to restart, so I restarted the XP computer (unplugging my USB rocket launcher after the computer was off), then started the rocket launcher software back up, then plugged in the USB device. Sure enough, everything worked fine. The controls are: pan left/right, tilt up/down, and fire. Tip: the rocket launcher uses bursts of air, so don&#8217;t jam the foam rockets down hard on the launcher.</p>
<p>Step 2. Probe the device. I plugged the USB rocket launcher into a Linux machine running Ubuntu 10.04 (Lucid Lynx). I ran the command <strong>sudo lsusb -vv</strong> and the relevant info from the list of USB devices on my system was this:</p>
<p><code></p>
<pre>
Bus 002 Device 045: ID 0a81:0701 Chesen Electronics Corp. USB Missile Launcher
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0a81 Chesen Electronics Corp.
  idProduct          0x0701 USB Missile Launcher
  bcdDevice            0.01
  iManufacturer           1 Dream Link
  iProduct                2 USB Missile Launcher v1.0
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              20
Device Status:     0x0000
  (Bus Powered)
</pre>
<p></code></p>
<p>Note that my Vendor ID = 0x0a81 and my Product ID = 0&#215;0701. Also note that bNumEndpoints = 1. An endpoint is a channel for USB data communication. Then we get the Endpoint info:</p>
<p><code></p>
<pre>
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              20
</pre>
<p></code></p>
<p>According to ladyada&#8217;s <a href="http://ladyada.net/learn/diykinect/">write-up</a>, the &#8220;IN&#8221; means that data goes IN to the computer from the device, and the &#8220;Interrupt&#8221; transfer type is good for sending large amounts of small data quickly (e.g. a USB mouse).</p>
<p>Step 3. Prepare your Linux system to talk to the device. First, let&#8217;s review ladyada&#8217;s steps, which is for Windows. She installs libusb-win32 and then runs a program called inf-wizard to make a driver shell. Then plugging the device into Windows will attach the LibUSB-win32 device driver. Next, she installed Python and PyUSB.</p>
<p>I wanted to stick with Linux. I didn&#8217;t need libusb-win32 or inf-wizard.exe, and I already had Python installed. So my next step was to <a href="http://sourceforge.net/projects/pyusb/">download PyUSB</a>, extract the zip into a directory, change into that directory, then run <code><strong>sudo python setup.py install</strong></code> in that directory to install PyUSB. Since you&#8217;re installing PyUSB system-wide, you do need to run that command with &#8220;sudo&#8221; to run it as root.</p>
<p>Step 4. Write a short program on your Linux machine to talk to the device. I made a file missile-launcher.py and executable access with &#8220;chmod ugo+rx missile-launcher.py&#8221; next. Here&#8217;s the short program I ended up with:</p>
<p><code></p>
<pre>
#!/usr/bin/python

import usb.core
import usb.util
import sys
 
# find our device
dev = usb.core.find(idVendor=0x0a81, idProduct=0x0701)
 
# was it found?
if dev is None:
    raise ValueError('Device not found')

# Linux kernel sets up a device driver for USB device, which you have
# to detach. Otherwise trying to interact with the device gives a
# 'Resource Busy' error.
try:
  dev.detach_kernel_driver(0)
except Exception, e:
  pass # already unregistered
 
# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()
 
print "all done"
</pre>
<p></code></p>
<p>Note that my &#8220;idVendor=0x0a81, idProduct=0&#215;0701&#8243; parameters use the values I found from lsusb -vv. If you compare against <a href="http://ladyada.net/learn/diykinect/">ladyada&#8217;s short program</a> you&#8217;ll notice one major difference. My code has these lines:</p>
<p><code></p>
<pre>
# Linux kernel sets up a device driver for USB device, which you have
# to detach. Otherwise trying to interact with the device gives a
# 'Resource Busy' error.
try:
  dev.detach_kernel_driver(0)
except Exception, e:
  pass # already unregistered
</pre>
<p></code></p>
<p>Ladyada&#8217;s PyUSB program for Windows didn&#8217;t have anything like that. But when I ran the program under Linux, I got the error message &#8220;usb.core.USBError: Resource busy&#8221;. It turns out that the Linux kernel tries to use a default kernel driver, and that prevents my program from talking to the device. Detaching the kernel driver lets me talk to the device just fine. I picked up this tip <a href="http://www.arcfn.com/2010/04/usb-panic-button-with-linux-and-python.html">Ken Shirriff&#8217;s post about a USB panic button with Linux and Python</a>. In theory you could also <a href="https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/288964">unbind the USB device from a command-line</a>, but I prefer to do it right in my PyUSB program directly.</p>
<p>Note that you will need to run the python program as root, e.g. &#8220;sudo ./missile-launcher.py&#8221; or else you&#8217;ll get a warning message like &#8220;usb.core.USBError: Access denied (insufficient permissions)&#8221;.</p>
<p>At this point, you have a small working program that opens up a connection to the USB rocket launcher. If the USB rocket launcher isn&#8217;t plugged in, you&#8217;ll get a &#8220;Device not found&#8221; error, and if the USB device is plugged in, you&#8217;ll get an &#8220;all done&#8221; message and the program exits gracefully.</p>
<p>Step 5: Try to read from the USB device. In ladyada&#8217;s guide, she tried sending 0b11000000 = 0xC0 (&#8220;Read Vendor data from Device&#8221;) to a Kinect. I got no response from that, but I did get a response sending 0b10000000. That corresponds to sending:<br />
- a &#8217;1&#8242; to read from the device<br />
- a message type of &#8217;00&#8242; = standard. Ladyada got a response sending to &#8217;10&#8242; = vendor<br />
- &#8217;000&#8242; (reserved bits, so always 0)<br />
- &#8217;00&#8242; to say the recipient of the message is the device.<br />
Then sending a request of 0 got back a result of two zero bytes:</p>
<p><code></p>
<pre>
bRequest  0
array('B', [0, 0])
</pre>
<p></code></p>
<p>Interestingly, running the same program again would get a &#8220;usb.core.USBError: Unknown error&#8221; response. At that point, I would unplug the USB device and then plug it back in to reset it. I didn&#8217;t get any other responses from trying to send message types of class or vendor (as opposed to standard), nor did I get any responses from try to send messages to the interface or endpoint (as opposed to the device). See <a href="http://ladyada.net/learn/diykinect/">ladyada&#8217;s guide</a> for more details about fuzzing the device and what all the various bit fields mean.</p>
<p>Step 6: Set up the Linux computer to use the Total Phase Beagle. The CD worked nicely with HTML documentation on it. First, you copy some udev rules so that the device is writable by anyone when the Beagle is plugged in:</p>
<p><code><br />
cd /media/Total\ Phase/drivers/linux/<br />
sudo cp 99-totalphase.rules /etc/udev/rules.d/<br />
sudo chmod 644 /etc/udev/rules.d/99-totalphase.rules<br />
</code></p>
<p>If you&#8217;ve already plugged in the Beagle, you&#8217;ll need to unplug it and plug it back in for these rules to fire. Next, you&#8217;ll need the Data Center software. You can get it off the CD, but I&#8217;d recommend downloading the <a href="http://www.totalphase.com/products/data_center/">latest software and user&#8217;s manual from the website</a> instead. My CD had software version 4.20 for example and the website was up to 5.01. Extract the software zip file (either from online or the CD). Then follow the directions in the <a href="http://www.totalphase.com/docs/data_center_man/contents/">online manual</a> (or user manual <a href="http://www.totalphase.com/download/pdf/data-center-v5.01.pdf">PDF</a>). The directions according to the manual are </p>
<ol>
<li>Install the USB drivers and Data Center software. Copying the udev rules is enough for USB drivers on Linux. Unpacking the zip is all you need for the Data Center software, because the executable is self-contained.</li>
<li>Plug the Beagle analyzer into the analysis machine. This was my Linux machine.</li>
<li>Plug the Beagle analyzer into the bus to be analyzed. In this case, this was my XP computer. Don&#8217;t plug the USB missile launcher in yet though.</li>
<li>Start the Data Center software. Run the program &#8220;Data Center&#8221; in the directory you extracted from the .zip file. Follow the rest of the instruction in the Quick Start section.</li>
</ol>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux USB device driver info</title>
		<link>http://www.mattcutts.com/blog/linux-usb-device-driver-info/</link>
		<comments>http://www.mattcutts.com/blog/linux-usb-device-driver-info/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:41:41 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=681</guid>
		<description><![CDATA[What, *another* half-finished blog post about Linux USB drivers? Yup. Suppose you have a device and want a Linux device driver for it. There are a few steps you&#8217;ll need to take. One of the heroes in this area is Greg Kroah-Hartman. Greg wrote USBView, which is a Linux tool to enumerate a list of [...]]]></description>
				<content:encoded><![CDATA[<p><em>What, *another* half-finished blog post about Linux USB drivers? Yup.</em></p>
<p>Suppose you have a device and want a Linux device driver for it. There are a few steps you&#8217;ll need to take. One of the heroes in this area is <a href="http://www.kroah.com/linux/">Greg Kroah-Hartman</a>. Greg wrote <a href="http://www.kroah.com/linux/usb/">USBView</a>, which is a Linux tool to enumerate a list of USB devices. He&#8217;s also done a massive amount of documentation as we&#8217;ll see below. One of his more eye-catching tricks is to walk a classroom through the process of <a href="http://www.kroah.com/log/diary/2005_11_17-tutorial.html">writing a Linux driver for a USB thermometer live and in real-time</a>. In addition to all the work he does for Linux in general, he recently announced a program to work with manufacturers and <a href="http://www.kroah.com/log/linux/free_drivers_faq.html">provide Linux drivers for new devices for free</a>. That&#8217;s right, manufacturers get a free driver. From the <a href="http://www.kroah.com/log/linux/free_drivers.html">original announcement</a>:</p>
<blockquote><p>
All that is needed is some kind of specification that describes how your device works, or the email address of an engineer that is willing to answer questions every once in a while. A few sample devices might be good to have so that debugging doesn&#8217;t have to be done by email, but if necessary, that can be done.</p>
<p>In return, you will receive a complete and working Linux driver that is added to the main Linux kernel source tree. The driver will be written by some of the members of the Linux kernel developer community (over 1500 strong and growing).
</p></blockquote>
<p>That is majorly good karma for Linux and Greg. But if you&#8217;re not a manufacturer, here are the steps that you&#8217;d look into.</p>
<p>1. Get documentation of the USB protocol, or reverse engineer the protocol. It&#8217;s far easier if you can get documentation of the protocol. If you do need to reverse engineer the USB protocol, here are some tools that might help:</p>
<p>Windows tools: <a href="http://www.wingmanteam.com/usbsnoopy/">USB Snoopy</a> let you do actions with your device and log the stream of USB information going downstream/outbound to the device, or upstream/inbound back to your computer. <a href="http://usbsnoop.sourceforge.net/">Snoopy Pro</a> is a variant of the same code that evidently has some improvements. It appears that the preferred location for Snoopy Pro is <a href="http://benoit.papillault.free.fr/usbsnoop/">here</a>.</p>
<p>Linux tools:<br />
- The previously mentioned <a href="http://www.kroah.com/linux/usb/">USBView</a> will show you devices that are currently plugged in.<br />
- The usbutils package includes a bunch of handy console tools for USB, including lsusb, which shows you the USB devices that are currently plugged in. The output of lsusb looks like this:</p>
<blockquote><p>
Bus 001 Device 006: ID 2222:3061 MacAlly<br />
Bus 001 Device 002: ID 0557:7000 ATEN International Co., Ltd<br />
Bus 001 Device 003: ID 045e:00db Microsoft Corp.
</p></blockquote>
<p>2. Write the driver.</p>
<p>- It seems that the process of writing drivers in Linux is getting easier over time. The <a href="http://www.linuxjournal.com/">Linux Journal</a> has documented this well. Compare this <a href="http://www.linuxjournal.com/article/4786">2001 article</a> by Greg Kroah-Hartman to Greg&#8217;s <a href="http://www.linuxjournal.com/article/7353">2004 article</a> on controlling a simple USB lamp device. Then see Greg&#8217;s follow-up article on <a href="http://www.linuxjournal.com/article/7466">writing a linux driver in user space</a>. It turns out that you can use the <a href="http://libusb.sourceforge.net/">libusb library</a> to read/write with USB devices without ever mucking around in the kernel. This is possible because Linux provides a USB filesystem (called USBFS) that automatically mounts USB devices into the Linux directory tree. Note that libusb also works on BSDs, Mac/OSX computers, and that there is a <a href="http://libusb-win32.sourceforge.net/">Windows libusb port</a>.</p>
<p>If you really want to delve into this deeply, there&#8217;s an O&#8217;Reilly book on <a href="http://www.oreilly.com/catalog/linuxdrive3/">Linux device drivers</a> that you can buy as well.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/linux-usb-device-driver-info/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/linux-usb-device-driver-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse engineering a Windows USB driver</title>
		<link>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/</link>
		<comments>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:35:54 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[How to]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=895</guid>
		<description><![CDATA[For a while, I was really into reverse-engineering USB drivers. Don&#8217;t ask why. The heart wants what the heart wants. I didn&#8217;t finish this &#8220;hairball&#8221; post, but it has some info in it that still might be good. I recently stumbled across this post and it inspired me. I decided to try to reverse engineer [...]]]></description>
				<content:encoded><![CDATA[<p><em>For a while, I was really into reverse-engineering USB drivers. Don&#8217;t ask why. The heart wants what the heart wants. I didn&#8217;t finish this &#8220;hairball&#8221; post, but it has some info in it that still might be good.</em></p>
<p>I recently stumbled across <a href="http://www.jespersaur.com/drupal/book/export/html/21">this post</a> and it inspired me. I decided to try to reverse engineer the USB protocol for my <a href="http://www.mattcutts.com/blog/my-favorite-pedometer-omron-hj-720itc/">Omron pedometer</a>, which can upload your step data, but only to a Windows computer.</p>
<p>There are two parts to writing a Linux driver for a new USB device: reverse-engineering the USB protocol, and writing the Linux program.</p>
<p><strong>Reverse-engineering the USB protocol</strong></p>
<p>Typically your problem is that a device only runs under Windows. Like it or not, that means that you&#8217;re going to need something that runs Windows. It can be a Windows computer, or you can get fancy and run Windows as a &#8220;guest&#8221; operating system using something like VMWare to do virtualization. That is, you&#8217;d install Linux, then install VMWare, then install Windows to run under VMWare. But let&#8217;s start simple.</p>
<p>Step 0. Find the Vendor ID and Product ID of your device</p>
<p>Every USB device should have a Vendor ID plus a Product ID (sometimes called a device ID) that identifies it. You&#8217;ll need to discover this information before you can talk to the device. I plugged my Omron pedometer into a linux machine and typed &#8220;lsusb&#8221;. You&#8217;ll get a lot of information back. I saw a line like</p>
<blockquote><p>Bus 002 Device 018: ID 0590:0028 Omron Corp.</p></blockquote>
<p>That tells me that the vendorid is hexadecimal value 0&#215;0590 (which is 1424 in decimal) and the productid is hex value 0&#215;0028 (which is 40 in decimal). For other operating systems, <a href="http://forum.insanelymac.com/index.php?showtopic=36764">this post</a> tells you how to find your vendor id and product id under Mac and Windows. For Windows XP, it looks like you can run &#8220;msinfo32.exe&#8221; and then look under &#8220;Components&#8221; and then &#8220;USB&#8221; and look for &#8220;VID_&#8221; (vendor id) and &#8220;PID_&#8221; (product id). </p>
<p><strong>1) The simple approach: a dedicated Windows computer</strong></p>
<p>In the beginning, it&#8217;s easiest to just use a Windows computer and run some software to sniff on the USB packets as they go back and forth. The wild part is that the best open-source/free program I found is five years old (<a href="http://sourceforge.net/projects/usbsnoop/">SnoopyPro</a>). It still worked fine on Windows XP though. SnoopyPro is the program you want. There&#8217;s a whole long history of how it forked from USBSnoopy (evidently also called &#8220;<a href="http://benoit.papillault.free.fr/usbsnoop/">sniff-bin</a>&#8220;), and there&#8217;s another program called <a href="http://www.pcausa.com/Utilities/UsbSnoop/default.htm">sniffusb</a> which is related but different (I think both sniffusb and SnoopyPro are forks off of the original USBSnoopy/sniff-bin program). It&#8217;s all very confusing. I went with SnoopyPro and it worked fine for me.</p>
<p>Further reading on SnoopyPro and related USB sniffer programs:<br />
<a href="http://sourceforge.net/docman/display_doc.php?docid=12578&#038;group_id=34567">Some documentation on how to use SnoopyPro</a><br />
If you&#8217;re willing to shell out for a book, it looks like <a href="http://books.google.com/books?id=OSnynlQrvVcC&#038;printsec=frontcover">USB Complete</a>, now in its third edition, is one of the best.<br />
<a href="http://www.piclist.com/techref/usbs.htm">http://www.piclist.com/techref/usbs.htm</a> &#8211; mentions all the different sniffers<br />
<a href="http://hackspire.unsads.com/USB_Protocol#USB_traffic_analysis">http://hackspire.unsads.com/USB_Protocol#USB_traffic_analysis</a> &#8211; talks about how to convert SnoopyPro (and SniffUsb) logs/traces into hexadecimal data.</p>
<p>Are there other options? Sure. <a href="http://www.hhdsoftware.com/Products/home/usb-monitor.html">USB Monitor</a> from HHD Software is $85 and runs on Windows. Or you could spend $850-950 to buy a <a href="http://www.beyondlogic.org/usb/protocolanalysers.htm">hardware USB protocol analyzer</a>. Since I have only a casual interest, that&#8217;s a bit steep for me.</p>
<p>One last option is to run Windows as a virtual &#8220;guest&#8221; on a Linux system running something like VMWare. VMWare can let programs interact with USB devices. As the virtual version Windows interacts with the USB device, the Linux computer gets to see everything that happens, because it sits between Windows and the USB device. In fact, Eric Preston <a href="http://linux.slashdot.org/article.pl?sid=06/07/24/2044227">presented</a> a <a href="http://www.linux.com/feature/55910">method</a> that could log all the the output of the Linux usbmon program as binary data. Eric changed usbmon to use relayfs so that large amounts of data could be quickly relayed from kernel space to user space, then wrote a user space program to dump that binary data to disk. Eric also wrote a dissector for ethereal so that he could view the USB data in real-time. Unfortunately the PDF of his slide presentation have disappeared from <a href="http://download.linuxmontreal.com/projects/usb/reveng/">http://download.linuxmontreal.com/projects/usb/reveng/</a> where they used to be. In fact, all of linuxmontreal.com appears to be gone now. <img src='http://www.mattcutts.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>By the way, Ethereal is now known as <a href="http://www.wireshark.org/">Wireshark</a>, and it is a protocol analyzer that runs on many platforms and apparently <a href="http://www.wireshark.org/docs/dfref/u/usb.html">supports USB traces</a>. It looks like <a href="http://www.wireshark.org/docs/relnotes/wireshark-0.99.4.html">Wireshark has supported USB</a> since version 0.99.4:</p>
<blockquote><p>
Wireshark now supports USB as a media type. If you&#8217;re running a Linux distribution with version 2.6.11 of the kernel or greater and you have the usbmon module enabled and  you have a recent CVS version of libpcap (post-0.9.5) installed you can also do live captures. More details can be found at the <a href="http://wiki.wireshark.org/CaptureSetup/USB">USB capture setup</a> page on the wiki.
</p></blockquote>
<p>Follow the link in the quote to find Wireshark&#8217;s <a href="http://wiki.wireshark.org/CaptureSetup/USB">USB wiki page</a>.</p>
<p>On Ubuntu 7.10 (Gutsy Gibbon), I was able to do <a href="http://hachoir.org/wiki/Canoscan5000F">these commands</a>:</p>
<blockquote><p>
sudo mount -t debugfs none_debugs /sys/kernel/debug<br />
sudo modprobe usbmon<br />
ls /sys/kernel/debug/usbmon<br />
0s  0t  0u  1s  1t  1u  2s  2t  2u
</p></blockquote>
<p>General USB Reading:<br />
<a href="http://www.beyondlogic.org/usbnutshell/usb4.htm">USB in a NutShell</a> is a pretty good overview of how USB communication goes.<br />
<a href="http://today.java.net/pub/a/today/2006/07/06/java-and-usb.html">This Java and USB tutorial</a> starts with a good overview of USB.<br />
This <a href="http://www.cs.indiana.edu/~bpisupat/work/usb.html">USB and Linux tutorial</a> starts to get into the nitty gritty of USB on Linux.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cheap internet-connected scale: Wii Balance Board + Linux</title>
		<link>http://www.mattcutts.com/blog/internet-connected-scale-wii-balance-board-linux/</link>
		<comments>http://www.mattcutts.com/blog/internet-connected-scale-wii-balance-board-linux/#comments</comments>
		<pubDate>Mon, 13 May 2013 04:47:21 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=2054</guid>
		<description><![CDATA[You can ignore this ancient &#8220;hairball&#8221; blog post. Gather round, kids, and witness this blog post from a time *before internet-connected scales*. That&#8217;s right. Back then, we had to hack our Wii balance boards to connect them to the internet. Of course now you can buy wifi-connected scales from Fitbit and Withings. But in a [...]]]></description>
				<content:encoded><![CDATA[<p><em>You can ignore this ancient &#8220;hairball&#8221; blog post. Gather round, kids, and witness this blog post from a time *before internet-connected scales*. That&#8217;s right. Back then, we had to hack our Wii balance boards to connect them to the internet. Of course now you can buy wifi-connected scales from <a href="http://www.fitbit.com/aria">Fitbit</a> and <a href="http://www.withings.com/en/scales">Withings</a>. But in a olden days, you had to hack something up or even write it down on paper!<br />
</em></p>
<p>You can easily make an internet-connected scale out of a Wii Balance Board and a Linux machine:</p>
<p><strong>First</strong>, find a Bluetooth dongle and <a href="http://www.mattcutts.com/blog/linux-wiimote-via-bluetooth/">configure your Linux machine to talk to the Wiimote</a>.</p>
<p><strong>Next</strong>, apply a few extra patches so that your <a href="http://www.mattcutts.com/blog/linux-wii-balanceboard/">Linux machine can talk to a Wii Balance Board</a>.</p>
<p><strong>Finally</strong>, use some Python code to <a href="http://www.mattcutts.com/blog/write-google-spreadsheet-from-python/">upload your weight to a Google Spreadsheet</a>.</p>
<p>If you&#8217;d like to hear me describe how to hook it everything together, you can <a href="http://www.kk.org/quantifiedself/2009/02/matt-cutts-hacks-his-wiifit-fo.php">watch me give a 7-8 minute talk about it</a> (more info in that post), or you can watch it here:</p>
<p><center><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3074842&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3074842&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"/></object></center></p>
<p>Special thanks to <a href="http://www.kk.org/">Kevin Kelly</a> and <a href="http://aether.com/">Gary Wolf</a> for kickstarting the <a href="http://www.quantifiedself.com/">Quantified</a> <a href="http://quantifiedself.wik.is/">Self</a> movement and encouraging me to talk about this project.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/internet-connected-scale-wii-balance-board-linux/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/internet-connected-scale-wii-balance-board-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wanted: bookmarks.html merging program</title>
		<link>http://www.mattcutts.com/blog/wanted-bookmarks-html-merging-program/</link>
		<comments>http://www.mattcutts.com/blog/wanted-bookmarks-html-merging-program/#comments</comments>
		<pubDate>Mon, 13 May 2013 04:41:07 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=1577</guid>
		<description><![CDATA[You can ignore this &#8220;hairball&#8221; blog post. This post dates back to a time when people actually curated, saved, and managed their bookmarks.html file. Then Google Chrome introduced the ability to save and sync all your bookmarks, extensions, etc. in the cloud. Now I sign in to Chrome and everything is synced in the cloud. [...]]]></description>
				<content:encoded><![CDATA[<p><em>You can ignore this &#8220;hairball&#8221; blog post. This post dates back to a time when people actually curated, saved, and managed their bookmarks.html file. Then Google Chrome introduced the ability to save and sync all your bookmarks, extensions, etc. in the cloud. Now I <a href="http://www.youtube.com/watch?v=hQuXxOBJwSg">sign in to Chrome</a> and everything is synced in the cloud.<br />
</em></p>
<p>Over the years, I&#8217;ve accumulated lots of bookmarks.html files. I&#8217;d love someone to write an <a href="http://code.google.com/appengine/">App Engine</a> program that would let you upload bookmarks.html files and would merge them all into one master file. After that, you could prune/remove useless bookmarks, especially any bookmark items that are installed by default on a new browser but are useless.</p>
<p><strong>Why do it on the Google App Engine?</strong></p>
<p>Because it would be an easy way to get started. Essentially you want to upload a small set of files to one web location from several different computers, and then do something interesting with that data. App Engine is perfect for that kind of thing.</p>
<p><strong>Can App Engine&#8217;s version of Python parse bookmarks.html files?</strong></p>
<p>The Mozilla/Firefox bookmarks.html file format is a little strange, but not too strange. I found a few programs to parse bookmarks.html files. For example, <a href="http://www-test.it.usyd.edu.au/~piers/index.cgi?Python">one fellow</a> wrote a Python program to <a href="http://www-test.it.usyd.edu.au/~piers/python/merge-bookmarks">merge bookmarks</a> using <a href="http://www.python.org/doc/2.5.2/lib/module-sgmllib.html">sgmllib</a>, which I&#8217;m guessing would work on App Engine.</p>
<p>Digging into it more, it looks like several people like <a href="http://www.crummy.com/software/BeautifulSoup/">Beautiful Soup</a> as a parser. First off, you can <a href="http://groups.google.com/group/google-appengine/browse_thread/thread/fab05a4f5a2d1cb8">download it as a single Python file</a> to work in App Engine. It also looks pretty easy to use. I like this short example of extracting favicons to .ico files <a href="http://www.gooli.org/blog/extracting-bookmark-icons-favicons-from-firefox/">from a bookmarks.html file using Beautiful Soup</a>. At least one other person has <a href="http://mail.python.org/pipermail/python-announce-list/2008-January/006360.html">released tools</a> to <a href="http://phd.pp.ru/Software/Python/#bookmarks_db">manipulate bookmarks.html files</a> with Beautiful Soup.</p>
<p><strong>Can you upload files to Google App Engine?</strong></p>
<p>Yes! There&#8217;s evidently <a href="http://code.google.com/p/googleappengine/issues/detail?id=78">a limit of 10MB on uploaded files</a>, but my biggest bookmark file was about 500K, and I suspect most people have much smaller bookmark files. <a href="http://stackoverflow.com/">Stack Overflow</a> has a good example of <a href="http://stackoverflow.com/questions/81451/upload-files-in-google-app-engine">file uploading in Google App Engine</a>, plus there&#8217;s <a href="http://code.google.com/appengine/docs/images/usingimages.html#Uploading">official examples</a> as well as <a href="http://groups.google.com/group/google-appengine/browse_thread/thread/f9d0f22d8de8c025/bba32165e308dd13">people helping other people</a> to the point of showing <a href="http://jarod-guestbook.appspot.com/files">live examples</a>.</p>
<p>Plus browsers are getting better about uploading files to the web easily. Google Chrome supports <a href="http://itscommonsensestupid.blogspot.com/2008/09/drag-and-drop-files-in-google-chrome.html">really easy drag-and-drop file upload</a>. I think Safari supports drag-and-drop file upload as well? And I know Firefox has the <a href="http://googlesystem.blogspot.com/2007/02/upload-files-in-browser-using-drag-and.html">dragdropupload extension that eases uploading files to the web</a>.</p>
<p><strong>What about uploading Google Chrome bookmarks files?</strong></p>
<p>Ah, a person after my own heart. The short answer is that Google Chrome can export bookmarks in a format that looks like Firefox to me. Click on the Wrench, then &#8220;Bookmark manager,&#8221; then Tools->Export Bookmarks&#8230; to get a bookmarks.html file. The more fun answer is that &#8220;C:\Documents and Settings\{$USER}\Local Settings\Application Data\Google\Chrome\User Data\Default&#8221; appears to have a &#8220;Bookmarks&#8221; file, and it appears to be in JSON format. Can Python parse JSON? It can; <a href="http://developer.yahoo.com/python/python-json.html">Yahoo mentions</a> that <a href="http://undefined.org/python/">simplejson</a> is a great library to use, and it turns out that <a href="http://blog.infoentropy.com/Simple_JSON_library_Google_App_Engine">Google App Engine supports simplejson</a> very easily. Just say &#8220;from django.utils import simplejson&#8221; to use simplejson. So it wouldn&#8217;t be hard to upload raw Chrome bookmark files either.</p>
<p><strong>Aren&#8217;t there existing websites to do this?</strong></p>
<p>Maybe, but I don&#8217;t know of them. I thought that <a href="http://www.foxmarks.com/">Foxmarks</a> might be able to do this. Foxmarks (like the now-defunct <a href="http://www.google.com/tools/firefox/browsersync/">Google Browser Sync</a>) can synchronize bookmarks across multiple computers. And Foxmarks provides a <a href="http://my.foxmarks.com/">my.foxmarks.com</a> web interface that lets you manipulate and export your bookmarks, but you can&#8217;t upload a raw bookmarks.html file to Foxmarks; instead, you have to upload/sync bookmarks via a browser extension. If Foxmarks added the ability to upload bookmarks.html files (<a href="http://getsatisfaction.com/foxmarks/topics/merge_bookmark_html_files_from_multiple_browsers">vote for that idea here</a>), that would be pretty sweet.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/wanted-bookmarks-html-merging-program/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/wanted-bookmarks-html-merging-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TimeTrax gone, SXRecorder lives</title>
		<link>http://www.mattcutts.com/blog/timetrax-gone-sxrecorder-lives/</link>
		<comments>http://www.mattcutts.com/blog/timetrax-gone-sxrecorder-lives/#comments</comments>
		<pubDate>Mon, 13 May 2013 04:35:36 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=852</guid>
		<description><![CDATA[What&#8217;s that? You&#8217;ve never heard of an XMPCR? Don&#8217;t worry, the rest of the world hasn&#8217;t either. You can ignore this &#8220;hairball&#8221; post as I do spring cleaning on my blog. TimeTrax was a program that allowed XMPCR owners to listen to XM Radio on their computer. Even nicer, the program would &#8220;time shift&#8221; the [...]]]></description>
				<content:encoded><![CDATA[<p><em>What&#8217;s that? You&#8217;ve never heard of an <a href="http://en.wikipedia.org/wiki/XM_PCR">XMPCR</a>? Don&#8217;t worry, the rest of the world hasn&#8217;t either. You can ignore this &#8220;hairball&#8221; post as I do spring cleaning on my blog.</em> </p>
<p>TimeTrax was a program that allowed XMPCR owners to listen to XM Radio on their computer. Even nicer, the program would &#8220;time shift&#8221; the recording by taking the XM meta data and recording the raw audio of a channel to an MP3 with the artist/title of the song.</p>
<p>TimeTrax is not really viable anymore (see the Wikipedia page), but another program called SXRecorder will do much of the same thing.</p>
<p>If you&#8217;re using an XMPCR 100, you&#8217;ll need to install USB drivers for your device:</p>
<p>http://www.ftdichip.com/Drivers/VCP.htm</p>
<p>From the page: &#8220;Virtual COM port (VCP) drivers cause the USB device to appear as an additional COM port available to the PC.&#8221; So if you have the FTDI chip in a device (FTDI = Future Technology Devices International) like the XMPCR, it makes that USB device look like a serial port device, so that you can talk to COM ports.</p>
<p>Searching on Google for SXRecorder finds www.backpocket.com/sxrecorder/ . The software is free, but you can donate $25 or buy extra plugins for SXRecorder for $35.</p>
<p>You&#8217;ll need to activate your XMPCR receiver, but you can refresh your radio receiver at xmradio.com.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/timetrax-gone-sxrecorder-lives/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/timetrax-gone-sxrecorder-lives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing the winners of the Kinect contest</title>
		<link>http://www.mattcutts.com/blog/kinect-contest-winners/</link>
		<comments>http://www.mattcutts.com/blog/kinect-contest-winners/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 22:42:25 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=4689</guid>
		<description><![CDATA[When the Kinect launched, Adafruit Industries ran a contest for the first person who released open-source code to extract video and depth from the Kinect. Adafruit also ended up donating to the EFF after the contest was over. When I was in grad school, I would have loved to have a device like the Kinect. [...]]]></description>
				<content:encoded><![CDATA[<p>When the <a href="http://www.xbox.com/en-US/kinect">Kinect</a> launched, Adafruit Industries ran a <a href="http://www.adafruit.com/blog/2010/11/04/the-open-kinect-project-the-ok-prize-get-1000-bounty-for-kinect-for-xbox-360-open-source-drivers/">contest for the first person who released open-source code</a> to extract video and depth from the Kinect. Adafruit also ended up <a href="http://www.adafruit.com/blog/2010/11/10/we-have-a-winner-open-kinect-drivers-released-winner-will-use-3k-for-more-hacking-plus-an-additional-2k-goes-to-the-eff/">donating to the EFF</a> after the contest was over.</p>
<p>When I was in grad school, I would have loved to have a device like the Kinect. So I <a href="http://www.mattcutts.com/blog/open-kinect-contest/">decided to run my own contest</a>:</p>
<blockquote><p>
The first $1000 prize goes to the person or team that writes the coolest open-source app, demo, or program using the Kinect. The second prize goes to the person or team that does the most to make it easy to write programs that use the Kinect on Linux.
</p></blockquote>
<p>It&#8217;s time to announce the prize winners. There&#8217;s been so many cool things going on with the Kinect that instead of two winners, I ended up declaring seven $1000 winners.</p>
<p><strong>Open-source Application or Demo</strong></p>
<p>I picked two winners in this category. </p>
<ul>
<li><a href="http://twitter.com/#!/tomoto335">Tomoto Washio</a> for <a href="http://code.google.com/p/kinect-ultra/">Kinect Ultra Seven</a>. This program lets you transform into <a href="http://en.wikipedia.org/wiki/Ultra_Seven">Ultra Seven</a> with lots of different powers. It&#8217;s a really fun demo&#8211;check out the <a href="http://code.google.com/p/kinect-ultra/">videos</a>:<br />
<object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/RUG-Uvq-J-w&#038;rel=0&#038;hl=en_US&#038;feature=player_embedded&#038;version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/RUG-Uvq-J-w&#038;rel=0&#038;hl=en_US&#038;feature=player_embedded&#038;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object></li>
<li><a href="http://technofetishist.info/">Tiago Serra</a> and the <a href="http://www.sensebloom.com/">SenseBloom team</a> for <a href="http://www.vimeo.com/17966780">XBox Kinect OSCeleton</a>. The application sends 3D tracked body skeletons through the OSC protocol. Essentially, it’s a do-it-yourself motion capture system:<br />
<iframe src="http://player.vimeo.com/video/17966780" width="640" height="390" frameborder="0"></iframe></li>
</ul>
<p><strong>People that have made it easier to write programs for the Kinect</strong></p>
<p>A ton of people have made the Kinect more accessible on Linux or helped the Kinect community. I ended up picking five winners.</p>
<ul>
<li><a href="http://marcansoft.com/blog/">Hector Martin</a></li>
<li><a href="http://sourceforge.net/users/arneb/">Arne Bernin</a></li>
<li><a href="http://www.nonpolynomial.com/">Kyle Machulis</a> </li>
<li><a href="http://brandynwhite.com/">Brandyn White</a></li>
<li><a href="http://nui.joshland.org/">Joshua Blake</a></li>
</ul>
<p>All of these individuals pushed things forward so others can develop great programs on the Kinect more easily. Congratulations to all the winners, and to everyone doing neat things with their Kinect!</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/kinect-contest-winners/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/kinect-contest-winners/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Open Kinect Contest: $2000 in prizes</title>
		<link>http://www.mattcutts.com/blog/open-kinect-contest/</link>
		<comments>http://www.mattcutts.com/blog/open-kinect-contest/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 17:41:07 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=4442</guid>
		<description><![CDATA[I&#8217;m starting a contest for people that do cool things with a Kinect. See the details below. Before I joined Google, I was a grad student interested in topics like computer vision, motion self-tracking, laser scanners&#8211;basically any neat or unusual sensing device. That&#8217;s why I was so excited to hear about the Kinect, which is [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m starting a contest for people that do cool things with a Kinect. See the details below.</p>
<p><center><img src="http://www.mattcutts.com/images/open-kinect.jpg" alt="Open Kinect Logo" /></center></p>
<p>Before I joined Google, I was a grad student interested in topics like computer vision, motion self-tracking, laser scanners&#8211;basically any neat or unusual sensing device. That&#8217;s why I was so excited to hear about the <a href="http://en.wikipedia.org/wiki/Kinect">Kinect</a>, which is a low-cost ($150) peripheral for the <a href="http://www.xbox.com/">Xbox</a>. The output from a Kinect includes:<br />
- a 640&#215;480 color video stream.<br />
- a 320&#215;240 <strong>depth</strong> stream. Depth is recovered by projecting invisible infrared (IR) dots into a room. You should watch this <a href="http://www.youtube.com/watch?v=nvvQJxgykcU">cool video to see how the Kinect projects IR dots across a room</a>. Here&#8217;s a single frame from the video:<br />
<center><img src="http://www.mattcutts.com/images/ir-projection.jpg" alt="IR Projection" /></center><br />
but you should really watch the whole video to get a feel for what the Kinect is doing.<br />
- the Kinect has a 3-axis accelerometer.<br />
- the Kinect also has a controllable motor to tilt up and down plus four microphones.</p>
<p>What&#8217;s even better is that people have figured out how to access data from the Kinect without requiring an Xbox to go with it. In fact, <a href="http://www.adafruit.com/blog/2010/11/10/we-have-a-winner-open-kinect-drivers-released-winner-will-use-3k-for-more-hacking-plus-an-additional-2k-goes-to-the-eff/">open drivers for the Kinect have now been released</a>. The always-cool <a href="http://www.adafruit.com/">Adafruit Industries</a>, which offers all sorts of excellent do-it-yourself electronics kits, sponsored a <a href="http://www.adafruit.com/blog/2010/11/04/the-open-kinect-project-the-ok-prize-get-1000-bounty-for-kinect-for-xbox-360-open-source-drivers/">contest to produce open-source drivers for the Kinect</a>:</p>
<blockquote><p>First person / group to get RGB out with distance values being used wins, you’re smart – you know what would be useful for the community out there. All the code needs to be open source and/or public domain.</p></blockquote>
<p>Sure enough, within a few days, the contest was won by <a href="http://marcansoft.com/blog/">Héctor Martín Cantero</a>, who is actually rolling his reward into tools and devices for fellow white-hat hackers and reverse engineers that he works with, which is a great gesture. Okay, so where are we now? If I were still in grad school, I&#8217;d be incredibly excited&#8211;there&#8217;s now a $150 off-the-shelf device that provides depth + stereo and a lot more.</p>
<p><strong>It&#8217;s time for a new contest</strong></p>
<p>I want to kickstart neat projects, so I&#8217;m starting my own contest with $2000 in prizes. There are two $1000 prizes. The first $1000 prize goes to the person or team that writes the coolest open-source app, demo, or program using the Kinect. The second prize goes to the person or team that does the most to make it easy to write programs that use the Kinect on Linux.</p>
<p>Enter the contests by leaving a comment on this blog post with a link to your project, along with a very-short description of what your project does or your contribution to Kinect hacking. The contest runs until the end of the year: that&#8217;s Dec. 31st, 2010 at midnight Pacific time. I may ask for outside input on who should be the winner, but I&#8217;ll make the final call on who wins.</p>
<p>To get your ideas flowing, I&#8217;ll offer a few suggestions. Let&#8217;s start with the second contest: making the Kinect more accessible. In my ideal world, would-be hackers would type a single command-line, e.g. &#8220;sudo apt-get install openkinect&#8221; and after that command finishes, several tools for the Kinect would be installed. Maybe a &#8220;Kinect snapshot&#8221; program that dumps a picture, a depth map, and the accelerometer values to a few files. Probably some sort of openkinect library plus header files so that people can write their own Kinect programs. I would *love* some bindings to a high-level language like Python so that would-be hobbyists can write 3-4 lines of python (&#8220;import openkinect&#8221;) and start trying ideas with minimal fuss. To win the second contest, you could write any of these libraries, utilities, bindings or simplify installing them on recent versions of Linux/Ubuntu (let&#8217;s say 10.04 or greater).</p>
<p>Okay, how about some ideas for cool things to do with a Kinect? I&#8217;ll throw out a few to get you thinking.</p>
<p><strong>Idea 1</strong>: A <a href="http://images.google.com/images?q=minority+report+ui">Minority Report-style user interface</a> where you can open, move, and close windows with your movements.</p>
<p><strong>Idea 2</strong>: What if you move the Kinect around or mount it to something that moves? The Kinect has an accelerometer plus depth sensing plus video. That might be enough to reconstruct the position and pose of the Kinect as you move it around. As a side benefit, you might end up reconstructing a 3D model of your surroundings as a byproduct. The folks at UNC-Chapel Hill where I went to grad school built a <a href="http://www.cs.unc.edu/~tracker/">wide-area self-tracker</a> that relied on a <a href="http://www.cs.unc.edu/~welch/kalman/">Kalman filter</a> to estimate a person&#8217;s position and pose. See this <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.46.5550&#038;rep=rep1&#038;type=pdf">PDF paper</a> for example.</p>
<p><strong>Idea 3</strong>: Augmented reality. Given a video stream plus depth, look for discontinuities in depth to get a sort of 2.5 dimensional representation of a scene with layers. Then add new features into the video stream, e.g. a bouncing ball that goes between you and the couch, or behind the couch. The pictures at the end of <a href="http://research.microsoft.com/pubs/75684/Szeliski-Multimedia99.pdf">this PDF paper</a> should get you thinking.</p>
<p><strong>Idea 4</strong>: Space carver. Like the previous idea, but instead of learning the 2.5D layers of a scene from a singe depth map, use the depth map over time. For example, think about a person walking behind a couch. When you can see the whole person, you can estimate how big they are. When they walk behind the couch, they&#8217;re still just as big, so you can guess that the couch is occluding that person and therefore the couch is in front of the person. Over time, you could build up much more accurate discontinuities and layers for a scene by watching who walks behind or in front of what.</p>
<p><strong>Idea 5</strong>: A 3D Hough transform. A vanilla Hough transform takes a 2D image, looks for edges in the image, and then runs some computation to <a href="http://www.google.com/images?q=hough+transform+lines">determine lines in the image</a>. A <a href="http://en.wikipedia.org/wiki/Hough_transform#Detection_of_3D_objects_.28Planes_and_cylinders.29">3D Hough transform</a> finds planes in range data. I&#8217;ve done this with laser rangefinder data and it works. So you could take a depth data from a Kinect and reconstruct planes for the ground or walls in a room.</p>
<p><strong>Idea 6</strong>: What if you had two or more Kinects? You&#8217;d have depth or range data from the viewpoint of each Kinect and you could combine or intersect that data. If you put two Kinects at right angles (or three or four Kinects around a room, all pointing into the room), could you reconstruct a true 3D scene or 3D object from intersecting the range data from each Kinect?</p>
<p>I hope a few of these ideas get you thinking about all the fun things you could do with a Kinect. I&#8217;m looking forward to seeing what cool ideas, applications, and projects people come up with!</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/open-kinect-contest/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/open-kinect-contest/feed/</wfw:commentRss>
		<slash:comments>88</slash:comments>
		</item>
		<item>
		<title>Mini-review of the iPad</title>
		<link>http://www.mattcutts.com/blog/mini-review-of-the-ipad/</link>
		<comments>http://www.mattcutts.com/blog/mini-review-of-the-ipad/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 20:54:39 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=3858</guid>
		<description><![CDATA[I played with an iPad yesterday. Here&#8217;s my mini-review. The screen is bright and the touch sensitivity is fantastic. Given that it reminds me the most of an iPhone, it&#8217;s surprisingly heavy. It feels dense with potential. On the childlike-sense-of-wonder-scale (as fake Steve Jobs would say), the iPad is better than the Macbook Air but [...]]]></description>
				<content:encoded><![CDATA[<p>I played with an <a href="http://www.apple.com/ipad/">iPad</a> yesterday. Here&#8217;s my mini-review. The screen is bright and the touch sensitivity is fantastic. Given that it reminds me the most of an iPhone, it&#8217;s surprisingly heavy. It feels dense with potential.</p>
<p>On the childlike-sense-of-wonder-scale (as <a href="http://www.fakesteve.net/2010/04/an-open-letter-to-the-people-of-the-world.html">fake Steve Jobs</a> would say), the iPad is better than the Macbook Air but not as stunning as the iPhone when the iPhone first came out. I played with my wife&#8217;s iPhone for just a few minutes before I knew I had to have an iPhone. But I never really cared about the Macbook Air, mainly because the screen resolution was worse than my current laptop. The iPad fits between those two products in the spectrum of desirability for me.</p>
<p>The form factor is&#8230; weird. You&#8217;re going to feel strange carrying one of these into the grocery store, in the same way you felt weird using your cell phone in the grocery store at first. Leave it to Apple to blaze a trail of coolness though; the iPad will make this form factor acceptable, so you won&#8217;t feel quite as strange carrying a tablet into a meeting in a few months. The form factor fundamentally is awkward though: the iPad is book-sized, but much more delicate than a book. A screen this big with no protection will get scratched or scuffed. I&#8217;d expect to see plenty of articles about dropped iPads like you did about <a href="http://www.google.com/search?hl=en&#038;tbo=p&#038;tbs=vid:1&#038;q=wiimote+accident">Wiimotes getting thrown into TVs and windows</a>.</p>
<p>The gadget lover in me wants one, but the part of me that cares about open source and tinkering is stronger. I&#8217;m with <a href="http://www.boingboing.net/2010/04/02/why-i-wont-buy-an-ipad-and-think-you-shouldnt-either.html">Cory Doctorow</a> on this one. The iPad is gorgeous, but it&#8217;s still not worth it for me. Yesterday, I also bought two books at the bookstore to read on a trip. Walking back to my car with &#8220;paper media&#8221; felt a bit dorky&#8211;why am I buying books on paper in 2010? If I could buy a book digitally and really own it (not just obtain a license to read a book, where the license could be revoked), I&#8217;d quickly switch to buying my books digitally. But the success of the Kindle shows that a lot of people care more about the convenience than <a href="http://www.nytimes.com/2009/07/18/technology/companies/18amazon.html">completely owning what they&#8217;re buying digitally</a>.</p>
<p>I think the iPad will be a huge hit. Non-tech-savvy consumers will love it because of the user experience, the simplicity, and the lack of viruses/malware/trojans. It&#8217;s like a computer without all the hassles of a typical computer (pre-installed crapware, anti-virus software, inconvenient software upgrades). Lots of tech-savvy consumers will love the iPad for the same reasons, and especially for the polish and user experience. The current iPad lacks a few things (such as a camera), which ensures that future generations of the iPad will also be a huge hit.</p>
<p>But the iPad isn&#8217;t for me. I want the ability to run arbitrary programs without paying extra money or getting permission from the computer manufacturer. Almost the only thing you give up when buying an iPad is a degree of openness, and tons of people could care less about that if they get a better user experience in return. I think that the iPad is a magical device <a href="http://al3x.net/2010/01/28/ipad.html">built for consumers</a>, but less for <a href="http://diveintomark.org/archives/2010/01/29/tinkerers-sunset">makers or tinkerers</a>. I think the world needs more makers, which is why I don&#8217;t intend to buy an iPad. That said, I think the typical consumer will love the iPad.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/mini-review-of-the-ipad/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/mini-review-of-the-ipad/feed/</wfw:commentRss>
		<slash:comments>94</slash:comments>
		</item>
		<item>
		<title>Finding the best cell phone carrier</title>
		<link>http://www.mattcutts.com/blog/map-cell-phone-strength/</link>
		<comments>http://www.mattcutts.com/blog/map-cell-phone-strength/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 15:20:35 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=3624</guid>
		<description><![CDATA[Okay, someone tell me if this device exists (or build it!). I want a device where I can pay $10-15 to get a gadget in the mail. The gadget would sit in my pocket for a week wherever I go. The device would record cell phone signal strength for each of the four major U.S. [...]]]></description>
				<content:encoded><![CDATA[<p>Okay, someone tell me if this device exists (or build it!). I want a device where I can pay $10-15 to get a gadget in the mail. The gadget would sit in my pocket for a week wherever I go. The device would record cell phone signal strength for each of the four major U.S. carriers every few seconds. After a week or so, the device would deliver the verdict on which cell phone carrier would have the strongest signal for me. Then I could mail the device back so someone else could use it &#8212; sort of a Netflix-like model to temporarily borrow this device.</p>
<p>At any point, I could go to a web page to view a map of where I&#8217;d been. The page would show a &#8220;heat map&#8221; of signal strength for each carrier or frequency band. Maybe I could also slice/dice by time or see the total number of readings in each location. I&#8217;m pretty sure you could rig this up out of 2-3 cell phones running Android in the worst case.</p>
<p>So far, I&#8217;ve found:</p>
<p><strong>Android</strong></p>
<p>- <a href="http://sites.google.com/site/androiddevelopmentproject/home/rf-signal-tracker">RF Signal Tracker</a> is a nice app to collect and map signal strength data. It looks like it can upload to <a href="http://www.opencellid.org/">OpenCellID</a>, which is a project to create an open database of cell IDs (numbers that correspond to cells).<br />
- <a href="http://www.panix.com/~mpoly/android/antennas/r1.0/">Antennas</a> is a pretty cool free app to show you nearby antennas and signal strength. It can even export some data in KML for use with Google Maps/Earth, but it doesn&#8217;t seem to make a heat map that could be easily grokked.<br />
- <a href="http://www.sensorly.com/">Sensorly</a> has a free Android app, but they seem to want you to pay to zoom in closer than city level. I&#8217;m willing to do that, but didn&#8217;t see the for-pay addon in the Android Market.</p>
<p><strong>iPhone</strong></p>
<p>- I also found an <a href="http://www.sudobility.com/Signals.html">iPhone app called Signals</a> that will continuously collect signal data and upload it.<br />
- AT&#038;T offers an iPhone app called <a href="http://www.wired.com/gadgetlab/2009/12/iphone-app-reports-dropped-calls-poor-voice-quality-to-att/">Mark the Spot</a> to report dropped calls, no coverage, etc. I have to admit that I don&#8217;t understand why this is manual though. Personally, I&#8217;d want my phone to ping my carrier with its location every time the phone dropped a call.</p>
<p><strong>Web</strong></p>
<p>- <a href="http://www.signalmap.com/">SignalMap</a> is a website to (manually!) submit the number of bars for a location. It doesn&#8217;t appear to have any mobile app to back it up. Likewise, <a href="http://www.deadcellzones.com/">Dead Cell Zones</a> and <a href="http://www.gotreception.com/">Got Reception?</a> appear to rely on manual reports. I don&#8217;t think manual reports is the best way to tackle cell phone coverage maps though &#8212; you really want an app for this.<br />
- <a href="http://www.cellreception.com/">http://www.cellreception.com/</a> has the standard manual reports data, but also will map the location of cell phone towers based on the location of cell phone towers registered with the FCC.<br />
- <a href="http://www.rootwireless.com/">Root Wireless</a> powers the <a href="http://reviews.cnet.com/cell-phone-coverage-map/">cell phone signal strength maps</a> that CNET uses, but I didn&#8217;t see any apps I could download or install on a phone. I registered to be a beta tester a long time ago, but no one ever contacted me.</p>
<p>That&#8217;s what I could find. <strong>Do you know of any good Android (or iPhone) programs to collect, map, or upload cell phone strength measurements?</strong> If so, let me know in the comments.</p>
<div class="plusone"><g:plusone href="http://www.mattcutts.com/blog/map-cell-phone-strength/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/map-cell-phone-strength/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using n/a

 Served from: www.mattcutts.com @ 2013-05-20 02:06:07 by W3 Total Cache -->