Configurando Teclado e Mouse Bluetooth (Mouse e Keyboard) no Ubuntu Lucid

Veja estes links:

https://help.ubuntu.com/community/BluetoothSetup

http://www.ubuntugeek.com/howto-setup-bluetooth-keyboard-and-mouse-in-ubuntu.html

http://awesomelinux.blogspot.com/2010/05/ubuntu-1004-lucid-logitech-dinovo-edge.html

http://www.electric-spoon.com/cgi-bin/man/man2html?bluetoothd+8

http://blog.projectnibble.org/2010/01/28/how-to-connect-a-bluetooth-keyboard-in-ubuntu-9-04-jaunty-and-9-10-karmic-workaround/

Para versões antigas do bluez-utils meu arquivo de configuração seria:

sudo gedit /etc/bluetooth/hcid.conf

# HCI daemon configuration file.
# HCId options
options {
# Automatically initialize new devices
autoinit yes;
# Security Manager mode
#   none - Security manager disabled
#   auto - Use local PIN for incoming connections
#   user - Always ask user for a PIN
#
security user;
# Pairing mode
#   none  - Pairing disabled
#   multi - Allow pairing with already paired devices
#   once  - Pair once and deny successive attempts
pairing multi;
# Default PIN code for incoming connections
#passkey "0000";
# D-Bus PIN helper
#dbus_pin_helper;
}
# Default settings for HCI devices
device {
# Local device name
#   %d - device id
#   %h - host name       
#   name "inspiron (%d)";
name "%h";
# Local device class
#class 0x000100;
#class 0xff0100;
class 0x5a010c;
# Default packet type
pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
# Default link mode
#   none   - no specific policy
#   accept - always accept incoming connections
#   master - become master on incoming connections,
#            deny role switch on outgoing connections
lm master;
# Default link policy
#   none    - no specific policy
#   rswitch - allow role switch
#   hold    - allow hold mode
#   sniff   - allow sniff mode
#   park    - allow park mode
lp rswitch,hold,sniff,park;
}

device 00:22:48:84:4A:E4 {
name “Microsoft Bluetooth Mobile Keyboard 6000”;
auth enable;
encrypt enable;
}
device 00:22:48:84:3B:72 {
name “Microsoft Bluetooth Number Pad”;sudo gedit /etc/bluetooth/hcid.conf

auth enable;
encrypt enable;
}
device 00:22:48:E1:C1:3C {
name “Microsoft Bluetooth Notebook Mouse 5000”;
}
device 00:60:D1:00:8F:46 {
name “Bluetooth Mini Mouse”;
}

Manual deste arquivo de configuração em:

http://manpages.ubuntu.com/manpages/hardy/en/man5/hcid.conf.5.html


Hoje este arquivo de configuração não é mais utilizado pelo ubuntu lucid. Precisaria instalar o bluez-compat para fazer isso funcionar.

O man de bluetoothd informa que o local de configuração é:

/etc/bluetooth/main.conf

[General]

# List of plugins that should not be loaded on bluetoothd startup
#DisablePlugins = network,input

# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
Name = %h-%d

# Default device class. Only the major and minor device class bits are
# considered.
Class = 0x000100

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

# Use some other page timeout than the controller default one
# which is 16384 (10 seconds).
PageTimeout = 8192

# Discover scheduler interval used in Adapter.DiscoverDevices
# The value is in seconds. Defaults is 0 to use controller scheduler.
DiscoverSchedulerInterval = 0

# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true

# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

# Use vendor, product and version information for DID profile support.
# The values are separated by ":" and VID, PID and version.
#DeviceID = 1234:5678:abcd

# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true

# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
NameResolving = true

 


 

E tem configurações interessantes no diretório:

/var/lib/bluetooth/nn:nn:nn:nn:nn:nn

onde - The directory nn:nn:nn:nn:nn:nn is the address of the local device.

Comando para verificar dispositivos disponíveis:

hcitool scan

Comando para ver suas configurações:

hciconfig -a

hci0:    Type: USB
BD Address: 00:15:AF:F9:5D:3A ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
RX bytes:1052516 acl:69099 sco:0 events:1156 errors:0
TX bytes:8337 acl:211 sco:0 commands:192 errors:1
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'ant'
Class: 0x5a010c
Service Classes: Networking, Capturing, Object Transfer, Telephony
Device Class: Computer, Laptop
HCI Ver: 2.1 (0x4) HCI Rev: 0x50f1 LMP Ver: 2.1 (0x4) LMP Subver: 0x420e
Manufacturer: Broadcom Corporation (15)

Comando abaixo configura propriedades do bluetooth:

bluetooth-properties

Tem muito pouca documentação sobrfe o Bluez.

No link abaixo (de arquivos da WEB) temos um pouco de documentação disponível:

http://web.archive.org/web/20080501043142/wiki.bluez.org/wiki

 


 

Melhor link:

http://www.linuxquestions.org/questions/debian-26/bluetooth-problems-715839/

Lá pede para alterar o arquivo

sudo gedit /etc/rc.local

Com o conteúdo abaixo:

## Configurando Bluetooth
hciconfig hci0 reset
hciconfig hci0 class 0xff0100
hciconfig hci0 name master
## Fim da configuração do Bluetooth
exit 0


Para o meu mouse em específico precisou colocar um driver na inicialização principal:

sudo gedit /etc/modules

### Bluetooth at Start up ###
joydev


 

Veja artigo na íntegra:

...:::!!! SOLVED !!!:::...

This was a real pain, so this is what I did to get it to work...

In /etc/bluetooth you need to create or edit the following files: hcid.conf input.conf main.conf

# cat /etc/bluetooth/hcid.conf
#HCId Options
options {
autoinit yes;
security auto;
pairing multi;
passkey "1234";
}

#HCI Device Settings
device {
name "%h-%d";
#encrypt enable;
class 0x082580;
iscan enable; pscan enable;
discovto 0;
lm accept,master;
lp rswitch,hold,sniff,park;
pkt_type DM1,DM3,DM5,DH1,DH3,DH5,HV1,HV2,HV3;
}

#device 00:01:90:E2:49:BD {
#name "Sony Corporation Remote Controller";
#}

This section below is pretty important to get the device address use hidd --scan and press the discoverable button on the bottom of your mouse.
device 00:02:76:07:68:1C {
name "Sony Corporation (3) Button Mouse";

# cat /etc/bluetooth/main.conf
[General]

# List of plugins

that should not be loaded on bluetoothd startup
#DisablePlugins = network,input

# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
Name = %h-%d

# Default device class. Only the major and minor device class bits are
# considered.
Class = 0x082580

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

# Use some other page timeout than the controller default one
# which is 16384 (10 seconds).
PageTimeout = 8192

# Discover scheduler interval used in Adapter.DiscoverDevices
# The value is in seconds. Defaults is 0 to use controller scheduler.
DiscoverSchedulerInterval = 0

# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true

# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

# Use vendor, product and version information for DID profile support.
# The values are separated by ":" and VID, PID and version.
#DeviceID = 0005:0001:0129
#DeviceID = 0000:0000:0000

# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true

# cat /etc/bluetooth/input.conf
# Configuration file for the input service

# This section contains options which are not specfic to any
# particular interface
[General]

# Set idle timeout (in minutes) before the connection will
# be disconnect (defaults to 0 for no timeout)
IdleTimeout=0

In /etc/default you need to edit the following file: bluetooth

# cat /etc/default/bluetooth
# Defaults for bluez-utils

# This file supersedes /etc/default/bluez-pan. If
# that exists on your system you should use this
# file instead and remove the old one. Until you
# do so, the contents of this file will be ignored.

# start bluetooth on boot?
# compatibility note: If this variable is not found bluetooth will
# start
BLUETOOTH_ENABLED=1

# This setting will switch HID devices (e.g mouse/keyboad) to HCI mode, that is
# you will have bluetooth functionality from your dongle instead of only HID.
# Note that not every bluetooth dongle is capable of switching back to HID
# mode, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355497
HID2HCI_ENABLED=1
HID2HCI_UNDO=1

############ HIDD
#
# HID daemon
HIDD_ENABLED=1
HIDD_OPTIONS="--connect 00:02:76:07:68:1C --server"
#HIDD_OPTIONS="--master --connect 00:02:76:07:68:1C --server" <<-- I had some problems with --master and this mouse...
# to make hidd always use a particular interface, use something
# like this, substituting the bdaddr of the interface:
# HIDD_OPTIONS="-i AA:BB:CC:DD:EE:FF --server"
#
# remove '--master' if you're having trouble working with Ericsson
# T630 phones with hidd operational at the same time.

############ DUND
#
# Run dund -- this allows ppp logins. 1 for enabled, 0 for disabled.
DUND_ENABLED=0

# Arguments to dund: defaults to acting as a server
DUND_OPTIONS="--listen --persist"

# Run dund --help to see the full array of options.
# Here are some examples:
#
# Connect to any nearby host offering access
# DUND_OPTIONS="--search"
#
# Connect to host 00:11:22:33:44:55
# DUND_OPTIONS="--connect 00:11:22:33:44:55"
#
# Listen on channel 3
# DUND_OPTIONS="--listen --channel 3"

# Special consideration is needed for certain devices. Microsoft
# users see the --msdun option. Ericsson P800 users will need to
# listen on channel 3 and also run 'sdptool add --channel=3 SP'

############ PAND
#
# Run pand -- ethernet: creates new network interfaces bnep
# that can be configured in /etc/network/interfaces
# set to 1 for enabled, 0 for disabled
PAND_ENABLED=0

# Arguments to pand
# Read the PAN howto for ways to set this up
# http://bluez.sourceforge.net/contrib/HOWTO-PAN
# in later versions of pand it used to execute /etc/bluetooth/pan/dev-up
# automatically, now you will need to use the --devup/--devdown options. See
# the pand manpage for more informations
PAND_OPTIONS=""

# example pand lines
#
# Act as the controller of an ad-hoc network
# PAND_OPTIONS="--listen --role GN"
#
# Act as a network access point: routes to other networks
# PAND_OPTIONS="--listen --role NAP"
#
# Act as a client of an ad-hoc controller with number 00:11:22:33:44:55
# PAND_OPTIONS="--role PANU --connect 00:11:22:33:44:55"
#
# Connect to any nearby network controller (access point or ad-hoc)
# PAND_OPTIONS="--role PANU --search"

############ SDPTOOL
# this variable controls the options passed to sdptool on boot, useful if you
# need to setup sdpd on boot.
# options are ;-separated, i.e. for every ; an sdptool instance will be
# launched
#
# examples:
# SDPTOOL_OPTIONS="add --channel=3 SP" # ericsson P800 serial profile
# SDPTOOL_OPTIONS="add --channel=8 OPUSH ; add --channel=9 FTRN" # motorola
# # object push and file transfer
SDPTOOL_OPTIONS=""

Final Edit /etc/rc.local

# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

hciconfig hci0 reset
hciconfig hci0 class 0x082580 <<-- This (as shown below) will set Service Classes: Capturing and Device Class: Peripheral, Pointing Type: USB
BD Address: 00:1B:FB:8A:79:88 ACL MTU: 1021:6 SCO MTU: 64:1
UP RUNNING PSCAN ISCAN
RX bytes:279252 acl:18271 sco:0 events:480 errors:0
TX bytes:1385 acl:9 sco:0 commands:55 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: ACCEPT MASTER
Name: 'XXXXX-000010011'
Class: 0x082580
Service Classes: Capturing
Device Class: Peripheral, Pointing device
HCI Ver: 2.1 (0x4) HCI Rev: 0x38 LMP Ver: 2.1 (0x4) LMP Subver: 0x213d
Manufacturer: Broadcom Corporation (15)

and hidd --show should reveal
# hidd --show
00:02:76:07:68:1C Sony Corporation (3) Button Mouse [0a5c:0001] connected

But the damn mouse didn't move!!! "/dev/input/mouse5"
# "us"
EndSection

Section "InputDevice"
Identifier "Alps Touchpad"
Driver "true"
Option "Device" "/dev/input/event11"
Option "Protocol" "Configured Monitor"
EndSection

It now works every time, I am still working on the remote...

Here is my hardware:
# hcitool info 00:02:76:07:68:1C
Requesting information ...
BD Address: 00:02:76:07:68:1C
Device Name: VGP-BMS33
LMP Version: 1.2 (0x2) LMP Subversion: 0x229
Manufacturer: Broadcom Corporation (15)
Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00

# hcitool info 00:01:90:E2:49:BD
Requesting information ...
BD Address: 00:01:90:E2:49:BD
Device Name: VGP-BRMP10
LMP Version: 2.0 (0x3) LMP Subversion: 0x10b7
Manufacturer: Cambridge Silicon Radio (10)
Features: 0xfc 0x07 0x86 0x7e 0x18 0x18 0x00 0x00


Comments