# What is wrong with bluetooth support in gentoo?

## Xamindar

I have read through various gentoo wiki howtos on getting bluetooth working with my phone and none of them are correct.  First of all, not one of them (and i have read at least three) tell me how to pair my phone with my gentoo.  They just skip that part entirely.  I already have bluetooth working and I can see my phone, just how the heck to I pair it?  There should be a date added on to the wikis telling you the last time it was modified.  It's getting ridiculous how many of them are outdated.

The gnome+bluetooth+phone one for example: 

http://gentoo-wiki.com/HOWTO_mobile_phone,_Bluetooth_and_GNOME

It tells me to run "gnome-bluetooth-admin" which doesn't even exist.

Anyone know an up to date tutorial?

----------

## mbjr

Hi,

I guess you have all the bluez installed available, can you see your device by running hcitool scan and can you ping it with l2ping <mac-addr>?

Cheers,

----------

## tomk

The wiki isn't officially supported by Gentoo, it's generally best to use the official Gentoo documentation for accurate and up-to-date information.

There is an official bluetooth guide that appears to have all the information you're after.

As for getting dates on the wiki, if you click on the history tab it'll show you when the last changes were made as well as being able to see the differences between versions.

----------

## jbryner

I agree with you the wiki date thing annoys the hell outta me too. It should be prominently displayed so right away you know whether it's relevent.

Anywho. Just went through the same thing (never found that gentoo doc until this post though cause I always pic docs on the header, not listing on the sidebar!argh.) and you can pair your phone either from the phone or from the pc. 

Depends on your phone but on my sony-ericsson t616 I choose bluetooth/add device and it searches, finds my pc and asks me for the PIN. If I enter the PIN, voila they're paired. 

Without the device in the list, if I initiate a transfer using say obexftp, the phone prompts me for the pin from the PC and adds the device for me (to the phone). 

I was looking for simple scripts to get and put stuff on the phone. Here's stuff that worked for me: 

obexftp (after adding bluetooth to the use flags)

http://openobex.triq.net/obexftp/examples

gsmlib

http://www.pxh.de/fs/gsmlib/doc/gsminfo.html#index

sobexsrv (allows the phone to send to pc)

http://www.mulliner.org/bluetooth/sobexsrv.php

Most useful to me was the obexftp to get phonebook, calendar. and the gsm utils to manage sms messages. Here's some commands in case they help someone: (bluetooth address should be changed from 11:22:33 to your own)

getting the phonebook in .vcf format: 

```

obexftp -b 11:22:33:44:55:66 -U synch -S -g telecom/pb.vc

```

getting all pictures (t616 just names them picture(1).jpg picture(2).jpg, etc.

```

for (( i=11; i<= 56 ; i++ ));do obexftp -b 11:22:33:44:55:66  -c Pictures -g Picture\($i\).jpg; done

```

getting all sms messages

```

rfcomm bind  rfcomm0

gsmsmsstore --source /dev/rfcomm0 --store ME --backup --destination `date +%F-%T`.sms

rfcomm release rfcomm0

```

The .sms file is in sms store format. You can then send it to stdout with 

```

gsmsmsstore --source my.sms --list

```

upload ringtone

```

obexftp -b 11:22:33:44:55:66 -c Sounds -p Bicycle_Race.mid

```

----------

## Xamindar

 *tomk wrote:*   

> The wiki isn't officially supported by Gentoo, it's generally best to use the official Gentoo documentation for accurate and up-to-date information.
> 
> There is an official bluetooth guide that appears to have all the information you're after.
> 
> As for getting dates on the wiki, if you click on the history tab it'll show you when the last changes were made as well as being able to see the differences between versions.

 

Thanks for the info.  That helped me to understand pairing and I am able to ping my phone.  But even THAT doc is out dated as the rfcomm stuff doesn't work right and there are no such programs as "gnome-bluetooth-manager".

----------

## trilexx

There was a gnome-bluetooth-manager. When I installed that stuff some days ago, there has been a gnome-bluetooth-manager, but it didn't work, so I upgraded the gbome-bluetooth package to arch and in this newer version there is no manager anymore.

There are two versions of gnome-bluetooth in portage. The older one, 0.7.0-r1 should contain the manager, the newer one (0.8.0) doesn't.

----------

## Xamindar

weird, ok.  thanks for the info.

I am having a problem pairing I think.  I looked in the logs and I see error messages when I try to pair.

```
Nov 29 02:52:24 [hcid] PIN helper exited abnormally with code 11

Nov 29 02:52:28 [hcid] pin_code_request (sba=00:16:CF:D7:AE:62, dba=00:12:56:5A:92:59)

Nov 29 02:52:28 [hcid] PIN helper exited abnormally with code 11

Nov 29 02:53:20 [dund] Accept failed. Interrupted system call(4)

Nov 29 02:53:20 [sdpd] terminating... __

Nov 29 02:53:20 [hcid] Exit.

Nov 29 02:53:20 [hcid] Bluetooth HCI daemon

Nov 29 02:53:20 [hcid] Starting security manager 0

Nov 29 02:53:20 [sdpd] Bluetooth SDP daemon_

Nov 29 02:53:20 [dund] Bluetooth DUN daemon version 2.25

Nov 29 02:54:09 [hcid] pin_code_request (sba=00:16:CF:D7:AE:62, dba=00:12:56:5A:92:59)

Nov 29 02:54:09 [hcid] PIN helper exited abnormally with code 11

```

What could be causing this?  I guess I'll try re-emerging it but that almost never fixes the problem.

Thanks for the help so far guys.

----------

## BrummieJim

Make sure you've put bluetooth in your use flags when you emerge gnome-bluetooth and whatever package provides libbtctl.

HTH

----------

## Xamindar

Yes I have done that.

----------

## Simius

BlueZ upstream is at version 3.8.

The version required to get obex in nautilus (just like in konqueror) is version 3.7.

The newest version with an ebuild in portage is *TADA* 2.25

A bit disappointing. If I don't find one, I'll make an ebuild for 3.8 myself. This is starting to feel like debian.

----------

## Xamindar

Wow, you are right.  That sucks.

I also have another question.  Is it possible to use the kde bluetooth stuff under gnome?  So I can have a dialog pop up asking for a pin when I try to pair something?  Or is it too dependant on kde?

----------

## Xamindar

Is there something I am doing wrong here?  Anyone have any ideas?  I have checked and rechecked my configuration files but can't find any problems.  My phone seems to be paired, I can ping it and find out what services it operates.  But it seems you can do that even when it's not paired.

When the bluetooth service is started /dev/rfcomm0 is created and should be linked to my phone.  Here is my rfcomm.conf

```
#

# RFCOMM configuration file.

#

rfcomm0 {

        # Automatically bind the device at startup

        bind yes;

        # Bluetooth address of the device

        device 00:12:56:5a:92:59;

        # RFCOMM channel for the connection

        channel 8;

        # Description of the connection

        comment "My LG C500";

}

```

But if I try a simple rfcomm connect I get the following error:

```
rfcomm connect /dev/rfcomm0 00:12:56:5A:92:59 8

Can't create RFCOMM TTY: Address already in use

```

Any ppp program will also report the modem in use or not available.

----------

## imesg

 *Xamindar wrote:*   

> Is there something I am doing wrong here?  Anyone have any ideas?  I have checked and rechecked my configuration files but can't find any problems.  My phone seems to be paired, I can ping it and find out what services it operates.  But it seems you can do that even when it's not paired.
> 
> When the bluetooth service is started /dev/rfcomm0 is created and should be linked to my phone.  Here is my rfcomm.conf
> 
> ```
> ...

 

Your phone should already be connected:

```
rfcomm0 {

        # Automatically bind the device at startup

        bind yes;

```

Try something like:

```
gnome-obex-send <filename>
```

also:

```
rfcomm <enter>
```

and see what happens.

Good luck

----------

## Xamindar

here is what I get by running the commands you suggested.  Thanks for the help.  Now I know it is all of bluetooth and not just the dialup stuff.  With the obex command I just get an empty window pop up to select a device (none are there) to send to.  

```
white-rabbit xamindar # gnome-obex-send wallpaper/112067137173.jpg 

(gnome-obex-send:27961): GnomeUI-WARNING **: While connecting to session manager:

Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

** Message: inquiry_result:     bdaddr 00:12:56:5A:92:59 class 5a0204

white-rabbit xamindar # rfcomm 

rfcomm0: 00:12:56:5A:92:59 channel 8 clean 

white-rabbit xamindar # 

```

----------

## imesg

 *Xamindar wrote:*   

> here is what I get by running the commands you suggested.
> 
> ...  
> 
> ```
> ...

 

This is my rfcomm.conf:

```
rfcomm1 {

        # Automatically bind the device at startup

        bind yes;

        # Bluetooth address of the device

        #SE S710a

#       device 00:0F:DE:8B:77:EC;

        #SE Z525

        device 00:16:B8:37:07:D3;

        # RFCOMM channel for the connection

        #channel        1;

        # Description of the connection

        comment "Sony Ericsson s710a";

}

```

Note no channel.

```
gene@go:~# hcitool scan

Scanning ...

        00:16:B8:37:07:D3       Gene

gene@go:~# rfcomm 

rfcomm1: 00:16:B8:37:07:D3 channel 1 clean 

```

I can send files both ways.

I found an ebuild for bluez-3.8:

https://bugs.gentoo.org/show_bug.cgi?id=143154

Use the init script in the package. I could not find a gentoo init script

This worked before 3.8 (2.25) fairly well except for sending a file to my phone.

For some reason gentoo is sadly lacking in keeping up with many packages.

I saw another post of yours about DUN. I have that working quite well also.

Gene

----------

## Xamindar

I guess it's no use.

```
** Message: inquiry complete

** Message: device 00:07:61:48:43:94 ANDREAZ found

** Message: device 00:12:56:5A:92:59 Jared`s LG CU500 found

Browsing 00:12:56:5A:92:59 ...

Service Name: OBEX Object Push

Service RecHandle: 0x10000

Protocol Descriptor List:

  "L2CAP" (0x0100)

  "RFCOMM" (0x0003)

    Channel: 6

  "OBEX" (0x0008)

Service Class ID List:

  "OBEX Object Push" (0x1105)

** Message: device 00:12:56:5A:92:59 (OBEX Object Push) port 6

** (gnome-obex-send:8816): CRITICAL **: btctl_obexclient_source_new: assertion `channel <= 0' failed

** (gnome-obex-send:8816): WARNING **: Unable to initialize OBEX client source

```

I do get the window pop up where I see my phone but selecting it to send the file to fails.

----------

## Xamindar

 *imesg wrote:*   

> 
> 
> I found an ebuild for bluez-3.8:
> 
> https://bugs.gentoo.org/show_bug.cgi?id=143154
> ...

 

Thanks for the info.  I just installed that package but now I can't even seem to be able to pair my phone at all.  This is pretty ridiculous.

----------

## ralfonso

I'm having the same problem.  I can pair the phone, but I can't send files.  I get the exact same errors and I also can't start gnome-obex-server.

I even tried it with libbtctl 0.8.2

----------

## Xamindar

Looks like bluez 3.10 is now in portage!  Yay, that's the newest version.  I am thankful to whoever did this.

While on the subject, how can I install net-wireless/bluez-gnome-0.6 ?  It is keword masked.  I forget how to get that in package.keyword (or is it package.keywords?) so that I can at least try to install it.  Im using ~amd64.

nevermind, just read the man page  :Wink: 

added "net-wireless/bluez-gnome **" to /etc/portage/package.keywords and I can now install it on amd64.

----------

## Xamindar

Anyone know how to enable rfcomm support (or turn it on) in the new bluetooth version that is in portage?  There used to be options in /etc/conf.d/bluetooth I think but now it is gone.

----------

## red-wolf76

Anyone know why installing 3.10 breaks stuff that worked with 2.25 (my Logitech DiNovo Desktop, most notably). I used to get it to work in both boot-protocol-mode as well as HCI-mode but after upgrading it - no dice. I do get a snazzy Bluetooth-icon in Gnome with 3.10 but lot of good will it do me if I have to have a second keyboard or SSH in to activate my keyboard and mouse...   :Crying or Very sad: 

----------

## Wojtek_

Grrr... I just noticed that portage only has a 0.9 version of gnome-bluez where there is already 0.13 available at bluez.org. I am also having nightmares trying to compile multisync/opensync as they are very (and I mean VERY!) sensitive to certain use flag. I must say that Gentoo and Bluetooth is a real disaster so fay:/.

Cheers,

Wojtek

----------

## tekknokrat

can somone enlighten me for what rfcomm support without tty support should be useful.

i mean how do I address the serial interface without the rfcommX entry?

----------

## red-wolf76

This works when manually running hid2hci in a gnome-terminal.

 *installed packages wrote:*   

> 
> 
> net-wireless/bluez-gnome-0.14  USE="-debug" 0 kB
> 
> net-wireless/bluez-hciemu-1.2  0 kB
> ...

 

```
# Bluetooth configuraton file

# Run hid2hci (allowed values are "true" and "false")

HID2HCI_ENABLE=false

# Bind rfcomm devices (allowed values are "true" and "false")

RFCOMM_ENABLE=true

# Config file for rfcomm

RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"
```

```
#

# RFCOMM configuration file.

#

#rfcomm0 {

#       # Automatically bind the device at startup

#       bind no;

#

#       # Bluetooth address of the device

#       device 11:22:33:44:55:66;

#

#       # RFCOMM channel for the connection

#       channel 1;

#

#       # Description of the connection

#       comment "Example Bluetooth device";

#}
```

```
#

# HCI daemon configuration file.

#

# HCId options

options {

        # Automatically initialize new devices

        autoinit yes;

        # Security Manager mode

        #   none - Security manager disabled

        #   auto - Use local PIN for incoming connections

        #   user - Always ask user for a PIN

        #

        security user;

        # Pairing mode

        #   none  - Pairing disabled

        #   multi - Allow pairing with already paired devices

        #   once  - Pair once and deny successive attempts

        pairing multi;

        # Default PIN code for incoming connections

        passkey "BlueZ";

}

# Default settings for HCI devices

device {

        # Local device name

        #   %d - device id

        #   %h - host name

        name "BlueZ (%d)";

        # Local device class

        class 0x000100;

        # Default packet type

        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan

        iscan enable; pscan enable;

        # Default link mode

        #   none   - no specific policy 

        #   accept - always accept incoming connections

        #   master - become master on incoming connections,

        #            deny role switch on outgoing connections

        lm accept;

        # Default link policy

        #   none    - no specific policy

        #   rswitch - allow role switch

        #   hold    - allow hold mode

        #   sniff   - allow sniff mode

        #   park    - allow park mode

        lp rswitch,hold,sniff,park;

}
```

----------

