Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Turn bluetooth on from commandline in SFOS

    Reply
    Feathers McGraw | # 1 | 2016-11-13, 00:23 | Report

    Does anyone know how to turn bluetooth on and off from the commandline in SFOS?

    I've been rummaging with dbus, so far I discovered this using qdbus:

    Code:
    [nemo@Sailfish bluetooth]$ qdbus com.jolla.settings /com/jolla/settings/ui org.freedesktop.DBus.Properties.Set hci0 bar baz
    Error: org.freedesktop.DBus.Error.UnknownInterface
    Interface hci0 was not found in object /com/jolla/settings/ui
    But I guess the problem is that I don't know the name of the bluetooth interface.

    Anyone know how to do this? The end goal is to create a script to turn bluetooth on and restart rockpoold afterwards, and launch it as a user script with systemd (currently on fairphone 2 rockpool starts before bluetooth and therefore my pebble doesn't pair when I reboot until I turn on bluetooth and restart rockpool).

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Feathers McGraw For This Useful Post:
    juiceme, taixzo

     
    coderus | # 2 | 2016-11-13, 00:34 | Report

    better is add to rockpool proper api for controlling bluetooth.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to coderus For This Useful Post:
    juiceme

     
    Feathers McGraw | # 3 | 2016-11-13, 11:26 | Report

    Originally Posted by coderus View Post
    better is add to rockpool proper api for controlling bluetooth.
    It's only a problem for Fairphone 2 though, rockpool works fine on other devices...

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Feathers McGraw For This Useful Post:
    juiceme

     
    Markkyboy | # 4 | 2016-11-13, 12:22 | Report

    To turn bluetooth ON via dbus, you can use;

    Code:
    dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:true
    To turn bluetooth OFF, change true for false at the end of the line;

    Code:
    dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:false
    Taken from an answer given by Schturman with solution from 'coderus' on TJC;

    https://together.jolla.com/question/...onoff-via-cli/ - originally from - http://talk.maemo.org/showpost.php?p...6&postcount=64

    Regards,

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Markkyboy; 2016-11-14 at 22:21.
    The Following 5 Users Say Thank You to Markkyboy For This Useful Post:
    Feathers McGraw, Jordi, juiceme, peterleinchen, taixzo

     
    Feathers McGraw | # 5 | 2016-11-13, 18:43 | Report

    Originally Posted by Markkyboy View Post
    To turn bluetooth ON via dbus, you can use...
    Perfect, thanks!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to Feathers McGraw For This Useful Post:
    juiceme, Markkyboy, taixzo

     
vBulletin® Version 3.8.8
Normal Logout