forked from tkuyucu-nordicsemi/drive-sdk
-
Notifications
You must be signed in to change notification settings - Fork 63
Getting Started on Ubuntu
Stuart Eichert edited this page Feb 15, 2014
·
16 revisions
These instructions assume you are using Ubuntu Desktop 12.04 (64-bit). Other versions may work as well.
$ sudo apt-get install cmake \
curl \
git \
g++ \
libbluetooth-dev \
libreadline-dev \
libical-dev \
libglib2.0-dev \
libdbus-glib-1-dev \
libudev-dev
$ mkdir ~/anki && cd ~/anki
$ curl https://www.kernel.org/pub/linux/bluetooth/bluez-5.13.tar.gz | tar -zxf -
$ cd bluez-5.13
$ ./configure --disable-systemd
$ make
$ cd ~/anki
$ git clone https://github.com/anki/drive-sdk.git
$ cd drive-sdk
$ mkdir -p build && cd build
$ export BLUEZ_ROOT=~/anki/bluez-5.13
$ cmake .. -DBUILD_EXAMPLES=ON
$ make
$ ./test/Test
-
Obtain a suitable USB Bluetooth adapter like the Orico BTA-402
-
Plug in the adapter and verify it is properly loaded by using lsusb
$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
-
Enable the adapter with hciconfig
$ sudo hciconfig hci0 up
Pull out Boson and Kourai from the Anki Drive Starter Kit and turn them on by pressing the little button on the bottom of each car.
-
Scan for them with the vehicle-scan example app
$ sudo ~/anki/drive-sdk/build/examples/vehicle-scan/vehicle-scan LE Scan ... DF:FA:7F:89:61:D2 Drive [v2120] (Boson 1e00) F0:9C:17:98:F8:E8 Drive [v2120] (Kourai 10b3)
-
Make Boson's tail light flash a pattern with the vehicle-tool example app
$ sudo ~/anki/drive-sdk/build/examples/vehicle-tool/vehicle-tool --adapter=hci0 --device=DF:FA:7F:89:61:D2 [DF:FA:7F:89:61:D2][LE]> connect Attempting to connect to DF:FA:7F:89:61:D2 Connection successful Starting handle: 0x0009 Ending handle: 0xffff [handle: 0x000a, char properties: 0x0e, char value handle: 0x000b] [handle: 0x000c, char properties: 0x12, char value handle: 0x000d] [DF:FA:7F:89:61:D2][LE]> get-version [read] VERSION_RESPONSE: 0x2120 [DF:FA:7F:89:61:D2][LE]> ping [read] PING_RESPONSE [DF:FA:7F:89:61:D2][LE]> set-lights-pattern TAIL FLASH 1 6 10 [DF:FA:7F:89:61:D2][LE]> vehicle-disconnect [DF:FA:7F:89:61:D2][LE]> exit