Bug 513123

Summary: pairing of bluetooth devices does not work in user mode
Product: [openSUSE] openSUSE 11.1 Reporter: Elmar Stellnberger <estellnb>
Component: KDE4 WorkspaceAssignee: E-mail List <kde-maintainers>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P2 - High CC: aschnell, forgotten_HZylvAbnvb, jmatejek
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Elmar Stellnberger 2009-06-15 10:38:03 UTC
User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) SUSE

  If I try to pair bluetooth devices in Opensuse11.1 a password prompt pops up on the mobile phone but there is no prompt on my computer (pairing initiated by phone). No matter what you enter pairing will be rejected. Formerly there was a second popup window on the computer and pairing did suceed if the same password has been entered on both devices. This is what we call user mode pairing.
  Luckily there is still a way to pair bluetooth devices by setting the pairing mode to 'security auto' and preconfigure 'passkey "1234"' in /etc/bluetooth/hcid.conf.
  My request would be to either make pairing in user mode work again or to preconfigure passkey as 1234 because this is what most users will try to enter as a first-shot.

Reproducible: Always
Comment 1 Jan Matejek 2009-10-09 16:23:50 UTC
this bug is listed in "vital problems" of 11.2 M8, but i was not able to reproduce it.

do you still see the bug in Milestone8 ?
Comment 2 Elmar Stellnberger 2009-10-10 11:19:46 UTC
Have tried it with klbuetooth (all menupoints disabled) with kbluetooth4 and bluetooth-wizard:

kbluetooth4: first binding attempt terminated with error message: "Sorry your Bluetooth Device does not support input Service"; second attempt: phone not found any more

bluetooth: first attempt: everything seems to work fine, also the pin-exchange; nonetheless: devices not binded; i.e. my computer was not listed under binded devices on the mobile phone -> did not work either; second attempt: phone device not found any more

  I would like to manually try pairing with the phone via console; the gui programs might be erroneous; console pairing enhances our error detection facilities. Can you tell me how to manually pair a bluetooth dev??
Comment 3 Elmar Stellnberger 2009-10-10 11:21:12 UTC
.
Comment 4 Elmar Stellnberger 2009-10-10 11:21:38 UTC
.
Comment 5 Jan Matejek 2009-10-13 17:52:41 UTC
i'm not sure that it is even possible.
you can manually force the devices to connect by invoking "hcitool cc <BD_ADDR of the target device>", but the bonding process itself works automagically. failure of this magic might be the cause of the bug.
Comment 6 Jan Matejek 2009-10-13 18:30:51 UTC
okay how about this.

when i run kbluetooth4 from terminal, i see a message:
AGENT registered !

if i initiate the pairing from the phone, a dialog window pops up and asks me for the pin.
messages in terminal:

$ kbluetooth4
AGENT registered !
AGENT-RequestPinCode  "/org/bluez/3839/hci0/dev_00_18_13_BA_56_5A"
Object::connect: No such signal Solid::Control::BluetoothRemoteDevice::nodeCreated(const QString &)
Object::connect: No such signal Solid::Control::BluetoothRemoteDevice::nodeRemoved(const QString &)
pinCode  "2222"

which all makes sense - kbluetooth4 registered an agent, agent was asked for a pincode by the BT stack, then some stuff about disconnected signals, and finally the obtained pin code.

can you please do what i did and post what goes on in your console?
Comment 7 Elmar Stellnberger 2009-10-13 19:02:22 UTC
> hcitool scan
Scanning ...
        00:0E:ED:52:74:84       Nokia 6230
> hcitool cc 00:0E:ED:52:74:8
>
... looks as if both devices were already coupled; nonetheless my notebook does not appear in the section of coupled devices then.
(am currently re-testing with kernel-2.6.31.1-3-desktop and kbluetooth4 as you wished.)
Comment 8 Elmar Stellnberger 2009-10-13 19:22:39 UTC
  Initiating the pairing from the phone under a kde4-desktop running kbluetooth4 after having set my computer as discoverable is the only thing that does currently work at me.
  Under kde3, kbluetooth has disabled all menu points and trying to enable the pairing from the phone swallows the pin-exchange dialogue (infunctional); all of this has already worked well for openSuSE 11.0.
  Initiating the pairing from the phone may be undesirable since you have to set your computer as discoverable for this.
  Last but not least gnome users will not be happy with kbluetooth4: should run with bluetooth-wizard as well.
Comment 9 Elmar Stellnberger 2009-10-14 10:43:07 UTC
final test results:

kde4 & gnome: pairing can be initiated from phone (discoverability must be set)
gnome: pairing works well from both sides with panel applet
kde3: broken; both,  xfce: not implemented
standalone app. for other desktop environments: bluetooth-wizard - repairing impossible if pairing has been deleted f.i. by accident on mobile phone.

sub-issues, upstreams:

bluetooth-wizard:
remove old pairing: https://bugzilla.gnome.org/show_bug.cgi?id=598385
set discoverability: https://bugzilla.gnome.org/show_bug.cgi?id=598386

kbluetooth4:
initiate pairing from computer: https://bugs.kde.org/show_bug.cgi?id=210527
Comment 10 Elmar Stellnberger 2009-10-14 10:54:09 UTC
  The only little thing that in my mind remains to be done for the distro is a fallback for other desktop environments to let the pairing be initiated from the phone as long as the initiation from the computer does often not work. Knowing a console command to set the computers visibility (discoverability) would be a goog thing either; have already removed it from vital/important issues though.
Comment 11 Jan Matejek 2009-10-14 18:00:20 UTC
as i see it, it pretty much goes like this:

GNOME: it works (you can initiate pairing from bluetooth-applet and configure stuff in bluetooth-properties, which are accessible from bluetooth-applet)

KDE4: bug in kbluetooth4 doesn't allow computer initiated pairing, but it works if pairing is initiated from phone.
also, did you try to actually do anything that requires pairing? perhaps it would initiate pairing automatically (i know GNOME does that)
note that you can push files to remote device without pairing.

KDE3: broken, but afaik we don't support that anymore, so if there is trouble, you'd better turn to the people who maintain it in buildservice (which is not me nor kde-maintainers who are currently assigned to this bug)

OTHERS: no functionality.

(In reply to comment #10)
> fallback for other desktop environments to let the pairing be initiated from
> the phone as long as the initiation from the computer does often not work.

http://wiki.bluez.org/wiki/HOWTO/Bonding this might be of interest
also, bluez-test package contains simple-agent script that apparently registers itself as the agent and then asks you for pin in the console

> Knowing a console command to set the computers visibility (discoverability)
> would be a goog thing either
enable:
hciconfig piscan
disable:
hciconfig noscan
see man hciconfig for other interesting commands

do you think that this bug can be closed now (or resolved UPSTREAM for the kbluetooth4 issue) ?
Comment 12 Elmar Stellnberger 2009-10-14 20:25:45 UTC
hciconfig piscan: Does not enable visibility; wrote an email to developers

passkey-agent: Should be provided by bluez-utils but actually isn`t. As far as I got it that little program should allow phone initiated pairings. However the python-example at http://wiki.bluez.org/wiki/PasskeyAgent does not work at me (UnknownMethod RegisterDefaultPasskeyAgent). http://bugs.archlinux.org/task/12851 says that the program should have been replaced by simple-agent or agent.c - can not find these programs either. Mandriva 2009 and PCLinuxOS provide simple-agent.

So wanna mark it 'resolved upstreams' as soon as passkey-agent is packaged (should be available as .c as well).
Comment 13 Jan Matejek 2009-10-15 09:02:30 UTC
simple-agent is part of the bluez-test package
Comment 14 Elmar Stellnberger 2009-10-15 10:56:20 UTC
yippee; everything all right;
marking resolved upstreams.
Comment 15 Elmar Stellnberger 2010-01-19 17:15:22 UTC
*** quick info ***
 Everything about bluetooth pairing can from now on be found at http://www.elstel.com/Handy.html or at http://www.elstel.com/MobilePhone.html respectively. Even more far-reaching topics like synchronization and data transfer via OBEX will be covered.