Sensor Democracy

Hot on the heels of talking with my friend Kevin about training for data is a revelation by my new favorite fitness company Wahoo makers of fitness sensors, devices and apps.

One of the challenges for any geek who wants to go beyond commercial products for their fitness regimen is the need to understand all the complicated protocols of sensors, namely Bluetooth and ANT+.

I recently acquired a biking cadence and speed sensor to match my heart rate monitor and realized that the app has a hidden gem of a feature!

Under the User Profile settings is a featured called Air Broadcaster, which states it Broadcast[s] your data live over Wi-Fi!!!

It must not be well known within the company, because their support email had no idea what I was talking about, but I was lucky enough to stumble upon the developer via twitter who gave me some code, enough to figure out how it works!

There are two quick and easy ways to get access to this data, the first using our trusty friend netcat:

 nc -w0 -dulk 51530

You should see some data such as:

{"HeartrateInstant":0,"LapRunningTimeString":"01:36","CadenceInstantString":"0","HeartbeartBitmap":"GBg8PH5+////////f/4//B/4D/AH4APAAYAAAAAAAAA=","HeartrateInstantString":"0","SpeedInstant":0,"DeviceName":"<YOURPHONE_NAME>","Email":"","DistanceWorkout":0,"BikePowerInstant":0,"WorkoutRunningTimeString":"02:35","CadenceInstant":0,"WorkoutState":"Running"}

Note, this was me testing it from my couch and not engaged in any physical activity, so the only sensor it had was GPS.

The second using some simple python:

#!/usr/bin/python

import socket
import json

UDP_IP = "0.0.0.0"
UDP_PORT = 51530

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))

while True:
    data_str, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
    data = json.loads(data_str)
    print addr, " -> ", data

 

    Why is this cool?

This means I can spend my time working with my data, not trying to recreate a sensor bridge!

I’ll still have to spend some time figuring out what HeartbeartBitmap represents, but that’s (hopefully) trivial to reverse engineering how to connect to the sensor and it’s own protocol.

About jay

I'm trying to build something interactive where I can learn from others and hopefully share useful knowledge too. thecapacity@gmail.com
This entry was posted in uncategorized. Bookmark the permalink.

One Response to Sensor Democracy

  1. The unique challenges and concerns of attic Remodeling are not to be taken lightly.
    The cold continued to come and go and the family continued to
    cope. If you are considering doing some improvements to
    your attic the first thing you need to do is make a list of what you would like to use the space for.

Comments are closed.