Go Back   Android Forums > Android Discussion > Android Applications
Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old August 3rd, 2010, 11:45 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Aug 2010
Posts: 2
 
Device(s): Droid X
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default Tasker save gps location

Just got my DX in the mail today and I've been playing with it ever since! (Coming from LG Dare)

I've been messing with tasker and have an idea but am not sure how to implement it so I thought Id post and see if anyone had any ideas.
I have a pioneer gps unit in my car with hands free bluetooth. My idea is to have tasker save the gps location of my phone when it disconnects from my cars bluetooth and then turn off bluetooth. Then, I can have tasker turn bluetooth back on when I enter that saved location.

I know this may be asking a lot from tasker but what does everyone think?

Caliber is offline  
Reply With Quote
sponsored links
Old August 4th, 2010, 08:15 AM   #2 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

If you're thinking of using a GPS Location (as opposed to a Network Location) you'll probably find that just leaving bluetooth on all the time will be more efficient in terms of battery use.

If you want to try it anyway, I can certainly whip something up.
UncleMike is offline  
Reply With Quote
Old August 6th, 2010, 07:10 PM   #3 (permalink)
Member
 
Join Date: Dec 2009
Posts: 139
 
Device(s): Nexus 7 iphone 5s
Carrier: Not Provided

Thanks: 12
Thanked 6 Times in 6 Posts
Default

bump for an answer on this I was thinking initally... add state - bluetooth connection and then make a fony task... and then add exit task to bluetooth connection to save gps location... didn't work though..
edhgreatone is offline  
Reply With Quote
Old August 7th, 2010, 12:24 AM   #4 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Without seeing exactly what you're doing in Tasker I can't say for sure, but my guess is that you're not getting a current GPS fix before saving the location. Here's what I came up with a while back:

Profile: GetGPSfix
Context: Location [GPS: On] <actual location doesn't matter>
Enter Task:
Stop


After creating the above profile, disable it.


Profile: Car Parked
Context: Bluetooth Connected
Exit Task:
GPS [Set: On]
Profile Status [Name: GetGPSfix] [Set: On]
Wait 30 seconds
Profile Status [Name: GetGPSfix] [Set: Off]
Variable Set [Name: %CARLOC] [Value: %LOC]
GPS [Set: Off]


Tasker doesn't (yet) include the ability to get a current GPS fix before reading the %LOC variable. To get around this we use a dummy profile called GetGPSfix. Enabling a GPS-based location profile causes Tasker to get a current fix. Waiting 30 seconds give the GPS time to determine your location.

The stumbling block with regard to your original post is that you can't user a variable to specify a location for a Location context.
UncleMike is offline  
Reply With Quote
Old August 7th, 2010, 01:04 AM   #5 (permalink)
Member
 
Join Date: Apr 2010
Posts: 183
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 5 Times in 5 Posts
Default

One question, withou GPS, how could you know you've entered that position?
__________________
free android apps
Brinkley1988 is offline  
Reply With Quote
Old August 7th, 2010, 07:44 AM   #6 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Quote:
Originally Posted by Brinkley1988 View Post
One question, withou GPS, how could you know you've entered that position?
You wouldn't. At least not with enough accuracy to make it usable.

The originally stated purpose isn't doable because Tasker doesn't allow you to specify a location with a variable. I think it's been on the todo list for a while, but it's not available yet.

Even if it was technically possible, (I think) it would be more battery efficient to just leave bluetooth on instead of leaving GPS on in order to know when to turn bluetooth back on.

It would be possible to implement some sort of Bluetooth Near function by turning bluetooth on periodically and seeing if it connected, and if not, turning it off again. But this would require the device to wake up for each check, and could possibly be more of a battery drain than leaving bluetooth on.
UncleMike is offline  
Reply With Quote
Old September 22nd, 2010, 11:40 AM   #7 (permalink)
Junior Member
 
Join Date: Feb 2010
Posts: 20
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by UncleMike View Post
Profile: GetGPSfix
Context: Location [GPS: On] <actual location doesn't matter>
Enter Task:
Stop

After creating the above profile, disable it.

I have created the exact profile but it will never get a fix when I enable it. I have selected both Net and GPS, just GPS, and just NET but they will never get a fix when the profile is enabled.
SlimJimE is offline  
Reply With Quote
Old September 22nd, 2010, 02:01 PM   #8 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Quote:
Originally Posted by SlimJimE View Post
I have created the exact profile but it will never get a fix when I enable it. I have selected both Net and GPS, just GPS, and just NET but they will never get a fix when the profile is enabled.
I have the same profile I'm using for finding the location of the phone via SMS. I've adjusted the wait time to 1 minute, which seems to work when the device is awake. However, I've discovered (with some help) that enabling the GetGPSfix profile will not force a GPS fix while the device is asleep. In this case, you have to wait until the Display Off timings under Preferences allow for the location fix to occur.

A way that seems to be working, making sure you get a current fix, is to use these profiles:

Profile: GetGPSfix
Context: Location [GPS: On] <actual location doesn't matter>
Enter Task:
Stop


Profile: WaitForGPSfix
Context: Variable Set %LOCTMS
Task:
Variable Set [Name: %CARLOC] [Value: %LOC]
Profile Status [Name: GetGPSfix] [Set: Off]
Profile Status [Name: WaitForGPSfix] [Set: Off]
GPS [Set: Off]


Profile: Car Parked
Context: Bluetooth Connected
Exit Task:
GPS [Set: On]
Profile Status [Name: WaitForGPSfix] [Set: On]
Profile Status [Name: GetGPSfix] [Set: On]

This waits for the time of the last GPS fix to be updated. I believe when Tasker reaches the GPS Timeout period it will return a network-based location value and update the time of last fix.
UncleMike is offline  
Reply With Quote
Old September 22nd, 2010, 04:32 PM   #9 (permalink)
Junior Member
 
Join Date: Feb 2010
Posts: 20
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 1 Time in 1 Post
Default

Can you explain what %LOCTMS Context does? I know the varable is the time from last fix but not sure why it would wait until there is a current fix? Is the Variable Set [Name: %CARLOC] [Value: %LOC] needed?
SlimJimE is offline  
Reply With Quote
Old September 22nd, 2010, 11:24 PM   #10 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Quote:
Originally Posted by SlimJimE View Post
Can you explain what %LOCTMS Context does? I know the varable is the time from last fix but not sure why it would wait until there is a current fix? Is the Variable Set [Name: %CARLOC] [Value: %LOC] needed?
The %LOCTMS variable is the time of the last fix, as you said. The WaitForGPSfix profile waits for that time to be updated, indicating that a fix has just been obtained, and then records the current location in %CARLOC so that future fixes don't cause that value to get lost.

With the default settings in Tasker, if your device has been asleep for a while, the position stored in %LOC could be up to 10 minutes old if you have a GPS-based profile enabled, or even older if no profiles are using GPS. When you wake up the device, it will immediately try to get a fix if any GPS-based profiles are enabled, so the wait normally won't be long, but if you just grab the current value of %LOC without making sure the information is recent, your location could be way off.
UncleMike is offline  
Reply With Quote
sponsored links
Old September 23rd, 2010, 12:55 PM   #11 (permalink)
Junior Member
 
Join Date: Feb 2010
Posts: 20
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 1 Time in 1 Post
Default

That sounds like it would work fine with the SMS location for finding a lost phone but it sounds like if you were using it for a Car Location that you could be a mile away before a fix was given. It would be nice if tasker could somehow force a GPS fix.
SlimJimE is offline  
Reply With Quote
Old September 24th, 2010, 04:46 PM   #12 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Quote:
Originally Posted by SlimJimE View Post
That sounds like it would work fine with the SMS location for finding a lost phone but it sounds like if you were using it for a Car Location that you could be a mile away before a fix was given. It would be nice if tasker could somehow force a GPS fix.
If you're triggering this with a widget or while the device is otherwise awake, it should only take a minute or so.

A forced GPS fix is on the to do list already.
UncleMike is offline  
Reply With Quote
Old November 5th, 2010, 08:00 PM   #13 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Help please!

Hi Uncle Mike,
I'm trying to do something similar using your code to let my phone know whether I'm driving or not. The idea was when I leave home (my wifi disconnects) my gps turns on, it uses %loc data so if spied is greater than e.g. 4m/s then this is driving (will then be used to change call settings etc)
The problem is updating the %loc data - I've used what you've done but its not working and I have a few questions...
Essentially, in what order does Tasker manage nested profiles? Your "Parked Car" send to run "Wait..." before it runs "Get..." "Wait..." then seems to set carloc to %loc BEFORE running "Get...", and then closes "Get..." which I didn't think had been started yet...
Please help! :-(
And thank you, I'm already much closer thanks to you!
MarkusIscariot is offline  
Reply With Quote
Old November 5th, 2010, 08:04 PM   #14 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops, "spied" means "speed", "send" means "seems"
That's the problem with swype ;-)
MarkusIscariot is offline  
Reply With Quote
Old November 6th, 2010, 08:39 AM   #15 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,122
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 59
Thanked 391 Times in 324 Posts
Default

Quote:
Originally Posted by MarkusIscariot View Post
Hi Uncle Mike,
I'm trying to do something similar using your code to let my phone know whether I'm driving or not. The idea was when I leave home (my wifi disconnects) my gps turns on, it uses %loc data so if spied is greater than e.g. 4m/s then this is driving (will then be used to change call settings etc)
The problem is updating the %loc data - I've used what you've done but its not working and I have a few questions...
Essentially, in what order does Tasker manage nested profiles? Your "Parked Car" send to run "Wait..." before it runs "Get..." "Wait..." then seems to set carloc to %loc BEFORE running "Get...", and then closes "Get..." which I didn't think had been started yet...
Please help! :-(
And thank you, I'm already much closer thanks to you!
I had to go back and see what I wrote, which was about 6 weeks ago. Since that time, Tasker has the added ability to force a current GPS fix, so I would probably re-write the whole thing. I think it's best to start from scratch at this point. What iis it you're trying to do?
UncleMike is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Discussion > Android Applications
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:56 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.