You are not logged in.

#1 2012-07-14 18:11:35

Xetani
Member
Registered: 2011-12-24
Posts: 3

Bluetooth PAN permission problems [FIXED]

Hello.
I'm trying to connect my beagleboard via bluetooth to my laptop (both running arch) to be able to ssh in it, share internet and copy files. I've added a usb bluetooth module to my beagleboard. Both bluetooth modules are broadcom, the one on the beagleboard is BCM2045, and on laptop BCM92070 (although lsusb shows Hewlett-Packard 4 GB Flash Drive, genious HP). Anyway i have bluez 4.101-1 on both.
So I managed to activate them using:

hciconfig hci0 up

An making them show with:

 hciconfig hci0 piscan

And they detect eachother via

 hcitool scan

The first big problem comes with trying to l2ping. It pings for about 4-5 seconds and then gives me:

Send failed: Connection reset by peer

If I try to connect to it using blueman, the connection holds 4-5 seconds and then hangs.
The only way it works if I silmultaneously make the ping eachother, but then nothing else works (like pand which is my goal).

I also tried to ping my iphone with them, they ping normaly and no hangs, strange thing is if I ping with the laptop it asks me on the phone if I want to allow connection, but if i ping with the beagleboard it doesn't and the pinging works anyway.

So then I tried using rfcomm with my laptop onto my iphone, connects nicely. Then I tried the same from the beagleboard towards the phone, wont work, says permission denied. And the best of all: if I try from laptop onto the beagleboard, it causes the whole OS to crash on it.
Also I set the pincodes on both beagleboard and comp via

/var/lib/bluetooth/[btaddr]/pincodes

.

hcitool cc [btaddr]

does nothing.

I've tried using bluez versions 3.36 and some others, but there is no pand, so its useless, and I didn't test the connection.
Not to mention the nonexisting bluez documentation.

I've also tried connecting to netbook (that has a different bluez vesion) and that also wont work and behaves strange too.

Basically, it seams like sorcery.... So I wonder, does anybody know of a good way of making a bluetooth pand work between a laptop and an ARM computer or maybe know of a working bluez version? Either I'm doing something terribly stupidly wrong for the past few days or bluetooth on linux has to be the worst thing possible.

EDIT: This seams to indicate the problem:

< ACL data: handle 12 flags 0x00 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 3 status 0
      Connection refused - security block

Found two fixes on the net, one is to disable security through /etc/bluetooth/network.conf which fails to work, and the second one is to do

bluez-test-device trusted [btaddress] yes

which doesn't work either.

Last edited by Xetani (2012-07-16 21:47:27)

Offline

#2 2012-07-16 21:47:05

Xetani
Member
Registered: 2011-12-24
Posts: 3

Re: Bluetooth PAN permission problems [FIXED]

After a wasted week i fixed it... and all of it could have been avoided if there were proper bluez documentation.

Also for the sake of people that might also search for a solution, another error message while trying pand was:

Connect to [btaddr] failed. Connection refused(111)

So the problem lies in dbus permissions, I've combined the new permission file and one generated by the old version of bluez.
Seams like the new bluez makes dbus paranoid.

Anyway the file is /etc/dbus-1/system.d/bluetooth.conf

Heres the modified working file, the comments indicate the block I've added (added start and added end):

<!-- 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.HandsfreeAgent"/>
    <allow send_interface="org.bluez.MediaEndpoint"/>
    <allow send_interface="org.bluez.MediaPlayer"/>
    <allow send_interface="org.bluez.Watcher"/>
    <allow send_interface="org.bluez.ThermometerWatcher"/>
  </policy>

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

<allow send_path="/"/>
    <allow send_path="/org/bluez"/>

<!-- added start-->
    <allow send_destination="org.bluez.Manager"/>
    <allow receive_sender="org.bluez.Manager"/>

    <allow send_destination="org.bluez.Adapter"/>
    <allow receive_sender="org.bluez.Adapter"/>

    <allow send_destination="org.bluez.Device"/>
    <allow receive_sender="org.bluez.Device"/>

    <allow send_destination="org.bluez.Service"/>
    <allow receive_sender="org.bluez.Service"/>

    <allow send_destination="org.bluez.Database"/>
    <allow receive_sender="org.bluez.Database"/>

    <allow send_destination="org.bluez.Security"/>
    <allow receive_sender="org.bluez.Security"/>
<!-- added end-->

  </policy>

  <!-- allow users of lp group (printing subsystem) to 
       communicate with bluetoothd -->
  <policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

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

</busconfig>

I'll also edit the title as fixed and to make it more easy to find for people with the same problem.

Offline

Board footer

Powered by FluxBB