You are not logged in.

#1 2016-01-23 15:34:36

Speranskiy
Member
From: Moscow
Registered: 2013-11-10
Posts: 52

Bluetoothctl run by systemd

Hi there!
I'd like to handle bluetooth manually. So I use this command to turn the device on and it connects to my device automatically.

$ echo -e 'power on\nquit' | bluetoothctl

this command runs fine on my xfce4 logon but it doesn't turn the device on when I attempt to evoke it from /usr/lib/systemd/system-sleep/script.sh
in order to have it run after resume from suspend. It returns:

[bluetooth]# power on
No default controller available

The command works fine when I run it simple by root user.
I tried to delay an execution adding "sleep 3" before the command and it doesn't help.

Does anybody have any ideas why bluetoothctl doesn't see a bluetooth controller when runs by systemd?

Offline

#2 2016-01-23 15:53:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,654

Re: Bluetoothctl run by systemd

I don't think pipes can be used from systemd units. 
You said you want to control it manually, but is the Bluetooth service running?  If not how are you starting the bluetoothd daemon?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2016-01-23 16:27:18

Speranskiy
Member
From: Moscow
Registered: 2013-11-10
Posts: 52

Re: Bluetoothctl run by systemd

Hey! Thanks for the response!
And there is no any other option to run a script on resume from suspend, huh?
The Bluetooth service is certainly running. Systemd starts it as usual.

Last edited by Speranskiy (2016-01-23 16:27:43)

Offline

Board footer

Powered by FluxBB