LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-03-2009, 06:34 AM   #1
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Rep: Reputation: 87
Slackware 13 and BlueZ woes


Am trying to make my phone (Nokia N95) exchange files with Slackware64 13.0 installation on my HP EliteBook 8530w. Previously, I had Bluetooth activated:
Code:
chmod 755 /etc/rc.d/rc.bluetooth
and connected my HP Bluetooth mouse, by changing HIDD_ENABLE item in /etc/rc.d/rc.bluetooth.conf to "true", and then by running:
Code:
hidd --search
once; regarding everything else, it is vanilla Slackware install. So, in order to connect with my phone (which is able to exchange Bluetooth messages with other phones, talk over Bluetooth to the headset, etc. - which means has own Bluetooth stack working properly), I first run:
Code:
hcitool scan
and then remembered the address of my phone (let's say it's 00:11:22:33:44:55), and then (according to the suggestion from /etc/bluetooth/README.SLACKWARE) created BlueZ passkey through:
Code:
echo -n "1234" >/etc/bluetooth/passkeys/default
Then I try to connect, through:
Code:
obexftp -b 00:11:22:33:44:55 -l
A popup appears on my phone, asking for BlueZ passkey, and I type "1234" in-there, but then following is reported:
Code:
Browsing 00:11:22:33:44:55 ...
Connecting...failed: connect
Tried to connect for 1357ms
The user may have rejected the transfer: Connection refused
and I find following in /var/log/syslog:
Code:
Oct  3 13:13:13 hpeb hcid[4162]: Passkey agent replied with an error: org.freedesktop.DBus.Error.AccessDenied, Rejected send message, 1 matched rules; type="method_call", sender=":1.12" (uid=0 pid=4162 comm="/usr/sbin/hcid -s -f /etc/bluetooth/hcid.conf ") interface="org.bluez.PasskeyAgent" member="Request" error name="(unset)" requested_reply=0 destination=":1.13" (uid=0 pid=4170 comm="/usr/lib64/bluetooth/add-passkey --default ")
and also the same thing in /var/log/messages.

So - any suggestion here, or any pointer to some good docs about setting these things up?
 
Old 10-03-2009, 06:49 AM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Did you restart bluetooth after setting up the passphrase? Maybe that's needed.
 
Old 10-03-2009, 08:42 AM   #3
0rphu
Member
 
Registered: Sep 2009
Posts: 31

Rep: Reputation: 6
looks like PasskeyAgent is not allowed on dbus... I've been trying to get BlueZ running on slack64 13 for 2 weeks now, no result so far, but I've seen a LOT of errors.

Your /etc/dbus-1/system.d/bluetooth.conf should look like this:

Code:
<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

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

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>
the red marked line is not in stock bluetooth.conf, you'll have to add that manually, afterwards reboot and retry.

BlueZ is such a mess since it plunged into the murky waters of dbus... Let me know of any progress.

EDIT: just tried that and it works. BTW this (using obexftp) is the ONLY way I was able to pair my devices under slack13 with stock BlueZ. Wouldn't figure it out without you cgorac, thanks a million .

EDIT2: In fact, you've solved all my problems, I got everything running. It was the first step I was missing. I never tried obexftp, because I couldn't care less about bluetooth file transfers, all I wanted was a NAP gateway. If I realized initiating obex file transfer provokes a successful bonding... Oh well... When I look back to the sleepless nights trying to make this work I realize more than ever that ignorance HURTS big time . Thanks a lot once more and I hope you will be successful too.

Last edited by 0rphu; 10-03-2009 at 09:19 AM. Reason: kudoz
 
1 members found this post helpful.
Old 10-03-2009, 12:32 PM   #4
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
Thanks for your replies...

@rg3: Yes, I was restarting it after every change.

@0rphu: Many thanks for your suggestion on changing /etc/dbus-1/system.d/bluetooth.conf - I have it working now too. I was primarily interested in exchanging files with my phone quickly (well, at least for smaller files), in order to avoid plugging USB cable in/out, mounting/un-mounting etc. (albeit, I still have to learn about Bluetooth security, at the moment I feel very un-comfortable in having PIN as only protection for accessing to my machine). There are many interesting types of PC-phone Bluetooth connection besides that (using phone as modem, streaming audio in both directions, etc.), but as you said above - BlueZ configuration really seems impenetrable, even to an experienced Linux user...
 
Old 12-06-2009, 12:03 PM   #5
pejobe
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Rep: Reputation: 3
Hi,
On a Sony Ericsson W760i I fail to get Bluetooth to connect using obexftp as is suggested in this thread.
I want to transfer pictures from the phone to the laptop.
I run Slackware64 13.0

Code:
 obexftp -b  [phone BD address] -l
...
Connecting...done
Tried to connect for 1073ms
Receiving "(null)"... <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
<!--
 XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB 
-->
<folder-listing version="1.0"><folder name="Phone memory"/>
<folder name="Memory card"/>
</folder-listing>
done
Disconnecting...done
In /var/log/syslog;
Code:
Dec  6 17:54:56 slack hcid[3572]: Parsing /etc/bluetooth/main.conf failed: No such file or directory
Dec  6 17:54:56 slack hcid[3572]: Failed to listen on control channel
There is no file in etc/bluetooth/ called main.conf

Tried different commands with obexftp and always the same result: Bluetooth connection failed.

Can it be a bug in my phone?
Do I use obexftp correct..?

Any suggestions on how I should proceed?
Thanks.
 
Old 01-27-2010, 09:34 PM   #6
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Thank you to all involved in this thread. I finally sorted my Broadcom BCM2046 bluetooth out with information in this thread. I tried a couple of others, but some of the information was a bit incomplete. This one worked flawlessly. For record purposes here is what I did.

Copied verbatim the code text for /etc/dbus-1/system.d/bluetooth.conf from 0rphu's post and saved it to /tmp as bluetooth.conf.

Code:
$pico /tmp/bluetooth.conf

  UW PICO 5.04                                File: bluetooth.conf

<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

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

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>
Use ^X to close and answer Y to save.

Next I opened and modified /etc/rc.d/rc.bluetooth.conf enabling the options I need and saved. Your options may differ.

Code:
# pico /etc/rc.d/rc.bluetooth.conf
UW PICO 5.04                                           File: /etc/rc.d/rc.bluetooth.conf

# =============================================================================

# The SDP daemon allows clients to detect supported Bluetooth services
SDPD_ENABLE=true

# The HID daemon supports Bluetooth Human Interface Devices
HIDD_ENABLE=true
HIDD_OPTIONS="--server"

# This switches your Bluetooth device into HCI mode, use this if your input
# device does not support Bluetooth HID
HID2HCI_ENABLE=true

# The RFCOMM daemon is used to simulate serial connections over Bluetooth
RFCOMM_ENABLE=true

# The DUN daemon is used for Dial Up Networking over Bluetooth
DUND_ENABLE=false
DUND_OPTIONS="--listen --persist --msdun call dun"

# The PAN daemon is used to setup a Bluetooth network.
PAND_ENABLE=true
PAND_OPTIONS="--listen --role NAP"
Next I made rc.bluetooth executable

Code:
# chmod +x /etc/rc.d/rc.bluetooth
Now I needed to add a passkey.

Code:
# echo -n "XXXX" >/etc/bluetooth/passkeys/default
Replacing the XXXX with my passkey.

Then I copied the previously saved /tmp/bluetooth.conf file to the proper location.

Code:
# cd /tmp
cp bluetooth.conf /etc/dbus-1/system.d/
Finally, I executed a reboot. Upon reboot I'm now getting hci0 and the keyboard and touchpad aren't locked up.

Code:
# hciconfig -a
hci0:   Type: USB
        BD Address: XX:XX:XX:XX:XX:XX ACL MTU: 1021:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:1266 acl:0 sco:0 events:33 errors:0
        TX bytes:617 acl:0 sco:0 commands:32 errors:0
        Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT
        Name: 'BlueZ (0)'
        Class: 0x000100
        Service Classes: Unspecified
        Device Class: Computer, Uncategorized
        HCI Ver: 2.1 (0x4) HCI Rev: 0x51c8 LMP Ver: 2.1 (0x4) LMP Subver: 0x423d
        Manufacturer: Broadcom Corporation (15)
Thanks again. ;-)
 
Old 02-21-2010, 05:34 PM   #7
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by 0rphu View Post
looks like PasskeyAgent is not allowed on dbus... I've been trying to get BlueZ running on slack64 13 for 2 weeks now, no result so far, but I've seen a LOT of errors.

Your /etc/dbus-1/system.d/bluetooth.conf should look like this:

Code:
<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

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

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>
the red marked line is not in stock bluetooth.conf, you'll have to add that manually, afterwards reboot and retry.

BlueZ is such a mess since it plunged into the murky waters of dbus... Let me know of any progress.

EDIT: just tried that and it works. BTW this (using obexftp) is the ONLY way I was able to pair my devices under slack13 with stock BlueZ. Wouldn't figure it out without you cgorac, thanks a million .

EDIT2: In fact, you've solved all my problems, I got everything running. It was the first step I was missing. I never tried obexftp, because I couldn't care less about bluetooth file transfers, all I wanted was a NAP gateway. If I realized initiating obex file transfer provokes a successful bonding... Oh well... When I look back to the sleepless nights trying to make this work I realize more than ever that ignorance HURTS big time . Thanks a lot once more and I hope you will be successful too.
Thanks! This is exactly the problem I have. I am using Slackware-current from today. I still need to make this change.
 
  


Reply



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
more Slackware 12.0 sound woes geomatt Slackware 12 09-02-2007 08:24 PM
Slackware installation woes... Starwobble Linux - Newbie 1 05-09-2006 05:44 PM
Alsa woes, slackware 10.2 Calus Slackware 19 05-04-2006 12:26 PM
USB bluetooth w/ bluez on 2.6.8.1 (slackware 10) mo0 Slackware 0 10-03-2004 03:30 AM
IP address woes / slackware 9.1 tomammon Linux - Networking 1 09-15-2004 03:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:23 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