Overview
To talk to the accelerometer under Linux you'll need some type of bluetooth adapter. This document assumes you're using a USB adapter such as a D-Link DBT-120 or Belkin F8T003. You'll also need to patch your kernel, verify some kernel settings, and install BlueZ, the Linux Bluetooth stack.
BlueZ and Kernel
- go to the BlueZ site
- read the install docs
- download and install all of the packages: libs, utils, sdp, pan, hcidump, hciemu, and bluefw.
- apply the correct Bluetooth Kernel Patch for your kernel
- in your kernel's config, say M to everything under Bluetooth Support including: Bluetooth subsystem support, L2CAP, SCO, RFCOMM, and HCI USB driver
- make dep && make bzImage modules modules_install
- install new kernel
- reboot
Usage
- modprobe bluez
- modprobe l2cap
- modprobe rfcomm
- modprobe hci_usb
- plug in your USB Bluetooth dongle
- type hciconfig (like ifconfig) you should see hci0
If it isn't there, you may need to load firmware into your USB dongle. This is easily accomplished with the bluefw command:- bluefw usb /proc/bus/usb/XXX/YYY where XXX and YYY are the bus/device IDs of your dongle
If that doesn't work, try re-inserting the dongle and running bluefw again.
- hciconfig hci0 up
- hcitool scan
This should show you nearby Bluetooth devices that are discoverable (make sure the accelerometer is on) - l2ping <address> where address looks like 00:0A:4F:00:11:63
This is just an optional step to confirm that you can in fact talk to the accelerometer - rfcomm connect rfcomm0 <address>
This establishes the rfcomm connection with the accelerometer on /dev/rfcomm0.
You may now perform file operations on this file. - cat /dev/rfcomm0
This should spew real data from the sensor if everything is working. Also see the section on the LED Indicators.