There are at least two ways to build the Nike+ Check-In Hardware that talks to stumble.to. One is easy, one is a bit difficult. I will first focus on the easy way, and then if you are daring enough with your soldering skills, I will send you off in the right direction for a more difficult way that does not require the very handy SparkFun hardware.
Things you will need:
If you run into trouble:
Contact our support department, er, i mean, Casey, by emailing casey_nike_support @ mobilesquared.com. Tell me as much as you can about your situation and I will try to steer you in the right direction.
Step 1: Connecting up the hardware
Connecting the hardware is very simple, thanks to the prefabricated Nike+iPod SparkFun board. Simply connect the white receiver to the iPod connector. Plug the USB into the SparkFun board and the computer. A red LED will light up, and a new serial port will be created on your computer.
Step 2: Installing the software
Python is usually on most unixes and standard with Mac OSX. If not, it should not be too hard to find it with popular packaging systems. One thing that probably isn’t automatically installed is PySerial, but this is easy to. Visit PySerial’s website and follow the installation instructions.
Step 3: Identifying your serial port
The Nike+iPod is a standard FTDI serial device, and nearly every operating system will automatically find the drivers on connection. On most unix-based operating systems, check the /dev directory for a new serial port. On my Snow Leopard Mac, this can be as easy as typing ‘ls /dev/*usbserial*’ in the terminal. In my particular case, the Nike+iPod shows up as “/dev/tty.usbserial-A600e18v”. If you still have a hard time seeing it, try unplugging it and plugging it back in and seeing if a new file pops up in /dev that looks like a serial port. Write down whatever the serial port is so you can modify the python script with the correct serial port.
Step 4: Get yourself a stumble.to account and API key
Stumble.to supports a variety of authentication systems (I simply just use google to log in). Now that you have an account, you can add your API key. Go to “venues” and create a new test venue (or link it to an existing foursquare venue). After you create your venue, you will see an API key and API secret. Write these down because you will need them for the python script.
Step 5: Download the stumble.to Nike agent
You can find the python script here:
Step 6: Edit the script with your API settings
Open the python script you downloaded in your favorite editor, and edit the following:
# Adjust these values as appropriate.
API_KEY = 'YOUR_API_KEY'
API_SECRET = 'YOUR_API_SECRET'
DEVICE = '/dev/tty.usbserial-A600e18v'
Populate the values you obtained for the API key, secret, and serial port in the above locations.
Step 7: Run the script and see if it works!
Run the script (ie: python stumbleto-shoe-agent.py) and watch the console. The script will initialize the Nike+ hardware and start listening on the air. Pick up your Nike+ sensor and jiggle it like you are going to role some dice. Rather shortly, it should see the Nike+ sensor and print out a hex serial number like: 8d-10-92-2f. This is the Nike+ sensor UID number that you will need to put into your stumble.to account. If you have more sensors, repeat the same process and be sure to keep track which is which.
Go ahead and quit the script for now after you are done with this.
Step 8: Visit the stumble.to site and enter your Nike+ UID and Foursquare account information
For the Nike+ sensor:
Visit the stumble.to site, log in, and click “Add Device”
For the name, you can put anything, but I suggest looking on the back for the serial number of the Nike+ sensor and using this.
Select Nike+ sensor for the type.
Finally, Enter the UID we discovered above where it say UID.
For the foursquare connection:
Stumble.to uses oauth for authenticating users on third party services. This means we do not store your login or password information on our server. This step is no more painful than authorizing a third party to use your twitter, facebook, etc. log in information and its used for us to check you into venues.
Click on “Add Service”, and select foursquare (and possibly twitter and fire eagle if you want to announce your stumble.to check ins to these services as well)
Step 9: Run the script to Nike+ enable the venue
Run the stumbleto-shoe-agent.py python script and either walk around your sensor or jiggle it a little. It will see your device. Congratulations! You just made your first Nike+ check in! You can also keep it in a backpack, purse, pocket, etc. so you don’t need to fuss with it again.
Be sure to let us know about your newly enabled venue!
And for some value add..
Stumble.to can also detect any WiFi device in range for auto-checkin (Laptop, iPhone, android, etc). Be sure to check out some of the example scripts you can run on some WiFi routers.
For those who want to try to the hard way…
This is actually not too hard if you have a steady hand. You will need a level shifter (FTDI is suggested, as it does have a 3.3V output that can drive the iPod receiver circuitry) and some wire. All you need to do is solder up a few grounds, TX, RX, and 3.3V.
Here is the SparkFun schematic
Here is a link to a UW security project that involved soldering directly to the receiver pins.