Author Topic: [SOLVED] Bluetooth - Guru help needed  (Read 22277 times)

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
[SOLVED] Bluetooth - Guru help needed
« on: February 10, 2013, 11:47:04 am »
Following my success in installing bluetooth (!) ... I've run into an irritating connection problem.

Rather than post all the gory details, can I just ask if there's anybody here who is a bluetooth expert, or guru, who might be able to advise?

Essentially, it's an auto reconnect issue with a bt headset/speaker.
« Last Edit: February 15, 2013, 03:25:01 pm by castalla »

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
  • Karma: +15/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #1 on: February 10, 2013, 10:52:00 pm »
What software are you using?
http://code.google.com/p/bluez-tools/ ?

How are you connecting?

Suggest try some of the tips here
https://wiki.archlinux.org/index.php/Bluetooth_Headset
https://wiki.archlinux.org/index.php/Bluetooth

Note - pacman is the distribution specific installer for archlinux (similar to apt-get install XXX).  If you already have Bluetooth installed, just follow the bits / check the instructions for making bluetooth audio work.

eg check you've added stuff to the conf files etc.

Steps are something like below:

#Find your device
hcitool  scan

#link with it (only needed once)
bluez-simple-agent

edit the asound.conf to add device XX:XX:XX... replace with your devices id.

Code: [Select]
#/etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           device XX:XX:XX:XX:XX:XX
           profile "auto"
       }   
   }   
   hint {
       show on
       description "BT Headset"
   }   
}
ctl.btheadset {
  type bluetooth

#check to see it exists
aplay -L

If that fails, try the steps mentioned - eg use audio sink instead of headset etc.

Also, paste a dmesg of relevant lines when it fails.
And logs of the bluetooth daemon

#Stop bluetooth.  Run it manually
sudo stop bluetooth
sudo /usr/sbin/bluetoothd -n -d

(See what is happening when it retries to connect)


There is a known bug with some versions of bluez - discussed here
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/972063

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #2 on: February 11, 2013, 07:37:24 am »
In short been here , done that ... not much help or advice anywhere.

Here are the problems:

1.  Using a cheap dongle ( TOPDIGI UA01 ) I can connect to Logitech bt speaker and a cheap bt speaker.  Invariably when I switch the speaker off, then the Cubie (and Pi) lose ethernet network connectivity.  Have to reboot.  The Cubie seems marginally more resilient to this crashing than the Pi.

2.  Using a Conceptronic dongle I can connect to cheap speaker - switch speaker on and off - no crash.

3.  The Conceptronic refuses to pair with the Logitech - it scans it, but bluez-simple-agent immediately returns an Authorizaton Failed error.  That's it - no settings of dongle, or audio.conf, etc. make any difference.   Seems the dongle is utterly incompatible with the Logitech.

I can't find any info on this type of error

Both dongles report the same chipset, etc. 

I've spent at least a 100 hrs on this - switching dongles, googling, dmesg listings, etc.

I'm reluctant to buy another dongle to find it doesn't work!     

I'll try the Conceptronic in another Linux PC to see how that reacts.

I've no idea where the problem lies - bluetooth 4.99, bluez, linux kernel, dongles, speakers - too many confounding variables!

I'll report back here if I encounter any breakthroughs or additional meaningful info.




Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #3 on: February 11, 2013, 11:56:44 am »
Just tried pairing in Linux Mint with bluez - same problem with Conceptronic dongle - Authorization Failed.

Using bluetooth manager also fails to connect the speaker.

Anybody know of a bullet-proof bt dongle???

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
  • Karma: +15/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #4 on: February 11, 2013, 02:12:46 pm »
The dmesg pastes would help.

I've given some tips, without further info from you can't really assist.

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #5 on: February 11, 2013, 02:15:39 pm »
Okay - I'll get round to it ... but run into another problem (see new post on mp3)

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #6 on: February 11, 2013, 05:22:06 pm »
Where does the bluetoothd -d output go ?

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #7 on: February 11, 2013, 06:24:02 pm »
Here's the bluetooth output:

bluez-simple-agent reports Authorization Failed

Code: [Select]
bluetoothd[2441]: serial/proxy.c:proxy_register() Registered interface

org.bluez.SerialProxyManager on path /org/bluez/2441/hci0
bluetoothd[2441]: src/adapter.c:btd_adapter_ref() 0xb703ccb0: ref=5
bluetoothd[2441]: sap/manager.c:sap_server_probe() path /org/bluez/2441/hci0
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10000
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 64
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000003-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000112d-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001204-0000-1000-8000-00805f9
bluetoothd[2441]: sap/server.c:sap_server_register() Listen socket 0x15
bluetoothd[2441]: audio/manager.c:headset_server_probe() path

/org/bluez/2441/hci0
bluetoothd[2441]: src/adapter.c:btd_adapter_ref() 0xb703ccb0: ref=6
bluetoothd[2441]: audio/manager.c:audio_adapter_ref() 0xb703df60: ref=1
bluetoothd[2441]: audio/manager.c:headset_server_init() audio.conf: Key file does

not have key 'Master'
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10001
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 64
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000003-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001108-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001112-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001203-0000-1000-8000-00805f9
bluetoothd[2441]: audio/headset.c:headset_config_init() audio.conf: Key file does

not have key 'SCORouting'
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10002
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 64
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000003-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000111e-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000111f-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001203-0000-1000-8000-00805f9
bluetoothd[2441]: audio/manager.c:a2dp_server_probe() path /org/bluez/2441/hci0
bluetoothd[2441]: audio/manager.c:audio_adapter_ref() 0xb703df60: ref=2
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have

group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have

group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have

group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have

group 'A2DP'
bluetoothd[2441]: audio/avdtp.c:avdtp_init() audio.conf: Key file does not have

key 'Master'
bluetoothd[2441]: audio/avdtp.c:avdtp_register_sep() SEP 0xb703ed38 registered:

type:0 codec:0 seid:1
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10003
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 72
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000019-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000110a-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000110d-0000-1000-8000-00805f9
bluetoothd[2441]: audio/manager.c:avrcp_server_probe() path /org/bluez/2441/hci0
bluetoothd[2441]: audio/manager.c:audio_adapter_ref() 0xb703df60: ref=3
bluetoothd[2441]: audio/avrcp.c:avrcp_register() audio.conf: Key file does not

have key 'Master'
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10004
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 72
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000017-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000110c-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000110e-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10005
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 72
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000017-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

0000110e-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Adding record with

handle 0x10006
bluetoothd[2441]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[2441]: plugins/hciops.c:update_service_classes() hci0 value 74
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000003-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00000100-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001002-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001103-0000-1000-8000-00805f9
bluetoothd[2441]: src/sdpd-service.c:add_record_to_server() Record pattern UUID

00001201-0000-1000-8000-00805f9
bluetoothd[2441]: plugins/adaptername.c:adaptername_probe() Setting name

'squeezeplug-0' for device 'hci0'
bluetoothd[2441]: plugins/hciops.c:hciops_set_name() hci0, name squeezeplug-0
bluetoothd[2441]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[2441]: Could not get the contents of DMI chassis type
bluetoothd[2441]: plugins/hciops.c:hciops_unblock_device() hci0 dba

00:00:00:00:00:00
bluetoothd[2441]: plugins/hciops.c:hciops_load_keys() hci0 keys 0 debug_keys 0
bluetoothd[2441]: Unable to load keys to adapter_ops: Function not implemented

(38)
bluetoothd[2441]: plugins/hciops.c:hciops_get_conn_list() hci0
bluetoothd[2441]: src/manager.c:btd_manager_register_adapter() Adapter

/org/bluez/2441/hci0 registered
bluetoothd[2441]: src/adapter.c:btd_adapter_ref() 0xb703ccb0: ref=7
bluetoothd[2441]: plugins/hciops.c:hciops_set_dev_class() hci0 major 1 minor 0
bluetoothd[2441]: audio/manager.c:state_changed() /org/bluez/2441/hci0 powered on
bluetoothd[2441]: audio/telephony.c:telephony_init()
bluetoothd[2441]: audio/headset.c:telephony_ready_ind() Telephony plugin

initialized
bluetoothd[2441]: audio/headset.c:print_ag_features() HFP AG features: "Ability

to reject a call" "Enhanced call status" "Extended Error Result Codes"
bluetoothd[2441]: plugins/hciops.c:hciops_disable_cod_cache() hci0 cache_enable 1
bluetoothd[2441]: plugins/hciops.c:hciops_disable_cod_cache() hci0 current_cod

0x000000 wanted_cod 0x4a0100
bluetoothd[2441]: plugins/hciops.c:write_class() hci0 class 0x4a0100
bluetoothd[2441]: Adapter /org/bluez/2441/hci0 has been enabled
bluetoothd[2441]: plugins/hciops.c:hciops_set_discoverable() hci0 discoverable 0
bluetoothd[2441]: plugins/hciops.c:hciops_set_pairable() hci0 pairable 1
bluetoothd[2441]: src/adapter.c:btd_adapter_unref() 0xb703ccb0: ref=6
bluetoothd[2441]: plugins/hciops.c:read_local_ext_features_complete() hci0 status

0
bluetoothd[2441]: plugins/hciops.c:read_tx_power_complete() hci0 status 0
bluetoothd[2441]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[2441]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[2441]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[2441]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[2441]: plugins/hciops.c:read_simple_pairing_mode_complete() hci0

status 0
bluetoothd[2441]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[2441]: plugins/hciops.c:read_scan_complete() hci0 status 0
bluetoothd[2441]: plugins/hciops.c:hciops_set_limited_discoverable() hci0 limited

0
bluetoothd[2441]: src/adapter.c:adapter_mode_changed() old 0x00 new 0x02
bluetoothd[2441]: src/adapter.c:set_mode_complete()
bluetoothd[2441]: src/adapter.c:adapter_create_device() 10:B7:F6:00:46:40
bluetoothd[2441]: src/device.c:device_create() Creating device

/org/bluez/2441/hci0/dev_10_B7_F6_00_46_40
bluetoothd[2441]: src/device.c:btd_device_ref() 0xb7041bf8: ref=1
bluetoothd[2441]: src/device.c:device_set_temporary() temporary 1
bluetoothd[2441]: src/device.c:bonding_request_new() Requesting bonding for

10:B7:F6:00:46:40
bluetoothd[2441]: src/device.c:bonding_request_new() Temporary agent registered

for 10:B7:F6:00:46:40 at :1.20:/test/agent
bluetoothd[2441]: plugins/hciops.c:conn_complete() status 0x00
bluetoothd[2441]: src/adapter.c:adapter_get_device() 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:remote_features_information() hci0 status 0
bluetoothd[2441]: plugins/hciops.c:remote_name_information() hci0 status 0
bluetoothd[2441]: plugins/hciops.c:link_key_request() hci0 dba 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:get_auth_info() hci0 dba 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:link_key_request() kernel auth requirements =

0x03
bluetoothd[2441]: plugins/hciops.c:link_key_request() Matching key not found
bluetoothd[2441]: plugins/hciops.c:io_capa_request() hci0 IO capability request

for 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:get_auth_info() hci0 dba 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:get_io_cap() initial authentication

requirement is 0x03
bluetoothd[2441]: plugins/hciops.c:get_io_cap() final authentication requirement

is 0x03
bluetoothd[2441]: plugins/hciops.c:simple_pairing_complete() hci0 status 30
bluetoothd[2441]: src/event.c:btd_event_simple_pairing_complete() status=1e
bluetoothd[2441]: plugins/hciops.c:auth_complete() hci0 status 5
bluetoothd[2441]: plugins/hciops.c:bonding_complete() status 0x05
bluetoothd[2441]: src/device.c:device_bonding_complete() bonding 0xb70392b0

status 0x05
bluetoothd[2441]: src/device.c:device_cancel_bonding() Canceling bonding request

for 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:hciops_cancel_bonding() hci0
bluetoothd[2441]: src/agent.c:agent_release() Releasing agent :1.20, /test/agent
bluetoothd[2441]: plugins/hciops.c:disconn_complete() handle 11 status 0x00
bluetoothd[2441]: src/event.c:btd_event_disconn_complete()
bluetoothd[2441]: src/adapter.c:adapter_remove_connection()
bluetoothd[2441]: src/adapter.c:adapter_remove_connection() Removing temporary

device /org/bluez/2441/hci0/dev_10_B7_F6_00_46_40
bluetoothd[2441]: src/device.c:device_remove() Removing device

/org/bluez/2441/hci0/dev_10_B7_F6_00_46_40
bluetoothd[2441]: src/device.c:btd_device_unref() 0xb7041bf8: ref=0
bluetoothd[2441]: src/device.c:device_free() 0xb7041bf8
^Z
[1]+  Stopped                 /usr/sbin/bluetoothd -n -d


Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #8 on: February 12, 2013, 04:20:33 pm »
I just bought another dongle - different manufacturer - same outcome ... auth. failed.

grrrrrrrrrr.

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
  • Karma: +15/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #9 on: February 13, 2013, 03:03:26 am »
Looking at it, looks quite straightforward -

bluetoothd[2441]: plugins/hciops.c:link_key_request() hci0 dba 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:get_auth_info() hci0 dba 10:B7:F6:00:46:40
bluetoothd[2441]: plugins/hciops.c:link_key_request() kernel auth requirements = 0x03
bluetoothd[2441]: plugins/hciops.c:link_key_request() Matching key not found

You haven't put the key (password) in the config file.

---

This does tie into the other errors, which also pretty much say the same thing:

 audio.conf: Key file does not have key 'Master'
 audio.conf: Key file does not have key 'SCORouting'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have group 'A2DP'
bluetoothd[2441]: audio/a2dp.c:a2dp_register() audio.conf: Key file does not have group 'A2DP'
bluetoothd[2441]: audio/avdtp.c:avdtp_init() audio.conf: Key file does not have key 'Master'
bluetoothd[2441]: audio/avdtp.c:avdtp_register_sep() SEP 0xb703ed38 registered:


Suggest check your audio.conf file has the correct bits, as we can see from the errors, that the driver definitely thinks it doesn't.


Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
  • Karma: +15/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #10 on: February 13, 2013, 03:17:15 am »
I should also add that you're using an A2DP device, so make sure that your Bluetooth audio.conf is appropriately configured.


Link the device (where XX is the bluetooth id of the device)
Code: [Select]
bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX
bluez-test-device trusted XX:XX:XX:XX:XX:XX yes


Edit the config file
Code: [Select]
pico /etc/bluetooth/audio.conf
Look for [General]
Make sure you enable ad2p by adding appropriate config and bluetooth config
Code: [Select]
Enable=Source,Sink,Media,Socket
Master=true
SCORouting=PCM
AutoConnect=true

Restart the bluetooth service.
Code: [Select]
/etc/init.d/bluetooth restart

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #11 on: February 13, 2013, 04:54:50 am »
Quote
You haven't put the key (password) in the config file.

Thanks for the details.   

But which config file are you referring to, where I can add the passkey?

 


Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #12 on: February 14, 2013, 04:27:08 am »
I forgot to add the hcidump:

Code: [Select]
HCI sniffer - Bluetooth packet analyzer ver 2.4
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 10:B7:F6:00:46:40 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 10:B7:F6:00:46:40 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 11
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 11
    Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x83
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 11 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 10:B7:F6:00:46:40 mode 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 11 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 10:B7:F6:00:46:40 mode 2 clkoffset 0x0000
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 10:B7:F6:00:46:40 name 'Mini Boombox'
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 11
> HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
    bdaddr 10:B7:F6:00:46:40
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
    bdaddr 10:B7:F6:00:46:40
> HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Negative Reply (0x01|0x000c) ncmd 1
    status 0x00 bdaddr 10:B7:F6:00:46:40
> HCI Event: IO Capability Request (0x31) plen 6
    bdaddr 10:B7:F6:00:46:40
< HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
    bdaddr 10:B7:F6:00:46:40 capability 0x04 oob 0x00 auth 0x03
    Capability: Reserved (OOB data not present)
    Authentication: Dedicated Bonding (MITM Protection)
> HCI Event: Command Complete (0x0e) plen 10
    IO Capability Request Reply (0x01|0x002b) ncmd 1
    status 0x00 bdaddr 10:B7:F6:00:46:40
> HCI Event: Simple Pairing Complete (0x36) plen 7
    status 0x1e bdaddr 10:B7:F6:00:46:40
    Error: Invalid LMP Parameters
> HCI Event: Auth Complete (0x06) plen 3
    status 0x05 handle 11
    Error: Authentication Failure
< HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 11 reason 0x13
    Reason: Remote User Terminated Connection
> HCI Event: Command Status (0x0f) plen 4
    Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x16
    Reason: Connection Terminated by Local Host

Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Bluetooth - Guru help needed
« Reply #13 on: February 14, 2013, 10:05:49 am »
Update:

using a different bt adapter with the following spec:

hci0:   Type: BR/EDR  Bus: USB
        BD Address: 00:1F:81:00:08:30  ACL MTU: 1021:4  SCO MTU: 180:1
        UP RUNNING PSCAN
        RX bytes:136610 acl:60 sco:0 events:19186 errors:0
        TX bytes:16273155 acl:19119 sco:0 commands:51 errors:0
        Features: 0xff 0x3e 0x09 0x76 0x80 0x01 0x00 0x80
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'debian-0'
        Class: 0x4e0100
        Service Classes: Networking, Rendering, Capturing, Telephony
        Device Class: Computer, Uncategorized
        HCI Version: 2.0 (0x3)  Revision: 0x44
        LMP Version: 2.0 (0x3)  Subversion: 0x3
        Manufacturer: Cambridge Silicon Radio (10)

... allows pairing, autopairing & audio

However, reliability is suspect since switching the speaker off can provoke a network crash.

--------------------------------------------------------------------------

The following adapter is NOT able to pair with the bt speaker:


hci0:   Type: BR/EDR  Bus: USB
        BD Address: 00:1B:10:00:05:94  ACL MTU: 1017:8  SCO MTU: 64:1
        UP RUNNING PSCAN
        RX bytes:1283 acl:0 sco:0 events:50 errors:0
        TX bytes:1191 acl:0 sco:0 commands:50 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: SLAVE ACCEPT
        Name: 'debian-0'
        Class: 0x4a0100
        Service Classes: Networking, Capturing, Telephony
        Device Class: Computer, Uncategorized
        HCI Version: 2.1 (0x4)  Revision: 0x5000
        LMP Version: 2.1 (0x4)  Subversion: 0x420e
        Manufacturer: Broadcom Corporation (15)

----------------------------------------------------------------------------------
 
Another dongle also fails - both the failing dongle have HCI & LMP versions 2.1.   The semi-working adapter has version 2.0





Offline castalla

  • Developer
  • Full Member
  • ***
  • Posts: 106
  • Karma: +3/-0
    • View Profile
[SOLVED] Re: Bluetooth - Guru help needed
« Reply #14 on: February 15, 2013, 03:24:24 pm »
SOLVED

Finaly, after hours, days and weeks of googling and questioning, I found the solution to the non responsive adapter issue.

The answer is here:  http://forums.gentoo.org/viewtopic-p-7238936.html#7238936

When you run the hcitool commands you may get an error message - ignore and enter the passkey in the other bluez-simple-agent window - then ctrl+c to exit.

Set the speaker address as trusted.  Restart bluetooth ... and it autopairs! 

The speaker now can be switched on and off at will - so far, no crashes.