NXT, Linux and Bluetooth

Overview

On Gentoo the following packages are required:

/etc/bluetooth/hcid.conf

options {
        autoinit yes;
        security auto;
        pairing multi;
        pin_helper /usr/bin/bluepin;
}

device {
        name "BlueZ (%d)";
        class 0x3e0100;
        iscan enable; pscan enable;
        lm accept;
        lp rswitch,hold,sniff,park;
}

/etc/bluetooth/pin

1234

/etc/bluetooth/rfcomm.conf

rfcomm0 {
        bind yes;
        device 00:16:53:05:9E:78;
        channel 1;
        comment "NXT";
}

Commands:

As root do:
phantom ~ # /etc/init.d/bluetooth restart 
 * Shutting down Bluetooth ...
 *     Stopping rfcomm ...                                                [ ok ]
 *     Stopping sdpd ...                                                  [ ok ]
 *     Stopping hcid ...                                                  [ ok ]
 * Starting Bluetooth ...
 *     Starting hcid ...                                                  [ ok ]
 *     Starting sdpd ...                                                  [ ok ]
 *     Starting rfcomm ...                                                [ ok ]
phantom ~ #
As normal user do:
hanez@phantom ~ % hcitool scan
Scanning ...
        00:16:53:05:9E:78       NXT
hanez@phantom ~ % hcitool inq
Inquiring ...
        00:16:53:05:9E:78       clock offset: 0x7b0d    class: 0x000804
hanez@phantom ~ % 
Again as root do:
phantom bluetooth # l2ping -c 4 00:16:53:05:9E:78
Ping: 00:16:53:05:9E:78 from 00:04:3E:C0:B8:7E (data size 44) ...
4 bytes from 00:16:53:05:9E:78 id 0 time 8.92ms
4 bytes from 00:16:53:05:9E:78 id 1 time 17.97ms
4 bytes from 00:16:53:05:9E:78 id 2 time 26.77ms
4 bytes from 00:16:53:05:9E:78 id 3 time 8.59ms
4 sent, 4 received, 0% loss
phantom bluetooth # 

Hoooray! This seems to work... ;) Now you are able to use for example nxtlibc or LEGO::NXT.

Flattr thisTwitter

$Date: 2011-06-30 00:10:52 +0200 (Thu, 30 Jun 2011) $