PRE-ALPHA: bmhack is a command line extraction tool which will extract and parse data from your (new model) BodyMedia ArmBand device into a variety of formats, including a tab-delimited spreadsheet-compatible file, raw packets in ASCII HEX, and a full Python cPickle binary dump.
THIS TOOL WILL NOT HELP YOU if you are looking for something to give you calorie counts or activity graphs
. It is in a very early state, and is only useful for technical people who wish to attempt to experiment with and analyze the raw data or learn more about their BodyMedia device.
You must install
Python 2.6, and the Python
numpy libraries.
Windows: Python 2.6.2 from
http://www.python.org/download/releases/Windows: Numpy for 2.6.2 from
http://sourceforge.net/projects/numpy/files/Download
bmhack VERSION
z718b [June 18 update] from:
http://www.mediafire.com/?sharekey=26cf7e726ccc34f061d4646c62b381cbfe370e2ca4df676ac95965eaa7bc68bcWindows: Launch bmhack with C:\python26\python.exe bmhack.py
There is also an example of several days of CSV output in that MediaFire directory, filename z705a.csv
It is verified to work under Linux, and should work under Windows (let me know?).
If you want to experiment with the less understood parts of the protocol, download the known_requests.pickle from the same site and move into your current directory when you run bmhack so you can use the --fromSerialFull command.
MISSING
-[
DONE VERSION z713a] Timestamps - Pretty sure I know where time offsets live before each data table. I output them to CSV, but can't intepret them yet. I expect a global time field somewhere?
-"Register" data - user attributes like height, serial number, etc are probably stored outside of the main data memory area. I haven't really looked.
-Other
In addition to being a command line program, you can also import bmhack into a Python interpreter and manipulate the data or the device directly. There are an array of analysis and display python functions.
The bmhack.py code and comments also contain my (incomplete) documentation of the ArmBand data structures. Look at ReadAllStruct() to start.
Linux: How to force the ftdi_sci driver to recognize the BodyMedia Vendor/Product IDs:
sudo modprobe ftdi_sio vendor=0x11f8 product=0x0007
Verify that a new '/dev/ttyUSB*' device has been created.
./bmhack.py -h
THIS CODE IS DECLARED BY THE AUTHOR TO BE IN THE PUBLIC DOMAIN.
NO WARRANTY EXPRESSED OR IMPLIED OF ANY KIND IS PROVIDED.
USAGE: ./bmhack.py [SOURCE] [TARGET] [TARGET] ...
Retrieve and convert data from a BodyMedia armband device
Convert from a packet source to one or more target formats
A packet source can be a live BodyMedia USB device, a cPickle
dump file of packets, or a capture file form a serial port sniffer.
SOURCES - specify only one
--fromSerial= Extract data by quering a live USB device on the specified serial port
--fromDump= Read packets from a cPickle dump file saved previously
--fromFSPM= Parse packets from a 'Free Serial Port Monitor' by HDD Software. is an export of the RequestView window.
TARGETS - specify one or more
--toDump= Write cPickle dump of all packet data
--toCsv= Write a Spreadsheet-compatible tab delimited file of most of the data
--toPackets= Write parsed packets in human-readable HEX format
NOTE: Specify '-' as a filename to toCsv and toPackets commands in order to write to stdout instead of a file