You are not logged in.

#1 2013-11-27 21:55:56

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Bluetooth problems

Hello,

I have some weird problems with bluetooth on my laptop.

First of all, after porting Blueman to bluez 5, it stopped recognizing my BT controller. So I have to use console to connect to my BT keyboard.

First problem:
1) I have paired my keyboard with laptop. Now, every time I turn on laptop, I have to:

bluetoothctl

even rfkill bluetooth shows that BT is unblocked, I have to:

power on

otherwise I get:

Failed to connect: org.bluez.Error.NotReady

then I have to manually connect to MAC address of keyboard:

connect 20:73:AB:55:63:F8

then I get

connect 20:73:AB:55:63:F8
Attempting to connect to 20:73:AB:55:63:F8
Connection successful
[CHG] Device 20:73:AB:55:63:F8 Connected: yes
[CHG] Device 20:73:AB:55:63:F8 Modalias: bluetooth:v04E8p7021d011B
[CHG] Device 20:73:AB:55:63:F8 Modalias: bluetooth:v04E8p7021d011B

but keyboard still doesn't work, I have to disconnect it first:

[bluetooth]# disconnect 20:73:AB:55:63:F8 
Attempting to disconnect from 20:73:AB:55:63:F8
Successful disconnected
[CHG] Device 20:73:AB:55:63:F8 Connected: no

and then connect it again:

connect 20:73:AB:55:63:F8
Attempting to connect to 20:73:AB:55:63:F8
Connection successful
[CHG] Device 20:73:AB:55:63:F8 Connected: yes
[CHG] Device 20:73:AB:55:63:F8 Modalias: bluetooth:v04E8p7021d011B
[CHG] Device 20:73:AB:55:63:F8 Modalias: bluetooth:v04E8p7021d011B

and finally it works... Why the hell?

2) When I don't use keyboard for a longer period (about 10 minutes), for example when I scroll over some long page using mouse, keyboard gets disconnected and bluetoothd get into "I take 100% CPU, so your fans go wild" state.

systemctl status bluetooth.service

doesn't tell me anything

3) Where is any documentation for bluez?! How to write a simple script for connect, disconnect and reconnect one specific device?


$ pacman -Qs bluez

 
local/bluez 5.11-1
    Daemons for the bluetooth protocol stack
local/bluez-utils 5.11-1
    Development and debugging utilities for the bluetooth protocol stack

Thank you

Last edited by Kotrfa (2013-11-27 22:46:14)

Offline

#2 2013-11-28 16:56:33

pigiron
Member
From: USA
Registered: 2009-07-14
Posts: 150

Re: Bluetooth problems

I can provide very little help, but you do have my sympathy. I gave up on Bluez when it dropped direct ALSA support in version 5, but I was investigating a highly intermittent bug in version 4 between Bluez and moc.

What I tried was killing the Bluez daemon, then starting it from the command line with the "-dn" flags (I think... my memory sucks) while running that under the "script" command. This turned on the gobs of debug messages without forking into a daemon and would also send the messages to a file (because they rolled off the screen quickly).

But then it gets very ugly real fast, because the next step was going into the source code to following the message droppings. That's because the answer to the first part of your question number 3 is that what little documentation the Bluez folks had, they deleted awhile back. So the only documentation is the source itself, which is twisted worse than a pretzel.

The only other (bad) advice I have would be to see if you can get the Bluez developers involved. Perhaps others have a better idea.

Offline

#3 2013-11-28 17:06:45

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: Bluetooth problems

I don't know if one of my previous posts might help - I had to work quite hard to get my BT mouse working with bluez (5) but the notes on that are at https://bbs.archlinux.org/viewtopic.php … 7#p1336907

Although those notes are for a BT mouse it may be very similar for a BT keyboard that you have.

I also included some udev rule that was needed to make it all work automatically after reboot.

Last edited by mcloaked (2013-11-28 17:08:51)


Mike C

Offline

#4 2013-11-28 19:03:32

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: Bluetooth problems

Don't know if it's the issue, but what I miss in your commands is 'trust' after you connected your keyboard,, trust the device,

Offline

#5 2013-11-28 19:53:37

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: Bluetooth problems

qinohe wrote:

Don't know if it's the issue, but what I miss in your commands is 'trust' after you connected your keyboard,, trust the device,

In my case it is a mouse but yes adding the trust command for your keyboard is worth trying.


Mike C

Offline

#6 2013-11-28 20:07:21

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: Bluetooth problems

To trust the device helped in direction that I don't have to connect it twice. Thanks.

Other problems are still there ->
--no informations about bluetoothd.service, even I added "-nd". I runned it separatly in terminal, but it is just a mess.

$ systemctl status bluetooth.service

bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Thu 2013-11-28 20:41:16 CET; 23min ago
     Docs: man:bluetoothd(8)
 Main PID: 514 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─514 /usr/lib/bluetooth/bluetoothd -dn

-- I have to "power on" inside bluetoothctl first, even the hci0 is unblocked
-- Autoconnection after boot would be great, but now it is inconceivable
-- IRC channels #bluez and #bluez-users are really lonely place and I can't find the right way how to use the mailing lists. How it is possible, that there is NO DOCUMENTATION? Why it is not possible to easily script as it was using hciconfig and hcitools? Are there any reasons?By the way: Bluez must be one of the best kept secrets in Linux

Offline

#7 2013-11-28 20:47:41

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: Bluetooth problems

I noticed that you ran

$ systemctl status bluetooth,service

as user and not as root.  Try "su -" to login as root first then once logged in as root try the command again. By the way you should not need to add the suffix .service and simply doing

 systemctl status bluetooth

as root should be sufficient.

In my case the two give different results as follows:

[mike@lapmike3 ~]$ systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Thu 2013-11-28 18:05:05 GMT; 2h 40min ago
     Docs: man:bluetoothd(8)
 Main PID: 268 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─268 /usr/lib/bluetooth/bluetoothd

[mike@lapmike3 ~]$ sudo systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Thu 2013-11-28 18:05:05 GMT; 2h 40min ago
     Docs: man:bluetoothd(8)
 Main PID: 268 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─268 /usr/lib/bluetooth/bluetoothd

Nov 28 18:05:01 lapmike3 systemd[1]: Starting Bluetooth service...
Nov 28 18:05:01 lapmike3 bluetoothd[268]: Bluetooth daemon 5.11
Nov 28 18:05:05 lapmike3 systemd[1]: Started Bluetooth service.
Nov 28 18:05:05 lapmike3 bluetoothd[268]: Starting SDP server
Nov 28 18:05:05 lapmike3 bluetoothd[268]: Bluetooth management interface 1.3 initialized
Nov 28 18:05:55 lapmike3 bluetoothd[268]: Endpoint registered: sender=:1.33 path=/MediaEndpoint/A2DPSource
Nov 28 18:05:55 lapmike3 bluetoothd[268]: Endpoint registered: sender=:1.33 path=/MediaEndpoint/A2DPSink

Last edited by mcloaked (2013-11-28 20:54:04)


Mike C

Offline

#8 2013-11-28 20:53:27

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: Bluetooth problems

Did you try the suggestion in my link to the old thread where I posted where I suggested to add a udev rule to get bluetooth started at boot?:

[mike@lapmike3 ~]$ cat /etc/udev/rules.d/10-local.rules 
# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"

Mike C

Offline

#9 2013-11-28 21:21:37

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: Bluetooth problems

Interesting!
Yes - using sudo status *** shows me different output with logs. And I tried that and now it works - I don't have to use "power on" anymore.

So now I'd like to create a script for connecting the device. But when I try:

hciconfig cc 20:73:AB:55:xx:xx

I get:

Can't create connection: Operation not permitted

and when I try it as a sudo:

Can't create connection: Input/output error

I'd like to added to my .xinitrc or .profile, but first I must be able to do it as a normal user.

Offline

#10 2013-11-28 21:28:24

Pjoter
Member
Registered: 2010-10-05
Posts: 16

Re: Bluetooth problems

Hello,

I have the same- bluetooth is unusable since upgrade to 5th version. I checked opensuse forums and they have the same issue. It looks like we will have to wait until someone fixes it. Or go for USB keyboard and mouse smile
Pity that suddenly you have to deal with breakage and no cure for that ...

Piotr.

Offline

#11 2013-11-28 21:32:45

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: Bluetooth problems

Kotrfa wrote:

Interesting!
Yes - using sudo status *** shows me different output with logs. And I tried that and now it works - I don't have to use "power on" anymore.

So now I'd like to create a script for connecting the device. But when I try:

hciconfig cc 20:73:AB:55:xx:xx

I get:

Can't create connection: Operation not permitted

and when I try it as a sudo:

Can't create connection: Input/output error

I'd like to added to my .xinitrc or .profile, but first I must be able to do it as a normal user.

Did you try the udev rule?

Last edited by mcloaked (2013-11-28 21:33:13)


Mike C

Offline

#12 2013-11-30 08:48:33

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: Bluetooth problems

Yes. Without success.

Offline

#13 2013-11-30 13:09:25

*nixer
Member
Registered: 2011-11-11
Posts: 56

Re: Bluetooth problems

I wasn't able to get Bluez(5) running satisfactory after almost a week of on and off again tweaking. Bluez4 is still in the repos and offers a much better alternative.

If something isn't broke... 

... why upgrade?

Offline

Board footer

Powered by FluxBB