LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   bluetooth pairing denied (https://www.linuxquestions.org/questions/slackware-14/bluetooth-pairing-denied-841407/)

matters 10-30-2010 11:18 AM

bluetooth pairing denied
 
Hello!

Ive tried to pair my mobile phone with pc without success

heres what ive done:

1. ive setuped a pin by doing this
Code:

echo -n "1234" >/etc/bluetooth/passkeys/default
2. editing /etc/dbus-1/system.d/bluetooth.conf to allow passkey agent access to dbus by adding last line in policy user root like this:

Code:

<policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent"/>
    <allow send_interface="org.bluez.HandsfreeAgent"/>
    <allow send_interface="org.bluez.PasskeyAgent"/>
  </policy>

3. rebooted the machine
4. preformed action
Code:

hcitool scan     
Scanning ...
        00:12:EE:55:89:B9      M

it found my mobile phone
5. ive tried to pair my box with it like this and heres what i get:
Code:

obexftp -b 00:12:EE:55:89:B9 -l
Browsing 00:12:EE:55:89:B9 ...
Connecting...failed: connect
Tried to connect for 1572ms
The user may have rejected the transfer: Connection refused

in the phone i entered 1234 as password i entered in /etc/bluetooth/passkeys/default file but no success

Code:

tail /var/log/messages
Oct 31 00:07:51 parade bluetoothd[1538]: Exit
Oct 31 00:07:52 parade bluetoothd[2573]: Bluetooth daemon 4.64
Oct 31 00:07:52 parade bluetoothd[2574]: Starting SDP server
Oct 31 00:07:52 parade bluetoothd[2574]: Starting experimental netlink support
Oct 31 00:07:52 parade bluetoothd[2574]: bridge pan0 created
Oct 31 00:07:52 parade bluetoothd[2574]: HCI dev 0 registered
Oct 31 00:07:53 parade bluetoothd[2574]: HCI dev 0 up
Oct 31 00:07:53 parade bluetoothd[2574]: Starting security manager 0
Oct 31 00:07:53 parade bluetoothd[2574]: Adapter /org/bluez/2573/hci0 has been enabled
Oct 31 00:08:23 parade bluetoothd[2574]: pin_code_request (sba=00:11:67:D6:7E:C7, dba=00:12:EE:55:89:B9)

Code:

tail /var/log/syslog 
Oct 31 00:04:14 parade kernel: [ 9140.198402] IN=ppp0 OUT= MAC= SRC=74.220.195.31 DST=93.141.83.227 LEN=159 TOS=0x00 PREC=0x00 TTL=51 ID=0 DF PROTO=UDP SPT=53 DPT=53 LEN=139
Oct 31 00:04:44 parade kernel: [ 9170.038076] IN=ppp0 OUT= MAC= SRC=216.239.32.10 DST=93.141.83.227 LEN=159 TOS=0x00 PREC=0x00 TTL=51 ID=61227 PROTO=UDP SPT=53 DPT=53 LEN=139
Oct 31 00:04:44 parade kernel: [ 9170.684073] IN=ppp0 OUT= MAC= SRC=216.239.36.10 DST=93.141.83.227 LEN=158 TOS=0x00 PREC=0x00 TTL=51 ID=36611 PROTO=UDP SPT=53 DPT=53 LEN=138
Oct 31 00:07:52 parade bluetoothd[2574]: Failed to find Bluetooth netlink family
Oct 31 00:07:52 parade bluetoothd[2574]: Failed to init netlink plugin
Oct 31 00:08:18 parade kernel: [ 9384.174088] IN=ppp0 OUT= MAC= SRC=216.239.32.10 DST=93.141.83.227 LEN=101 TOS=0x00 PREC=0x00 TTL=51 ID=28511 PROTO=UDP SPT=53 DPT=53 LEN=81
Oct 31 00:08:18 parade kernel: [ 9384.243073] IN=ppp0 OUT= MAC= SRC=216.239.32.10 DST=93.141.83.227 LEN=162 TOS=0x00 PREC=0x00 TTL=51 ID=59609 PROTO=UDP SPT=53 DPT=53 LEN=142
Oct 31 00:08:18 parade kernel: [ 9384.743075] IN=ppp0 OUT= MAC= SRC=216.239.32.10 DST=93.141.83.227 LEN=127 TOS=0x00 PREC=0x00 TTL=51 ID=35548 PROTO=UDP SPT=53 DPT=53 LEN=107
Oct 31 00:08:19 parade kernel: [ 9384.861072] IN=ppp0 OUT= MAC= SRC=216.239.32.10 DST=93.141.83.227 LEN=93 TOS=0x00 PREC=0x00 TTL=51 ID=27128 PROTO=UDP SPT=53 DPT=53 LEN=73
Oct 31 00:08:23 parade bluetoothd[2574]: No agent available for 0 request


what am i missing here?

thanks alot guys

matters 10-31-2010 06:37 AM

heres what packages i have installed
Looking for bluez in package list. Please wait... DONE

The list below shows all packages with name matching "bluez".

[ installed ] - bluez-4.64-i486-1
[ installed ] - bluez-firmware-1.2-i486-1
[ installed ] - bluez-hcidump-1.42-i486-3


if i understood right 4x bluez dosent use plain text pin when pairing? correct me if im wrong, i came accross that i need to use bluez-simple-agent for pin recognition but i dont have it installed.

can someone point me to right dirrection?

im wondering how can my phone recognize the pin, and also what governs pin now to be recognized when bluez 4.64 or later is concerned is it still bluez-simple-agent or something else?

i didnt came accross any latest documentation. if you can point me so i can read i would greatly apprechiated.

thanks guys

bogzab 10-31-2010 12:46 PM

I am no expert in this area, but I do have a working bluetooth connection between my PC and my phone. I did not edit the /etc/dbus-1/system.d/bluetooth.conf file so it reflects the Slack 13.1 installed version (I am assuming you are on the same Slackware version). Nor did I put an entry into the /etc/bluetooth/passkeys/default file.

I've sent files to the phone from the PC via the KDE KBluetooth utility which (I think - was some time ago when I first did it) prompted me for a Bluetooth passkey to pair the devices. I presume that the KDE utility squirreled the passkey away someplace bu am unsure where.

I tried the code that you had in your post :
Code:

obexftp -b <phone address> -l
and my phone asked if it was OK to accept the connection. After confirming this, the PC showed the highest level directory listing on the phone (C: and E: Drives corresponding to the phone memory and the SD card.

matters 11-01-2010 03:50 PM

Hi! Thank you for your response, i dont have kbluetooth installed, wondering what pin u used when u first wanted to pair those devices?

Ive tried what u said by having /etc/dbus-1/system.d/bluetooth.conf untouched and /etc/bluetooth/passkeys/ directory empty

but when i want to start pairing with obex again it asks me for password. no matter i tried 0000 or 1234 it wont pair.

so im just wondering how bluez-4.64 operates? want to have any good documentation so i can read about it. wondering now how passkeys are now operated and where its setuped since i read somwhere that it dosent work anymore when we setup plain text pin.

Any help is greatly apprechiated

Thanks guys alot and have a good one!

bogzab 11-02-2010 05:06 AM

I think I used "0000".

Are both your phone and the PC set up to be "discoverable" - Essential for the phone I would have thought if you are to initiate a contact from the PC.

matters 11-03-2010 03:05 AM

Hi!

When i want to check from my phone to see PC i get no devices found. Only PC see phone without problem

in /etc/bluetooth/main.conf i have this values:

Code:

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

When you try to scan visible devices from your phone does your pc shows up as visible?

Its really strange for me. Where else should i check to make sure that my PC is visible?

thanks

bogzab 11-03-2010 05:22 AM

Yes, my phone sees my PC (both of them, as I have the phone paired both with a desktop and laptop PC). If you do not have kdebluetooth you could try setting the PC bluetooth properties with hciconfig. There is a man page for this tool which includes commands for turning authentication on and off and for setting device class and mode. The right combination of settings here might make your PC discoverable by your phone.

Does your phone see other bluetooth devices - eg when you scan on a crowded train ?

matters 11-03-2010 07:28 AM

We are one step closer

by executing
Code:

hciconfig hci0 piscan
now my PC becomes visible from my phone aswell. However i do have one question though in order to communicate with each other for first time both bluetooth devices has to enter the same password right?

But when i do
Code:

obexftp -b macaddress -l
on my phone is asking for the password , and when i enter 0000 it still wont pair. Im wondering how can i make sure that PC and phone authenticate to each other? Shouldnt my pc enter the same password in order for them to pair? im wondering how its done? im wondering if bluez-simple-agent is still available in bluez 4.64 because i dont see that its installed on my pc.

can u exectute
Code:

hciconfig -a
so i can see the properties u do have enabled please?

thanks alot

bogzab 11-03-2010 03:14 PM

Here is the output from my hciconfig -a command :
Quote:

hci0: Type: BR/EDR Bus: USB
BD Address: 00:14:85:92:D6:40 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:64099 acl:223 sco:0 events:4993 errors:0
TX bytes:29293 acl:199 sco:0 commands:4695 errors:0
Features: 0xff 0xff 0x8f 0xf8 0x18 0x18 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'tigby-desk-0'
Class: 0x5a0104
Service Classes: Networking, Capturing, Object Transfer, Telephony
Device Class: Computer, Desktop workstation
HCI Version: 1.2 (0x2) Revision: 0x639
LMP Version: 1.2 (0x2) Subversion: 0x639
Manufacturer: Cambridge Silicon Radio (10)
I have just noticed that there is a parallel thread going on with input from people who know a lot more than me here :http://www.linuxquestions.org/questi...etooth-839669/

matters 11-03-2010 05:51 PM

thanks for help im pretty sure this is where is the problem

in /var/log/syslog i get
Code:

Nov  3 23:38:25 parade bluetoothd[1546]: No agent available for 0 request
meaning that is asking for some kind of passkey-agent to be installed/available

since i have bluez-4.64 installed from slackware-current and i dont see i have passkey-agent installed so im wondering is that somekind script wich passkey can be used with it etc? i heard theres different agents like agent, simple-agent script bluez-simple agent but im not sure wich agent works for bluez-4.64?

do i have to separately download it from somwhere or create it to make it work?

thanks

EDIT: Ive got it to work! from source bluez-4.64 in test directory i copied simple-agent to /usr/bin
then i executed command:
Code:

simple-agent hci0 macaddress
then entered the pin i wanted to use when pairing with phone

then done
Code:

obexftp -b macaddress -l
entered pin of choice i entered in simple-agent when my phone asked for the pin and they paired

thanks alot for the helpmy friend you put me on the right track!

bogzab 11-05-2010 03:33 AM

If you want to use bluetooth as a regular (non-root) user I think you have to be a member of plugdev if I understand correctly what it says in /etc/dbus-1/system.d/bluetooth.conf.


All times are GMT -5. The time now is 03:04 PM.