Can't pair PC with mobile using bluetooth, suspecting dbus problem.
I already whined a little in this thread but I originally made the thread for a different problem, also this doesn't seem to be slackware specific.
So my objective is to get bluetooth working between my Slackware 11.0 and my SonyEricsson W810i so I could sync my contacts, todos and appointments between SonyEricsson and Kontact. So far I've reached a point where my USB bluetooth dongle works, I can ping my phone, I can even use obex push but I can't pair the phone with pc which seems to be needed by KMobileTools. So here's what I've done so far and what doesn't work. I downloaded and compiled from source the following programs in that order: dbus-1.0.2 bluez-libs-3.9 bluez-utils-3.9 openobex-1.3 kdebluetooth-1.0_beta2 kmobiletools-0.5_beta1 So far so good. So I started configuring stuff. First I activated my dongle with Code:
hciconfig hci0 up Code:
hcitool scan I couldn't connect to my phone with rfcomm connect or hcitool cc nor access any other services (All these resulted in the phone wanting to pair, I could enter pin from phone but nothing happened in pc and pairing timed out). I also couldn't pair with KDE Pairing Wizard. It found my phone but when looking for available services it froze and had to be killed. So i started testing stuff and found out that when running hcid with option -n that should keep it from forking and running in backround, I get the error Code:
hcid[2226]: Bluetooth HCI daemon Is it even possible that dbus is the problem here or is there something else. I would be really grateful if someone could at least lead me in the right direction. I'm getting pretty tired already and I'm not sure I included everything in this post that was necessary, if you need to know more about something feel free to ask. |
what's the output of hciconfig ?
|
I'm not in linux right now but it listed the dongle (hci0) it's MAC address and all the options (all of them I've tried to change without any gain: auth, encrypt, secmgr, pscan and iscan as I remember it). If needed I'll check for sure in a few.
|
Quote:
However, since you have already verified that, your problem is obviously not related to mine. |
Thanks for trying anyway. Which of these options are necessary for pairing then?
|
Hi,
I paired in the other direction, I connected from the phone to bluez and for that you need pscan and iscan enabled. Those would be ignored from hcid.conf. After I added them manually they would randomly be removed again when bluez made inquiries for other devices. That's why I downgraded. I have no idea what causes your problem, sorry. Maybe you can narrow down the problem by checking your syslog for other error messages of hcid. Try cat /var/log/syslog | grep hcid. If everything is fine, then it's very likely that dbus is the problem. Maybe reinstalling dbus helps. |
The log was clean. If I try to pair with the PC with only pscan and iscan then the phone looks for the PC forever until I kill the connection. If I enable auth it times out instead. I've reinstalled dbus and all the other components including Slackware itself too many times already. I guess I'll try older versions of things then.
God I need some sleep, I have to get it running by Friday though. Seriously, if you have any idea what to try, even if you don't have a clue about anything, still post it. I'm pretty much willing to try everything now. |
It can't be dbus problem. Only logical things to blame are the dongle or my own stupidity.
I took a clean old IBM computer, installed slack 11 on it. Compiled a custom 2.6.16.43 kernel. Then I installed dbus 1.0.2, bluez-libs 3.9 and bluez-utils 3.9. That's the point where all should work as I've gotten to understand it but no, everything's the same. I can scan and see the mobile. I just can't pair with it. It's starting to drive me a little crazy. Is there some very important installation step that I'm missing or what? The dongle actually can't be the problem since IT WORKS but I just can't pair. Has to be my own fault somehow, just don't understand what I'm doig wrong. |
Quote:
passkey-agent --default /etc/bluetooth/pin.sh Maybe try this and see if this has any impact. If not maybe do a test install of another distribution and see if it works there. If not try another dongle and make sure that your dongle is actually not the problem. I myself have 2 epox dongles and 1 msi class 1 dongle and the same phone as you, all works perfect including kmobiletools. |
Now that you mention it, I think I remember that in some point I saw "pin_helper not reconized" or the like somewhere. Will try right now...
edit: Actually, what is this "passkey-agent". If it's some program then I didn't get it with bluez libs nor utils. Or sould it go to the hcid.conf? Oh one more thing almatic. If everything works for you, could you try restarting hcid with Code:
hcid -ndsf /etc/bluetooth/hcid.conf My output: Code:
root@SERVER:/etc/bluetooth# hcid -ndsf /etc/bluetooth/hcid.conf edit3: Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# passkey-agent --default /etc/bluetooth/pin.sh Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# slocate passkey-agent Otherwise it seems, that this really is the problem. Googling for passkey-agent I found some similar pairing problems that all started working after using it. So now I only have to find it :rolleyes: . |
Finally got the passkey-agent executed but it didn't help. I was almost sure that this was the problem, don't know what to try anymore.
Actually I just realized that lsusb lists the dongle as "Broadcom corp." But it's A-link. I thought that A-Link adapters are made by Broadcom or something, if that isn't so then that might be the problem. I'm going to try to figure that out now. edit: I just noticed that passkay-agent gave the error: "Can't get on system bus". That's still dbus, no? |
I'm really sorry for the constant bumping but I'm really a bit desperate. Could anyone try the buetooth setup on their system using only the exact same software as I? I would really like to know what that all is about.
|
yeah me too on ur side... trying with a sony Ericsson k750i from past two weeks.
i didnt see any error in my syslogs. file transfer from notebook to phone is smooth. but when i am trying to pair, thats it.... phone ask for pin, after that no reply from notebook. :confused: am quite tired of this. i am reading all the posts which google shows me regarding this problem. but still couldn't fix it. becoz of this i am using openSuse10.2 for connecting to internet. |
Something new here. Found /usr/local/etc/rc.d/rc.messagebus and started it with
Code:
/usr/local/etc/rc.d/rc.messagebus start hcid: Code:
root@SERVER:~# hcid -nsd Code:
root@SERVER:~# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 0000 Quote:
|
maybe your bluetooth settings are messed up?
try clear all the files in /var/lib/bluetooth, then restart dbus and hcid. as far as i can tell, the /etc/bluetooth/hcid.conf becomes useless after the first run, as all persistent settings are stored under /var/lib/blueooth/[btaddr] |
Quote:
Code:
hcid -f /etc/bluetooth/hcid.conf edit: No files in /var/lib/bluetooth edit2: Today is probably the last day I'll be able to work with this problem. I'm going to reinstall Slackware on the box and when installing bluetooth I'll be using a different version of d-bus. Let's see if that'll work. |
Alright progress.
Reinstalled everything. After slackware came dbus. This time I used options Code:
--localstatedir=/var Is there a way to make it work without passkey-agent, if no how do I compile it (didn't find any settings in bluez-utils config)? What is wrong with pin_helper? If I can get answers to these questions It'll probably finally work. |
hello :)
I queried my packages and found this: Code:
tequila:/# dpkg-query -L bluez-utils | grep passkey-agent |
Allright thanks, will try.
edit: Damn, just remembered that the computer that I'm trying to use bluetooth on doesn't have KDE : D. Is there really no other way? |
there is no other way that I'm aware of, sorry. Also kdebluetooth seems to be the only package which contains passkey-agent (at least in debian packages, see below).
http://tinyurl.com/2ldrjz |
I might have been too fast. I went to the /usr/share/doc/bluez-utils/examples/ directory of my bluez-utils package, where the code of passkey agent is, and it also contains a Makefile to compile that code.
Look if you find a separate Makefile for the passkey-agent in your bluez-utils source directory. The .c-file is there for a reason. |
Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# ls Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# make Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# cat Makefile |
edit:
Quote:
Code:
root@SERVER:/usr/src/bluez-utils-3.9# ./configure | grep daemon |
there is already a binary in the directory you listed.
passkey-agent* Copy that to /usr/bin |
Yeah, I tried it earlier, but that one gave error as before:
Code:
root@SERVER:/usr/src/bluez-utils-3.9# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 0000 Should copying it to /usr/bin change anything? It basically just makes it a shortcut then, doesn't it? Well trying anyway... edit: And didn't change anything. |
Quote:
I suppose that it either needs some service, which is not installed (kdebluetoothd ?) or it's (again) a dbus problem. I don't know it though ... |
Thanks for your help nevertheless. D-bus does seem to be okay now. I'll deal with it tomorrow. Glad I made even that much progress today.
|
there is a file 'bluetoothd' in the same directory. Can you try to start thtat service and then again register the passkey agent. I cannot try because I don't seem to have bluetoothd ...
|
After starting bluetoothd with
Code:
root@SERVER:~# /usr/src/bluez-utils-3.9/daemon/bluetoothd start Code:
root@SERVER:~# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 0000 |
make sure that bluetoothd can parse its config-file (bluetooth.conf). Look if bluetoothd -h (or --help) gives you info, or look for a manpage for bluetoothd. Also take a look at bluetooth.conf. If you cannot find any info on bluetoothd, just try something like this:
/usr/src/bluez-utils-3.9/daemon/bluetoothd /usr/src/bluez-utils3.9/daemon/bluetooth.conf |
Unfortunately didn't work out.
bluetoothd has following options: Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/bluetoothd --help Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/bluetoothd --debug --nodaemon Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# man -k bluetooth Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/bluetoothd /usr/src/bluez-utils-3.9/daemon/bluetooth.conf I'll see what else I can try. |
I guess you have already tried the option 'passkey "0000";' in the hcid.conf. This was default in my hcid.conf. This is my hcid.conf.
Code:
options { I'm running out of ideas. |
Yeah, my hcid is basically identical to yours:
Code:
root@SERVER:~# cat /etc/bluetooth/hcid.conf edit: Also desktopless isn't really a problem. All was same on the other computer with kde installed. It's eighter some incompability in current slackware/kernel/bluez or I'm doing something very wrong. |
It's been 6 days now without a response from the mailing list, so I figured I'll go for another bump. More specifically, I was comparing my actions with drkstr's howto. It might be a little outdated but I was wondering about the existance of rc.bluetooth. I didn't have anything like that in my system. From where exactly is it installed and is it also necessary in the current bluez version?
Also, when I get a little free time today or in couple of next days, I'll do a full system reinstall again documenting every single thing I do. Hopefully someone will have a little time to look over it and see, if anything's wrong there. Maybe even better, try to duplicate the problem. |
So here goes, every single step:
I make sata.i, install.1, install.2 and network.dsk disks on this desktop computer, all downloaded from the local linux ftp and up to date. Reboot server, insert disk, slack starts booting. I don't give any boot options just press enter, also through the two install disks. When I can finally log in as root, I do that and run Code:
fdisk /dev/hda Code:
p Code:
w It's as follows: primary partitions: hda1- /- 1GB hda2- extended- 9GB rest are logical inside hda2 hda5- swap- 512MB hda6- /usr- 3GB hda7- /home- 5.5GB then I start configuring network since I'm going to use NFS install: Code:
network so Code:
setup start installing from NFS all the slackware packages are on this desktop computer, checked to be up to date I select everything exept KDE related stuff, X window things and games. Installs... I use the 2.4.33.3 kernel from bootdisk, configure lilo to boot from /dev/hda1, disable most services exept ssh, CUPS, and some defaults, change root's password and complete the install, I don't remember if there was anything more intresting, I guess not. So I reboot and take the monitor and keyboard back to my desktop computer. The server now runs only with power, network and printer connections + bluetooth dongle. I ssh to server from my computer: first, new kernel. Code:
root@SERVER:~#wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.7.tar.gz Code:
make oldconfig good to go: I modify lilo.conf to use old kernel too Code:
root@SERVER:/usr/src/linux# cat /etc/lilo.conf Code:
make Code:
root@SERVER:/boot# ls -l Code:
root@SERVER:/boot# reboot I use lynx to get latest dbus, bluez-utils and bluez-libs from their respective sites. That's dbus-1.0.2, bluez-libs-3.9 and bluez-utils-3.9. Alrighty: Code:
root@SERVER:~# ls *.tar.gz Code:
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc Code:
root@SERVER:/usr/src/dbus-1.0.2# cd ../bluez-libs-3.9/ Code:
root@SERVER:/usr/src/bluez-libs-3.9# cd ../bluez-utils-3.9/ I configure hcid.conf like this: Code:
root@SERVER:/etc/bluetooth# cat /etc/bluetooth/hcid.conf Code:
adduser messagebus I also give all rights of /var/run/dbus to it Code:
root@SERVER:~# chown messagebus:users /var/run/dbus so let's bring up the dongle Code:
root@SERVER:~# hciconfig hci0 up Code:
root@SERVER:~# hciconfig hci0 piscan auth secmgr encrypt I use my cell now to look for available bluetooth devices. It finds BCM2045. Ah right, forgot to restart hcid: Code:
hcid -f /etc/bluetooth/hcid.conf Code:
root@SERVER:~# hcid -nsd Code:
root@SERVER:~# /etc/rc.d/rc.messagebus start Code:
hcid -f /etc/bluetooth/hcid.conf Code:
root@SERVER:~# hcitool scan Code:
root@SERVER:~# hciconfig hci0 down Just for kicks I try to pair from cell once. The cell waits for about half a minute and asks to enter the pin. I enter 2486 as in hcid.conf, cell waits for another half a minute and reports pairing failed. Sounds familiar. So what's next, let's mess with passkey agent a little. Code:
root@SERVER:~# slocate passkey Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 2486 Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# hciconfig hci0 down;hciconfig hci0 up piscan auth encrypt secmgr Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# hcid -nsd Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /etc/rc.d/rc.messagebus restart Wait it isn't there. It had to delete it itself somehow, whatever. Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /etc/rc.d/rc.messagebus restart Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# hcid -nsdf /etc/bluetooth/hcid.conf Whew, that was fun, why not try that again: Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 2486 Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/bluetoothd --debug --nodaemon Code:
root@SERVER:/usr/src/bluez-utils-3.9/daemon# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 2486 I lurk around the system for some time and find Code:
root@SERVER:~# cat /etc/dbus-1/system.d/bluetooth.conf |
this is some long posting :eek:
I didn't see anything wrong in your steps, at least nothing obvious. However, instead of doing the same over and over again I'd suggest changing something, so you at least come closer to what the problem is. Did you notice that slackware-current uses bluez 3.8 ? Maybe try their packages for a change (for dbus also) if you can't get forward anymore. http://slackware-current.net/package.php?id=196 |
That actually sounds pretty reasonable. Before I try though, a question about uninstalling. If I go to /usr/src/<src> and do
Code:
make uninstall I intend to start using slackware package management system soon when I finally have the time to understand how to make packages from source. Until then, I want to make sure I don't leave any garbage on my system. |
I had the very same problem (uid/gid) and passkey-agent missing,
but I manage to solve it !!! add this to /etc/passwd messagebus:x:81:81:User for D-BUS:/var/run/dbus:/bin/false and add to /etc/group messagebus:x:81: from slackware-current download dbus, bluez-packages and do ./slackbuild you will found packages in /tmp #installpgk /tmp/*.tgz now you should have dbus and all bluez packages installed: then do #sh /etc//rc.d/rc.messagebus start then in some console do #hcid -ndsf /etc/bluetooth/hcid.conf You will see: -------------------------------------- hcid[2404]: Bluetooth HCI daemon hcid[2404]: Enabling debug information hcid[2404]: HCI dev 0 registered hcid[2404]: HCI dev 0 already up hcid[2404]: Device hci0 has been added hcid[2404]: Starting security manager 0 hcid[2404]: Device hci0 has been activated hcid[2404]: Starting SDP server hcid[2404]: Adding rec : 0x807a238 hcid[2404]: with handle : 0x1 hcid[2404]: Adding rec : 0x807ebc0 hcid[2404]: with handle : 0x0 hcid[2404]: binding L2CAP socket: Address already in use hcid[2404]: Server initialization failed hcid[2404]: pin_code_request (sba=00:02:72:D1:71:B5, dba=00:04:3E:65:9A:CA) hcid[2404]: call_passkey_agent(): no agent available hcid[2404]: pin_code_request (sba=00:02:72:D1:71:B5, dba=00:04:3E:65:9A:CA) hcid[2404]: call_passkey_agent(): no agent available ------------------------------------------------------ then do # cd /tmp/bluez-utils-3.9/daemon/ # cp passkey-agent /usr/local/sbin/ # passkey-agent --default 4321 You will see: ------------------------------------- hcid[2404]: Default passkey agent (:1.7, /org/bluez/passkey_agent_13560) registered hcid[2404]: pin_code_request (sba=00:02:72:D1:71:B5, dba=00:04:3E:65:9A:CA) hcid[2404]: Calling PasskeyAgent.Request: name=:1.7, path=/org/bluez/passkey_agent_13560 hcid[2404]: link_key_notify (sba=00:02:72:D1:71:B5, dba=00:04:3E:65:9A:CA) hcid[2404]: pin_code_request (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: Calling PasskeyAgent.Request: name=:1.7, path=/org/bluez/passkey_agent_13560 hcid[2404]: link_key_notify (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: link_key_request (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: link_key_request (sba=00:02:72:D1:71:B5, dba=00:04:3E:65:9A:CA) hcid[2404]: link_key_request (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: link_key_request (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: link_key_request (sba=00:02:72:D1:71:B5, dba=00:1A:77:65:73:1D) hcid[2404]: :1.7 exited without unregistering the default passkey agent hcid[2404]: name_listener_add(:1.8) hcid[2404]: Default passkey agent (:1.8, /org/bluez/passkey_agent_13645) registered hcid[2404]: name_listener_remove(:1.8) hcid[2404]: Default passkey agent (:1.8, /org/bluez/passkey_agent_13645) unregistered hcid[2404]: name_listener_add(:1.9) hcid[2404]: Default passkey agent (:1.9, /org/bluez/passkey_agent_13647) registered ----------------------------------------------------------------------------------- now everything works :) Have fun . |
Wow, thanks dude, I'm on it.
|
Wow it's terrible. I used Slackware packages this time.
dbus 1.0.2 bluez-libs-3.8 bluez-utils-3.8 And I can't even get the messagebus to work. rc.messagebus start says it works but it doesn't Code:
root@SERVER:~# /etc/rc.d/rc.messagebus start edit: hcid can't even use -d and -s flags. zdavid, maybe I should use the versions I used before? |
Quote:
again did you add ??? - /etc/passwd messagebus:x:81:81:User for D-BUS:/var/run/dbus:/bin/false - and add to /etc/group messagebus:x:81: next thing # ps aufwx |grep `cat /var/run/dbus/dbus.pid` 81 2094 0.0 0.0 2172 772 ? Ss 20:57 0:00 /usr/bin/dbus-daemon --system I've sent you a packages for slack 11 on your email... |
I did everything as you said and I've currently got to the point where all's as before, everything works but pairing.
passkey-agent gives me Code:
root@SERVER:~# passkey-agent --default 2486 edit: pkgtool says I have it already. edit2: The user was added too, yes. |
Bump, could somone explain me the glibc 2.0 error, I don't get it.
|
Just wanted to say that I'm currently using Slackware 12.0 which has perfect bluetooth support. Thanks again.
|
Hey people, you definitely need passkey-agent.
I have spent many hours with useless fiddling with bluez on Fedora Core 6 (FC6) but there is no passkey-agent included in the regular bluez RPM packages (utils & lib 3.7). I had to install dev packages Code:
# yum --enablerepo development update bluez* Code:
passkey-agent --default 4321 Hope this helps someone... Tijn |
Do yu already have same problem with my CS-OBEXFTP tool
http://sourceforge.net/projects/cs-obexftp/ ? |
All times are GMT -5. The time now is 07:23 PM. |