How to set up a Wii Fit with a Raspberry Pi to record your weight to the web. I am using a CanaKit: http://www.canakit.com/raspberry-pi-starter-kit.html
- Set up raspbian.
- Set up WiFi.
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install bluez bluez-tools python-bluez python-gobject wminput
This hack is based on the instructions at http://www.stavros.io/posts/your-weight-online/ I've added some Raspberry Pi specific build details. Also, this is updated to account for some minor changes to bluez. The gist is that you have to temporary replace your bluetooth stack with a version that's hacked up to send the correct keycode.
- Use
sudo bluez-test-discovery
orhcitool scan
to get the address of the Wii Fit. - Uninstall bluez with
sudo apt-get remove bluez
(or you can use dpkg -r). sudo apt-get install build-essential libdbus-1-dev check checkinstall libglib2.0-dev libudev-dev
sudo nano /etc/apt/sources.list
and uncomment the deb-src line.sudo apt-get update
mkdir -p ~/src && cd ~/src && apt-get source bluez
cd bluez-*
./configure --enable-test --prefix=/ --exec_prefix=/usr
- Hand edit
pincode_cb
insrc/event.c
like this: https://gist.github.com/bklimt/9f7b290d0a664b7a3567 make
sudo checkinstall --fstrans=no
sudo service bluetooth restart
- Press the red button on your Wii Fit, then
sudo ./test/simple-agent hci0 <your wii fit's address> && sudo wminput <your wii fit's address>
- For the pin, enter the numbers in your bluetooth adapter's (not the Wii Fit) address backwards with a dollar sign. For example, if your adapter's address is
00:1A:7D:DA:71:13
, use pin code$1371da7d1a00
. If you aren't sure of your apapter's address, one was to find it isls /var/lib/bluetooth/
. sudo bt-device —set <your wii fit's address> Trusted 1
sudo dpkg -r bluez
sudo apt-get install bluez
- Wait 3 days. Yeah, I don't know. It didn't work for me, and then I came back 3 days later and everything worked.
- Set up git access to github. https://help.github.com/articles/generating-ssh-keys/
mkdir -p ~/src && cd ~/src
git clone git@github.com:bklimt/blobbin.git
You can skip this step if you want to do something with the weights other than record them to the web. If so, you'll need to hack up the python scripts to do whatever you want them to do.
- Create an app on parse.com.
- Secure it by disabling client class creation, making a Weight class, adding a weight number field and a person string field to it, and making the class readonly.
- Download the parse cli.
cd ~/src/blobbin/
parse new
to set the keys for the Parse app you want to deploy to.cd ./parse
parse deploy
-
cd ~/src/blobbin/parse
-
Edit the
DEVICE
variable inlisten.py
to use the address of your Wii Fit. -
Change the logic in
storage.py
to do whatever you want with the weights. -
Create the config for accessing Parse.
$ cat >~/src/blobbin/config.py appId = "<Your App Id>" masterKey = "<Your Master Key>" ^D
-
sudo python listen.py