Reply
Thread Tools
Posts: 33 | Thanked: 32 times | Joined on Nov 2007 @ Finland
#71
Originally Posted by Schturman View Post
I connect Jolla to BT loudspeaker and if I run:
Code:
/usr/lib/qt5/bin/qdbus --system net.connman /net/connman/technology/bluetooth net.connman.Technology.GetProperties
it show me:
Code:
Connected: false
Name: Bluetooth
Powered: true
Tethering: false
Type: bluetooth
The first line show me false although it connected and work good. Why ?
ConnMan only handles network connections so the "Connected: false" refers to BT PAN connection and as you do not have any, the value is false.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#72
Ok, thanks for explanation.
Maybe you know how to check if BT connected to any device, when icon is white on the lockscreen ?

Ok found how to chek... I can run this command and if it connected to something it will show me the address:
Code:
[root@Jolla ~]# hcitool con|awk '{print $3}'|grep -v '^$'
00:26:7E:0A:17:84
[root@Jolla ~]#
Now if I want to see the real name of connected device:
Code:
[root@Jolla ~]# address=$(hcitool con|awk '{print $3}'|grep -v '^$')
[root@Jolla ~]# hcitool name $address
Parrot Minikit Slim v1.31
[root@Jolla ~]#

Last edited by Schturman; 2014-04-27 at 10:29.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#73
Could I use DBUS to automagically start the mediaplayer after headset is inserted? What would be needed to achieve this? Any ideas?
 
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#74
Originally Posted by geekgirl74 View Post
Could I use DBUS to automagically start the mediaplayer after headset is inserted? What would be needed to achieve this? Any ideas?
In Fremantle alsaped was pretty cool so you could scirpt it there (http://talk.maemo.org/archive/index.php/t-83447.html), would be nice to know what jolla uses
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#75
Sorry, I should have been more precise. I meant headphone, not headset. I can live with the fact that my headset's buttons are not supported, but I would like to automatically start the mediaplayer (maybe even start playback) when plugging in the headset/headphone.

Just started dbus-monitor to see if anything happens when music plays and I unplug the headphone. Thought this could give me a hint how to achieve the opposite, but nothing was thrown to the output when the music stopped after unplugging... now I'm out of ideas... can anybody help?
 
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#76
Originally Posted by geekgirl74 View Post
Sorry, I should have been more precise. I meant headphone, not headset. I can live with the fact that my headset's buttons are not supported, but I would like to automatically start the mediaplayer (maybe even start playback) when plugging in the headset/headphone.

Just started dbus-monitor to see if anything happens when music plays and I unplug the headphone. Thought this could give me a hint how to achieve the opposite, but nothing was thrown to the output when the music stopped after unplugging... now I'm out of ideas... can anybody help?
Try "dbus-monitor --system" as root.
I think it defaults to session bus, and the headphones seem to trigger events on system bus.
 

The Following User Says Thank You to juiceme For This Useful Post:
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#77
Originally Posted by geekgirl74 View Post
Sorry, I should have been more precise. I meant headphone, not headset. I can live with the fact that my headset's buttons are not supported, but I would like to automatically start the mediaplayer (maybe even start playback) when plugging in the headset/headphone.

Just started dbus-monitor to see if anything happens when music plays and I unplug the headphone. Thought this could give me a hint how to achieve the opposite, but nothing was thrown to the output when the music stopped after unplugging... now I'm out of ideas... can anybody help?
Code:
dbus-monitor --system "type=signal, interface=com.nokia.policy, member=audio_actions" |  
while read -r line; 
do
	if echo $line | grep "string \"hs\""; then
		/usr/bin/jolla-mediaplayer
	fi
done
 

The Following 3 Users Say Thank You to szopin For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#78
Thank you. It displays a million messages, will try to find out, what it needs.

Edit: should have hit F5 prior to posting will try what szopin wrote.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#79
Had to slightly alter the script, but it works, thanks

Code:
dbus-monitor --system "type=signal, interface=com.nokia.policy" |  
while read -r line; 
do
	if echo $line | grep "string \"headphone\""; then
		/usr/bin/jolla-mediaplayer
	fi
done
 

The Following 4 Users Say Thank You to For This Useful Post:
Posts: 9 | Thanked: 11 times | Joined on Apr 2009
#80
Originally Posted by evk View Post
Anyone now how to get GPS-coordinates through dbus? Or some other simple way that can be used from a shell script?
The following python snippet does the job (you may have to install dbus-python and/or pygobject2)

Code:
import dbus, gi.repository.GObject as gobject
import dbus.mainloop.glib as glib

glib.DBusGMainLoop(set_as_default=True) 
bus = dbus.SessionBus()

def myhandler(fields, timestamp, lat, lon, alt, acc):
    print "lat: %f lon: %f alt: %d acc: %d" % (lat, lon, alt, acc[1])

bus.add_signal_receiver(myhandler,"PositionChanged", 
                       "org.freedesktop.Geoclue.Position")

loop = gobject.MainLoop()
loop.run()
  • cf http://dbus.freedesktop.org/doc/dbus.../tutorial.html for everything about python-dbus
  • the script doesn't work until another GPS application (like Map) has started
  • method GetPosition fails with 'Geoclue master client has no usable Position providers', but signal PositionChanged can be used instead (as above)

Last edited by hlub; 2014-07-27 at 14:14.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:51.