View Full Version : Turn Bluetooth on while charging....
Fracoon
12th July 2007, 11:37 AM
Hi@all.....
is there any way to automatically turn on Bluetooth while the power cable is connected to the phone? Maybe with mortscript?
This would be a reaaly great enchancment.
It could automaticaly turn on Bluetooth when you connect the phone to the charging cable in the car. (For Communication with radio or headset)
-----------------------------------------------------------------------
I will attach the newest Version of my Script in this post....
from: 12-07-07
Fracoon
12th July 2007, 11:50 AM
I found out that we can check if the device is charging at the moment in mortscript with :
x = ExternalPowered()
but what about turning on bluetooth?
shantzg001
12th July 2007, 12:09 PM
u can call the bluetoothtoggle program on checking externalpowered...u can easily find this prog on xda-developers...
otherwise writing one urself shudnt take more than a few minutes...
Fracoon
12th July 2007, 12:47 PM
I'm very Proud of me =).....
i got it workin.... this is my script...
y = 1
While( y = 1 )
x = ExternalPowered()
if (x = 1)
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-bluediscoveron" )
EndIf
if (x = 0)
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff" )
EndIf
Sleep (5000)
EndWhile
If anyone nows how to do it better... let me know
Fracoon
12th July 2007, 12:54 PM
Damn.... theres a fucking bug =)...
if i enable bluetooth without charging cable... its automatically disabled =)
have to think about it =)
Fracoon
12th July 2007, 01:07 PM
ok i've got it now
y = 1
While( y = 1 )
x = ExternalPowered()
if (x = 1)
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-bluediscoveron" )
While( x = 1)
x = ExternalPowered()
sleep(5000)
EndWhile
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff" )
EndIf
Sleep(5000)
EndWhile
ZuZ
12th July 2007, 01:10 PM
I'm very Proud of me =).....
i got it workin.... this is my script...
y = 1
While( y = 1 )
x = ExternalPowered()
if (x = 1)
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-bluediscoveron" )
EndIf
if (x = 0)
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff" )
EndIf
Sleep (5000)
EndWhile
If anyone nows how to do it better... let me know
try this.. have been a long time since i coded but i think this should work
do{
if(ExternalPowered())
Run("\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-bluediscoveron" )
Run( "\Programme\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff" )
Sleep(5000)
}while(1);
Fracoon
13th July 2007, 02:41 AM
It themes like nobody is interested in this... but it would be real great if someone could give feedback about this script... i want to know if anything in there could be better... feedback pls
Rochey13
25th September 2007, 07:30 PM
Thanks for this Fracoon, it's much appreciated. gonna start using it over the next few days on my hermes.
If you know...Whats the difference in battery life while having this poll to see if the power is connected? have you noticed anything?
Cheers again.
Rochey
Jeff
26th September 2007, 02:15 PM
Fracoon:
AWESOME!
This works REALLY well, hats off to you!
Thanks.
Entropy512
26th September 2007, 11:06 PM
Two ideas: (Note, I have not used the script, as I'm between phones at the moment. My Kaiser is on order... :) )
One: Rather than looping in between turn-on and turn-off, each time you go through the loop save the current power state. On the next time through the loop, check if the state did an off-on or on-off change. Only take action during a state change.
Two: A second feature some may want is to keep Bluetooth on after power disconnect if it was on before power connection. Similar to the last solution - Have a state variable that remembers whether BT was on prior to power connection, and don't turn it off if it was. Not sure how one would check the BT state though.
Rochey13
29th September 2007, 11:55 PM
Hi Fracoon,
I have made a mod to your code to only enable bluetooth on AC power if Bluetooth isn't on. It also won't turn bluetooth off when you disconnect AC power if it was already on before.
You just need to change the paths to Blue.exe.
cheers
Rochey
y = 1
While( y = 1 )
Bluetooth = RegRead("HKLM", "System\State\Hardware", "Bluetooth")
if (ExternalPowered() = 1 && Bluetooth = 8)
Run( "\storage card\my documents\personal\autoblue\blue.exe", "-bluediscoveron" )
While(ExternalPowered() = 1)
sleep(5000)
EndWhile
Run( "\storage card\my documents\personal\autoblue\blue.exe", "-blueoff" )
EndIf
Sleep(5000)
EndWhile
alitheg
8th November 2007, 05:06 PM
Hi,
Does anyone have a compiled version of this, or can you tell me how I would go about implementing it on my ipaq? This is something I'd really like to have working!
Thanks
wensing
14th November 2007, 07:45 PM
Download MortScript from http://www.sto-helit.de/.
Install the correct cab file on your device, for me this was "MortScript-4.1-PPC.cab".
Download VJVolubilis from http://www.vijay555.com/?Releases:VJVolubilis
Install the cab file on your device
Save the script from Rochey13 as a MortScript file, for example bluecharge.mscr and put this file on your device.
Modify the script to point to \Program Files\vijay555\VJVolubilis\VJVolubilis.exe.
Test the script by tapping it, it will be started by mortscript.exe.
If it is OK, you might want a shortcut in \Windows\Startup.
cayotte
14th November 2007, 11:07 PM
Thanks a lot for bringing the script so my headset will now automatically connected to my phone.
alitheg
15th November 2007, 12:19 AM
Thats great thanks!
slarty01
18th November 2007, 02:16 PM
Excellent stuff this worked really well for me 1st time. Please is there a method of enabling A2DP at the same time? I have a new Kaiser and I want to script it to enable BT and A2DP. Any ideas?
Download MortScript from http://www.sto-helit.de/.
Install the correct cab file on your device, for me this was "MortScript-4.1-PPC.cab".
Download VJVolubilis from http://www.vijay555.com/?Releases:VJVolubilis
Install the cab file on your device
Save the script from Rochey13 as a MortScript file, for example bluecharge.mscr and put this file on your device.
Modify the script to point to \Program Files\vijay555\VJVolubilis\VJVolubilis.exe.
Test the script by tapping it, it will be started by mortscript.exe.
If it is OK, you might want a shortcut in \Windows\Startup.
VOODOOS!L
19th November 2007, 08:47 PM
You could also just very easily configure PhoneAlarm to switch to your desired profile, ones you come into your car, or in a specific region or at a specific time. Then, you can let PhoneAlarm turn on your bluetooth/application/sound settings etc. Very usefull, and very easy. I think it will also be much more performant than running such a looping script all the time.
good luck!
wensing
19th November 2007, 09:12 PM
You could also just very easily configure PhoneAlarm to switch to your desired profile, one you come into your car, or in a specific region or at a specific time. Then, you can let PhoneAlarm turn on your bluetooth/application/sound settings etc. Very usefull, and very easy. I think it will also much more performant than running such a looping script all the time.
good luck!
PhoneAlarm is a nice tool, but isn't free.
And IMO performance isn't needed when powering on the phone when it is in craddle in my car :-)
The script does the job within a couple of seconds. I even added a rotate and question to start TomTom to it.
Excellent stuff this worked really well for me 1st time. Please is there a method of enabling A2DP at the same time? I have a new Kaiser and I want to script it to enable BT and A2DP. Any ideas?
Maybe you can use A2DPToggle to start ad2p.exe with the proper parameter.
http://teksoftco.com/forum/viewtopic.php?t=1626
cayotte
20th November 2007, 12:26 AM
You could also just very easily configure PhoneAlarm to switch to your desired profile, one you come into your car, or in a specific region or at a specific time. Then, you can let PhoneAlarm turn on your bluetooth/application/sound settings etc. Very usefull, and very easy. I think it will also much more performant than running such a looping script all the time.
good luck!
Is it possible using PhoneAlarm to switch automatically to car profile once we get into our car?
VOODOOS!L
20th November 2007, 08:20 AM
Is it possible using PhoneAlarm to switch automatically to car profile once we get into our car?
yes you can automaticly change profile when charger is connected or when certain appointment (like car) appears in you agenda.
And IMO performance isn't needed when powering on the phone when it is in craddle in my car :-)
The script does the job within a couple of seconds. I even added a rotate and question to start TomTom to it.
As I see the script, this will be running all the time in the background, no?
So you will lose performance on your device all the time...I 'm not saying you won't lose performance by installing PhoneAlarm...but all the many very nice extra options you get with PhoneAlarm are worth it, while this little script doesn't seem to me...
but your right, PhoneAlarm isn't free, but worth it's 15€!!
the archer
21st November 2007, 07:12 PM
Can anyone help, i tried the below but can not get this to work on my M3100 running Black X, has anyone any ideas.
Download MortScript from http://www.sto-helit.de/.
Install the correct cab file on your device, for me this was "MortScript-4.1-PPC.cab".
Download VJVolubilis from http://www.vijay555.com/?Releases:VJVolubilis
Install the cab file on your device
Save the script from Rochey13 as a MortScript file, for example bluecharge.mscr and put this file on your device.
Modify the script to point to \Program Files\vijay555\VJVolubilis\VJVolubilis.exe.
Test the script by tapping it, it will be started by mortscript.exe.
If it is OK, you might want a shortcut in \Windows\Startup.
onesolo
22nd November 2007, 10:53 AM
Great great would be if possible to switch between profiles depending on the Cellular Mobile Network. On my old Sonyericsson P800 I had a program that does that, but since then I never found another program that did that for the WM platform...
VOODOOS!L
22nd November 2007, 03:13 PM
Great great would be if possible to switch between profiles depending on the Cellular Mobile Network. On my old Sonyericsson P800 I had a program that does that, but since then I never found another program that did that for the WM platform...
sorry, me again: check out PhoneAlarm
(I have nothing commerically to do with PhoneAlarm, I just like it...;) )
slarty01
25th November 2007, 02:11 PM
PhoneAlarm is a nice tool, but isn't free.
And IMO performance isn't needed when powering on the phone when it is in craddle in my car :-)
The script does the job within a couple of seconds. I even added a rotate and question to start TomTom to it.
Maybe you can use A2DPToggle to start ad2p.exe with the proper parameter.
http://teksoftco.com/forum/viewtopic.php?t=1626
Thats an idea I use the app already but I hadn't thought of that. thanks
danieg
18th April 2009, 01:15 PM
The thread on turning on bluetooth while charging intrigued me as I'm experience poor battery life from my Palm Treo Pro.. :(
I've been using the posted code for a while now, and it improves battery life a lot and best of all it makes it easier to use my phone in the car - I just plug it in, bluetooth turns on and it connects to the car kit :)
I thought you may like to see my improved 'lightweight' code for this purpose. The main difference is that it doesn't constantly run the turn bluetooth command on and off, instead it only does so if the powerstate changes..
Mortscript starts:
y=1
while(y = 1)
x = ExternalPowered()
z = x
if (x = 1)
Run( "\Program Files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueon" )
EndIf
if (x = 0)
Run( "\Program Files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff" )
EndIf
while(z = x)
x = ExternalPowered()
sleep (15000)
Endwhile
Endwhile
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.