LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't pair PC with mobile using bluetooth, suspecting dbus problem. (https://www.linuxquestions.org/questions/linux-software-2/cant-pair-pc-with-mobile-using-bluetooth-suspecting-dbus-problem-536611/)

kummiliim 03-11-2007 03:24 PM

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
Listed all available devices with
Code:

hcitool scan
Changed /etc/bluetooth/hcid.conf and /etc/bluetooth/rfcomm.conf and made a little script in the same directory called pin.sh that is executable and outputs PIN:0000 as echo, referenced it from hcid.conf as pin_helper and though that all was ready. I could ping my phone, I could bind it with rfcomm, I could see it's services with sdp or from kde with KBluetooth, I could acess Obexpush from there too.

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
hcid[2226]: Enabling debug information
hcid[2226]: Can't connect to system message bus: Failed to connect to socket /usr/local/var/run/dbus/system_bus_socket: No such file or directory
hcid[2226]: Unable to get on D-Bus

Only similar case I could find was this.

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.

almatic 03-12-2007 09:31 AM

what's the output of hciconfig ?

kummiliim 03-12-2007 01:24 PM

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.

almatic 03-12-2007 02:13 PM

Quote:

Originally Posted by kummiliim
all of them I've tried to change without any gain: auth, encrypt, secmgr, pscan and iscan as I remember it

that's why I was asking for it. I had a similar problem which was caused by hcid consistently ignoring some options in the hcid.conf. I had to add them manually every time before pairing something. Older versions of bluez worked fine, so I downgraded which fixed my problem.

However, since you have already verified that, your problem is obviously not related to mine.

kummiliim 03-13-2007 12:14 PM

Thanks for trying anyway. Which of these options are necessary for pairing then?

almatic 03-13-2007 02:23 PM

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.

kummiliim 03-14-2007 10:58 AM

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.

kummiliim 03-18-2007 04:14 PM

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.

almatic 03-18-2007 04:32 PM

Quote:

Originally Posted by kummiliim
made a little script in the same directory called pin.sh that is executable and outputs PIN:0000 as echo, referenced it from hcid.conf as pin_helper

ok, just out of curiousity I have tried this now (I normally use kbluepin as pinhelper) and it works flawlessly, except for one detail. The line "pin_helper" is not accepted in my version (3.7.1), I have to register the pin helper manually via the passkey-agent binary. Like this:

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.

kummiliim 03-19-2007 04:08 AM

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
or wherever your config is and show the output. If you get similar dbus error that way then I'll know for sure that that's not the problem.

My output:
Code:

root@SERVER:/etc/bluetooth# hcid -ndsf /etc/bluetooth/hcid.conf
hcid[2182]: Bluetooth HCI daemon
hcid[2182]: Enabling debug information
hcid[2182]: Unknown option 'pin_helper' line 25
hcid[2182]: syntax error line 25
hcid[2182]: Can't connect to system message bus: Failed to connect to socket /usr/local/var/run/dbus/system_bus_socket: No such file or directory
hcid[2182]: Unable to get on D-Bus

edit2: Found passkey agent from bluez-utils source directory, didn't seem to get installed anywhere. Will try...

edit3:
Code:

root@SERVER:/usr/src/bluez-utils-3.9/daemon# passkey-agent --default /etc/bluetooth/pin.sh
-bash: passkey-agent: command not found

It surely had to get installed somewhere but slocate only finds:
Code:

root@SERVER:/usr/src/bluez-utils-3.9/daemon# slocate passkey-agent
/usr/src/bluez-utils-3.9/daemon/passkey-agent.c
/usr/src/bluez-utils-3.9/daemon/.deps/passkey-agent.Po
/usr/src/bluez-utils-3.9/daemon/passkey-agent.o
/usr/src/bluez-utils-3.9/daemon/passkey-agent

(I used updatedb, yes)

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: .

kummiliim 03-20-2007 05:01 AM

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?

kummiliim 03-21-2007 12:24 PM

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.

arunjr 03-23-2007 09:43 AM

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.

kummiliim 03-23-2007 10:27 AM

Something new here. Found /usr/local/etc/rc.d/rc.messagebus and started it with
Code:

/usr/local/etc/rc.d/rc.messagebus start
Now the errors are a bit different:

hcid:
Code:

root@SERVER:~# hcid -nsd
hcid[2188]: Bluetooth HCI daemon
hcid[2188]: Enabling debug information
hcid[2188]: Could not become the primary owner of org.bluez
hcid[2188]: Unable to get on D-Bus

passkey-agent:
Code:

root@SERVER:~# /usr/src/bluez-utils-3.9/daemon/passkey-agent --default 0000
Can't register passkey agent
The name org.bluez was not provided by any .service files

I'm currently trying to understand how dbus works but I still think I did something wrong, it should work from default install.

Quote:

Originally Posted by arunjr
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.

Do you also get a messagebus error when running hcid -nsd or passkey-agent?

ran404 03-23-2007 04:33 PM

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]


All times are GMT -5. The time now is 06:05 AM.