Reply
Thread Tools
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#1
My Sony/Ford car stereo does bluetooth. But it's a pain.

Up until two days ago, it would always connect fine when turned on. And HFP worked just fine for calls - very well actually.

A2DP was a different story. First try worked brilliantly. Worked great for a day. Then would only work occasionally - sometimes if I flicked from phone to stream on the stereo it would work. Mostly the phone would be sending data and it would just be silent, or the stereo would silently drop the link.

Two days ago I got Fraud to update the firmware (why can I not do that? It's MY car you theives.)

Now A2DP works more often - normally after flicking from phone mode and back. But it fails to auto connect - or rather it does try to auto connect, but then drops the link (it does now say "link dropped") so I have to dive through menus on the phone to reconnect... it will often fail once more, then work fine.

So I want to write a script that can be called from a DCE button to initiate a connection (and I'll write a dbus-scripts script to do it on failure too!) but how?

Can I send a dbus-command?

dbus-monitor reveals this chain of stuff happenning when I hit connect:

signal sender=:1.37 -> dest=(null destination) serial=1336 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Device; member=PropertyChanged
string "Connected"
variant boolean true
signal sender=:1.91 -> dest=(null destination) serial=190 path=/org/kernel/class/bluetooth/hci0/hci0_11; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1337 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.AudioSink; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.37 -> dest=(null destination) serial=1338 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Audio; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.91 -> dest=(null destination) serial=191 path=/org/kernel/class/input/input11; interface=org.kernel.kevent; member=add
signal sender=:1.91 -> dest=(null destination) serial=192 path=/org/kernel/class/input/input11/event4; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1342 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=Connected
signal sender=:1.37 -> dest=(null destination) serial=1343 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=PropertyChanged

Can I use any of that?

Just found and checking: http://maemo.org/api_refs/5.0/5.0-fi...ontrol-api.txt - may help me...

EDIT

Seems like the command I need is:

Code:
dbus-send --system --print-reply --type=method_call --dest=org.bluez /org/bluez/1069/hci0/dev_00_1E_A4_FF_D8_BE.Connect
This page is really helpful: http://wiki.bluez.org/wiki/HOWTO/AudioDevices...

A more full script could be written using:

Code:
devmac=00:1E:A4:FF:D8:BE

adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g')
device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g')
dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
(Change the AudoSink to whatever service you want, and the devmac to the mac of your bluetooth headset,stereo,computer,teddybear...)

Last edited by phedders; 2010-04-15 at 08:56.
 

The Following 4 Users Say Thank You to phedders For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#2
Originally Posted by phedders View Post
My Sony/Ford car stereo does bluetooth. But it's a pain.

Up until two days ago, it would always connect fine when turned on. And HFP worked just fine for calls - very well actually.

A2DP was a different story. First try worked brilliantly. Worked great for a day. Then would only work occasionally - sometimes if I flicked from phone to stream on the stereo it would work. Mostly the phone would be sending data and it would just be silent, or the stereo would silently drop the link.

Two days ago I got Fraud to update the firmware (why can I not do that? It's MY car you theives.)

Now A2DP works more often - normally after flicking from phone mode and back. But it fails to auto connect - or rather it does try to auto connect, but then drops the link (it does now say "link dropped") so I have to dive through menus on the phone to reconnect... it will often fail once more, then work fine.

So I want to write a script that can be called from a DCE button to initiate a connection (and I'll write a dbus-scripts script to do it on failure too!) but how?

Can I send a dbus-command?

dbus-monitor reveals this chain of stuff happenning when I hit connect:

signal sender=:1.37 -> dest=(null destination) serial=1336 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Device; member=PropertyChanged
string "Connected"
variant boolean true
signal sender=:1.91 -> dest=(null destination) serial=190 path=/org/kernel/class/bluetooth/hci0/hci0_11; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1337 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.AudioSink; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.37 -> dest=(null destination) serial=1338 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Audio; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.91 -> dest=(null destination) serial=191 path=/org/kernel/class/input/input11; interface=org.kernel.kevent; member=add
signal sender=:1.91 -> dest=(null destination) serial=192 path=/org/kernel/class/input/input11/event4; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1342 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=Connected
signal sender=:1.37 -> dest=(null destination) serial=1343 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=PropertyChanged

Can I use any of that?

Just found and checking: http://maemo.org/api_refs/5.0/5.0-fi...ontrol-api.txt - may help me...

EDIT

Seems like the command I need is:

Code:
dbus-send --system --print-reply --type=method_call --dest=org.bluez /org/bluez/1069/hci0/dev_00_1E_A4_FF_D8_BE.Connect
This page is really helpful: http://wiki.bluez.org/wiki/HOWTO/AudioDevices...

A more full script could be written using:

Code:
devmac=00:1E:A4:FF:D8:BE

adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g')
device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g')
dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
(Change the AudoSink to whatever service you want, and the devmac to the mac of your bluetooth headset,stereo,computer,teddybear...)
Hi, may I ask you what ford/sony system you have?
I too have random connection issues between n900 and both Audio BT Aux and Bluetooth Phone.
Mine is Sony System on Ford Galaxy Cosmo 2K9
Where did you get new firmware?
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 
Posts: 5 | Thanked: 2 times | Joined on Dec 2009
#3
I am very interested in a script or whatever where I can force a connect to my mw600 SE headset.


I have to pair them manually each time. And also, after being in a call, audio is no longer sent to headset, need to re-pair them again.

If I could get that automatic somehow... or a quickbutton would suffice actually.

Recapping:

Force BT connect to existing headset.
Disconnect/reconnect fast.


Anyone able to do this, or lead me in the right way?

Thanks for reading.
 
Posts: 46 | Thanked: 31 times | Joined on Jun 2010 @ Lebanon
#4
Try this in xterm:

rfcomm connect 0 <MAC_ADDRESS>

don't forget to have your bluetooth enabled and just replace <MAC_ADDRESS> with your car's stereo.

I have the same problem like you guys, except with a Kenwood

[EDIT]: You can use Desktop Command Execution widget with this command to have a shortcut on ur desktop
 
Posts: 5 | Thanked: 2 times | Joined on Dec 2009
#5
Will that command reconnect if it's already connected by any chance?

And thanks! Will try it out.
 
Posts: 45 | Thanked: 25 times | Joined on Aug 2008 @ Germany
#6
This script forces a disconnect and a reconnect:
http://talk.maemo.org/showpost.php?p...3&postcount=27
 

The Following User Says Thank You to christoph For This Useful Post:
Posts: 14 | Thanked: 0 times | Joined on Apr 2012 @ Mysore, India
#7
Hello Phedders

The below script worked for me for connecting to my sennhieser MM100 bluetooth headset when i executed one by one in x-terminal.

devmac=00:1E:A4:FF8:BE

adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g')
device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice

Please let me know how can i achieve this with Desktop Execution Command Widget

Thanks & Regards
Rajesh
 
Posts: 752 | Thanked: 2,808 times | Joined on Jan 2011 @ Czech Republic
#8
Originally Posted by rajeshgklm View Post
Hello Phedders

Please let me know how can i achieve this with Desktop Execution Command Widget

Thanks & Regards
Rajesh
You can just connect commands by replacing the line breaks with '&&' - that way you can run multiple commands consequently on line line.

You could also try the Queen Beacon Widget as it allows multi line scripts.
 
Posts: 14 | Thanked: 0 times | Joined on Apr 2012 @ Mysore, India
#9
hello novdel,

Thanks for your great support.

It's not working for me. could you please ellaborate?

Regards
Rajesh R.
 
Posts: 752 | Thanked: 2,808 times | Joined on Jan 2011 @ Czech Republic
#10
Hey Rajesh!

No problem, I'll describe it in detail.
The command you mentioned did not work for me with my Sennheiser MM400, so I'll use a command above that does work.

Instead of
Code:
devmac=FF:11:EE:22:DD:33

adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g')
device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g')
dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
...you can put this in the widget instead
Code:
devmac=FF:11:EE:22:DD:33 && adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') && device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g') && dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
that fits the one line in the widget.

Alternatively you can install Queen Beacon Widget (QBW) - it works similarly to the Command Execution Widget, but is much more customizable - you can go advanced and put the multiline version of the command in. I'd recommend QBW for its flexibility. See the wiki page for more details.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:47.