LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2009, 08:23 AM   #1
gpecke
LQ Newbie
 
Registered: Jul 2009
Location: Melbourne Aust
Distribution: Debian
Posts: 6

Rep: Reputation: 0
Bluetooth Pairing - hci cc fails, but rfcomm connect works


Attempting to pair with a bluetooth device

>a=01:23:45:67 ; hcitool cc $a # would not connect

but

>rfcomm bind $a
>rfcomm connect hci0 $a
>rfcomm release /dev/rfcomm0
>rfcomm connect hci0 $a

worked perfectly

The same usb bluetooth dongle , with the same bluetooth/bluez version (4.3),
compiled kernel (2.6.30.1) and phone worked perfectly with hci-tools on another pc. I tried copying all config files (including /var/lib/bluetooth) from the working pc to no avail.

This behaviour with the same hcidump output is described exactly on another unanswered post,
http://forums.fedoraforum.org/archiv.../t-193320.html.

Has anyone an idea what might cause such behaviour.
 
Old 07-19-2009, 09:21 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I'm not sure where the problem is then. If you can connect and pair with RFCOMM, then what do you need to use "hcitool cc" for? Which services are you using that you can't connect directly with?
 
Old 07-19-2009, 05:58 PM   #3
gpecke
LQ Newbie
 
Registered: Jul 2009
Location: Melbourne Aust
Distribution: Debian
Posts: 6

Original Poster
Rep: Reputation: 0
All the services work using the link set up with rfcomm.

It seems untidy to need to to explicitly connect using rfcomm as root rather than use the normal automatic mechapinnism with bluetoothd.

It took a lot of experimenting and searching to get the connection to work. Issues like this make it hard to get a system going "out of the box", so if the bug can be documented, or better, fixed, it would
make it easier for the next user.

If no-one has already found or knows an answer to this, I'll eventually spend a bit more time, and try to pinpoint the problem.
If I can determine why hci does not work I'll put in a bug report.
 
Old 07-19-2009, 09:39 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
BlueZ will establish the connection when you actually use a service, you shouldn't need to pre-connect with "cc". So for example when you try to push a file to the phone with obexftp, it would connect as soon as you run the command and then disconnect once it has been transferred. You don't need to setup a link before running a service.

It isn't a bug, that is how it is setup to work. Bluetooth devices don't remain constantly linked like WiFi or other protocols, as it would drain the battery too fast on mobile devices.

So if you are able to connect with RFCOMM, then obviously the pairing process has succeeded. All you should have to do is run whatever service you want to use and it will automatically connect. If not, what error do the individual services report?
 
Old 07-20-2009, 02:57 AM   #5
gpecke
LQ Newbie
 
Registered: Jul 2009
Location: Melbourne Aust
Distribution: Debian
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for your help.

I cannot explain the reason that "hcitool cc" would not, and still won't, connect (or more,connects, and then disconnects deliberately shortly afterwards).

The reason bluetoothd/hcid would not automatically connect was because of the stored data in the Nokia 2760 handdset. I was using the same dongle and passcode as on the first pc, but the hostname (used as part of the ID) was, of course , different. Hence the reason for the different behaviour on the two PC's. When I deleted the ID of the first PC , it was possible to recognize the new host and then set up to pair automatically.

Thanks very much for you help. Once I understood how the connection process worked a bit better I was able to track down the problem. I am now able to use connection automatically again on the new pc.

I found the upgrade to bluetooth 4.3 somewhat disconcerting, since the names and configuration have been changed, and the manual pages are not yet up to date.
 
Old 07-20-2009, 03:55 PM   #6
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
To be perfectly honest, I have never gotten "hcitool cc" to work with any of my hardware on any computer. I am not sure what it's function is, as it always either returns nothing or spits back a vague error message. It could just be a hold-over from older versions of the library or older Bluetooth revisions. I see old guides and documentation refer to it, but newer software uses the more advanced APIs to manage connections, or at least connect on a per-service basis.

The BlueZ 4.x branch is still a bit difficult to work with as it is undergoing a lot of changes in a short amount of time. Hopefully the documentation will soon catch up and developers will begin working on more software that supports it. But until then, it can be a pain.

Last edited by MS3FGX; 07-20-2009 at 03:56 PM.
 
  


Reply

Tags
bluetooth, cc, fails, hci



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bluetooth pairing deadlinx Ubuntu 15 08-02-2009 03:26 PM
Bluetooth won't start on Fedora 8 dist - HCI and RFCOMM issues Moo Linux - Newbie 1 02-06-2009 06:42 AM
Bluetooth works, rfcomm doesn't Hangdog42 Slackware 2 09-09-2008 05:56 PM
Bluetooth pairing jmike72 Linux - Hardware 2 01-06-2008 09:08 AM
bluetooth pairing meknb Linux - Hardware 0 01-05-2006 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration