Hacking the Blobo

March 21st, 2013

The Blobo is an interesting game controller invented by a Finnish company. Its a “soft” ball containing a pressure sensor (so you can squeeze it), accelerometers (so it knows how it is moving) and magnetometers and a gyro.

Theres a few sellers getting rid of them on Amazon at the moment for a fiver a pop (down from £45). I didn’t even look at the accompanying game as it crashed out on my mac.

The great thing about them is they connect via bluetooth, and present data as a bluetooth serial port so could be used for all kinds of things. Jussi Virkkala documented the message format over on http://www.neuroupdate.com/blobo but didn’t say much else.

I put together some quick python to parse the messages sent out by the Blobo over bluetooth. As I was interested in just the pressure data (how hard it is being squeezed) then I just pulled that out and printed to screen.

To pair the thing with my mac in the first place I had to tell the mac not to try and use a passcode.

Here is a video of this in action:

And the code:

import serial
#you'll need to set your serial port, do ls /dev/tty.* on a mac to list 'em
ser = serial.Serial('/dev/tty.BALL-BluetoothSerialPort', 38400, timeout=1) 
ser.write("A")      # open comms

count = 0
while 1:
	count +=1
	packet = ser.read(size=25) #read the 25 character packet
	packetlist = [ord(c) for c in packet] #turn it into human readable hex
	P_LSB = packetlist[16] #see http://www.neuroupdate.com/blobo/blobo.xls for key to fields
	P_MSB = packetlist[17]
	pressure = P_LSB + P_MSB * 256 #put the number back together
	print pressure 
	if count>500:  #Blobo needs a 'keep alive' message