• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Automated In-Car Wifi Hotspot with Tasker

Search This thread

braddaniels

New member
Nov 18, 2013
3
3
About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.

I made a video to provide a overview of my setup that can be found here. I can't post links yet so you'll have to copy and paste!

Code:
youtu.be (slash) jkDr9mLY568

Hardware
Nexus 7 Wifi 2012 rooted running stock KitKat with Xposed Framework installed.
Nexus 5 rooted running stock KitKat with Xposed. I’ve also tested this with a GNex and G2 and it worked great with both of those.
Previously I ran CM on both my phone and tablet and it worked fine.

Software

Connectivity:
Tasker
Secure Settings (I use Pro, but I don’t think it’s necessary, correct me if I’m wrong)
Tablet Talk
Tasker/Locale Plugin for Tablet Talk
SSID Selector (Tasker plugin)
All these except for SSID Selector need to be installed on both the phone and tablet.​

Apps:
AutoVoice - allows you to create your own voice commands and have Tasker parse them.
GMD Gesture Control Create custom multitouch gestures.
Waze
Spotify
Waze and Spotify are the only apps I have in focus 99% of the time. I have Torque installed and it works great, but I rarely use it.

Tasker

Tablet
Profile: Wifi Tether Control
State: Power any
Entry task: Powered On
  1. Wifi Off: This disconnects me from my home network in case I’m using my home wifi
  2. Brightness up if Daytime profile active, turn down otherwise
  3. Tablet Talk Action: Start BT Mode - start Tablet Talk connection to phone, this tells the phone to turn on the hotspot.
  4. Display timeout: 20 min
  5. Wait 4 secs - this gives the phone time to start the hotspot. I’ve found everything works better if there is a pause here.
  6. SSID Selector - only connect to my phones wifi network
  7. Wifi on
  8. Secure Settings: GPS on
  9. Auto-Sync on
Exit task: Unpowered
  1. Stop task if the powered on task is running. This is to prevent a problem I was having where if I turned the car key too slow, it would start this task while the entry task was still running, leaving the car running but the tablet and hotspot off.
  2. Get location and use Pushbullet to send location to phone
  3. Tablet Talk: Disable - this triggers the exit task on the phone that turns the hotspot off
  4. Wifi, GPS, autosync off.
  5. Send intent to close Waze - Waze doesn’t seem to respond well to being killed, so I use an intent to turn it off. If I don’t do this it is a MAJOR battery drain.
  6. Media Utilities Action: Pause - the built in media actions don’t seem to pause Spotify reliably, so I use this plugin
  7. Lock screen and set lockscreen PIN with Secure Settings

Phone
Profile: Car Tethering
Entry task: Start Wifi Tethering
  1. Ringer on
  2. Wifi Tether on
  3. Notify Sound
Exit Task: Stop Wifi Tethering
  1. Wifi Tether Off
  2. Notify Cancel: Tethering on notification
  3. Notify Sound: Tethering off
  4. Wait 5 secs
  5. Turn wifi back on
  6. Notify Cancel

I've attached all the tasks and profiles I use on my tablet. I'll add some explanations for the rest of them later on if anyone is interested. They include things like:
  • Gathering sunset/sunrise times to automatically adjusting brightness
  • Switching to Waze if there is no touches detected for x number of seconds
  • AutoVoice tasks and profiles for searching Spotify, Waze, and Google Maps
 

Attachments

  • tasks.zip
    18.1 KB · Views: 2,236
  • profiles.zip
    16 KB · Views: 1,970
Last edited:

khaytsus

Senior Member
Apr 8, 2008
7,263
1,176
Central Kentucky
About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.

So I assume your car turns off the charge port (ie: lighter port) when the ignition is off? That certainly makes this sort of thing a little easier, and sounds like your N7 is dedicated to car duties.

I like the idea of switching back to Waze when otherwise idle, I might do that myself. I do all of the rest, including the backlight management using a tiny web service I wrote for myself to get sunrise/sunset times.

My do it on my phone, however, I don't mount the N7 itself. So I use an NFC tag as my "Start car mode" context.
 

braddaniels

New member
Nov 18, 2013
3
3
So I assume your car turns off the charge port (ie: lighter port) when the ignition is off? That certainly makes this sort of thing a little easier, and sounds like your N7 is dedicated to car duties.

I like the idea of switching back to Waze when otherwise idle, I might do that myself. I do all of the rest, including the backlight management using a tiny web service I wrote for myself to get sunrise/sunset times.

My do it on my phone, however, I don't mount the N7 itself. So I use an NFC tag as my "Start car mode" context.

Yes it stays in my car mounted on the dash unless I'm in a bad neighborhood or something. I live in Central Florida, and so far the heat has not been an issue. The battery still works fine even after sitting my dash for a year now. I know that it is a risk though, a friend of mine had a bargain bin Android tablet that blew up in her car a few weeks ago just sitting on the backseat.

Like I mentioned in the video, I just want it to work without thinking about it, I got sick of fumbling with my phone whenever I got into my car, and I didn't use my Nexus 7 that much anyway, so I decided to do this. Yes my lighter ports only work when the ignition is on. I don't think this is necessarily the most ideal way to detect when to turn the car is on though. I'd like for Tasker to implement Bluetooth proximity as a state, that might be useful. I recall seeing it on their todo list, but I'm not holding my breath.

I have an ODBII BT dongle, and I tried using that to detect when the car was on, but I found it to be clumsy and unreliable. I even experimented with the accelerometer to detect the vibration of the car running, but that wouldn't have worked too well.

In case you were wondering about battery drain while it's off, it's negligible. I'm sure if I left it off for a week or so it would probably die, but my 3.1 A charger charges it even with the screen on full brightness. The only time I've had to charge it while the car's not running is when some service doesn't shut down right due to a bug in my Tasker setup. I have had some bad luck with crappy USB cables, so make sure you get the highest quality and shortest length possible to maximize charging.
 

TheBlueDuck

Member
Feb 24, 2015
6
0
Thanks

I know this is an old post now, but this is exactly what I've been trying to achieve with my car setup with Note 3 / Galaxy Tab 8.4. Thank you for posting. This should save me a lot of time.

I have bluetooth in my Jeep and will be sending all tablet audio to the Jeep to play. I've had mixed results with it working and with it playing on the tablet so I may need to tweek Bluetooth Auto Connect. If that still wont work well I'll have to AUX cable it.

I just downloaded all your profiles and tasks and will give this a try with my setup. I really like how you have it auto start wifi tethering on the phone and then open Waze. I have an added step of activating Foxfi and then clicking a few boxes before that activates, so I need to figure that one out.

I also installed all your other profiles/tasks, though I don't know what all of them do yet. I'll need to go through them and see which ones apply to how I use my phone. Do you have any of those on your tablet as well, or are the extras just for your phone?
 

braddaniels

New member
Nov 18, 2013
3
3
I know this is an old post now, but this is exactly what I've been trying to achieve with my car setup with Note 3 / Galaxy Tab 8.4. Thank you for posting. This should save me a lot of time.

I have bluetooth in my Jeep and will be sending all tablet audio to the Jeep to play. I've had mixed results with it working and with it playing on the tablet so I may need to tweek Bluetooth Auto Connect. If that still wont work well I'll have to AUX cable it.

I just downloaded all your profiles and tasks and will give this a try with my setup. I really like how you have it auto start wifi tethering on the phone and then open Waze. I have an added step of activating Foxfi and then clicking a few boxes before that activates, so I need to figure that one out.

I also installed all your other profiles/tasks, though I don't know what all of them do yet. I'll need to go through them and see which ones apply to how I use my phone. Do you have any of those on your tablet as well, or are the extras just for your phone?

I didn't post the profiles and tasks from my phone because it should be relatively simple to implement yourself. I would highly recommend you try to build most of these profiles yourself and just use mine as a template. It'll make troubleshooting much easier if something doesn't work right.
 

JaredMardel

Member
Oct 1, 2012
8
0
Mar del Plata
Find My Phone

Hi Brad,

Just like to say thank you for sharing... you are streaks ahead in using tasker! I bought tasker about 1 year ago and fooled around with it and got the basic stuff I needed to work just fine. However, now I will be installing a nexus 7 as a fixed in dash carpc... replacing my old actual carpc running windows with centrafuse/riderunner, I will need to automatize pretty much everything as I will not have access to the side buttons.

I have imported your profiles and task and I am tweaking them for my needs. Only thing it complaining about is "Find My Phone", could you give me some pointers, if you can remember.
Thanks again...

Jared.


About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.

I made a video to provide a overview of my setup that can be found here. I can't post links yet so you'll have to copy and paste!

Code:
youtu.be (slash) jkDr9mLY568

Hardware
Nexus 7 Wifi 2012 rooted running stock KitKat with Xposed Framework installed.
Nexus 5 rooted running stock KitKat with Xposed. I’ve also tested this with a GNex and G2 and it worked great with both of those.
Previously I ran CM on both my phone and tablet and it worked fine.

Software

Connectivity:
Tasker
Secure Settings (I use Pro, but I don’t think it’s necessary, correct me if I’m wrong)
Tablet Talk
Tasker/Locale Plugin for Tablet Talk
SSID Selector (Tasker plugin)
All these except for SSID Selector need to be installed on both the phone and tablet.​

Apps:
AutoVoice - allows you to create your own voice commands and have Tasker parse them.
GMD Gesture Control Create custom multitouch gestures.
Waze
Spotify
Waze and Spotify are the only apps I have in focus 99% of the time. I have Torque installed and it works great, but I rarely use it.

Tasker

Tablet
Profile: Wifi Tether Control
State: Power any
Entry task: Powered On
  1. Wifi Off: This disconnects me from my home network in case I’m using my home wifi
  2. Brightness up if Daytime profile active, turn down otherwise
  3. Tablet Talk Action: Start BT Mode - start Tablet Talk connection to phone, this tells the phone to turn on the hotspot.
  4. Display timeout: 20 min
  5. Wait 4 secs - this gives the phone time to start the hotspot. I’ve found everything works better if there is a pause here.
  6. SSID Selector - only connect to my phones wifi network
  7. Wifi on
  8. Secure Settings: GPS on
  9. Auto-Sync on
Exit task: Unpowered
  1. Stop task if the powered on task is running. This is to prevent a problem I was having where if I turned the car key too slow, it would start this task while the entry task was still running, leaving the car running but the tablet and hotspot off.
  2. Get location and use Pushbullet to send location to phone
  3. Tablet Talk: Disable - this triggers the exit task on the phone that turns the hotspot off
  4. Wifi, GPS, autosync off.
  5. Send intent to close Waze - Waze doesn’t seem to respond well to being killed, so I use an intent to turn it off. If I don’t do this it is a MAJOR battery drain.
  6. Media Utilities Action: Pause - the built in media actions don’t seem to pause Spotify reliably, so I use this plugin
  7. Lock screen and set lockscreen PIN with Secure Settings

Phone
Profile: Car Tethering
Entry task: Start Wifi Tethering
  1. Ringer on
  2. Wifi Tether on
  3. Notify Sound
Exit Task: Stop Wifi Tethering
  1. Wifi Tether Off
  2. Notify Cancel: Tethering on notification
  3. Notify Sound: Tethering off
  4. Wait 5 secs
  5. Turn wifi back on
  6. Notify Cancel

I've attached all the tasks and profiles I use on my tablet. I'll add some explanations for the rest of them later on if anyone is interested. They include things like:
  • Gathering sunset/sunrise times to automatically adjusting brightness
  • Switching to Waze if there is no touches detected for x number of seconds
  • AutoVoice tasks and profiles for searching Spotify, Waze, and Google Maps
 

snake2332

Senior Member
Dec 26, 2010
235
41
Montana
Thanks for all the info and stuff. I'll have to check out the GMD and Autovoice apps. I just got a Nexus 7 set up in my car and am loving it so far. I have Tasker helping me out greatly because I too don't want to take my S6 out of my pocket when I'm driving.

My Nexus 7 has "screen always on while charging" enabled in Dev options. I haven't set the fastboot oem off-mode-charge to a zero yet since I don't think I need it to turn off completely, though I will probably do this since I can't reach the power button with a decent amount of effort.

Turn car key, Nexus 7 comes on and turns on wifi (state -> power any = wifi on). This is mostly because it stopped connecting to my S6 tether unless I toggled wifi off and on. I plan on using airplane-mode but haven't set that up yet since it was not available in Tasker (maybe it is in Secure Settings, I hope).

My S6 turns on wifi hotspot when bluetooth connects to "Alpine CD Receiver". I added an Exit task of "wait 5 seconds, then wifi on" to get wifi to enable again since it wasn't automatically.

The Nexus 7 bases some tasks off of the state = wifi connected to S6 tether. Tasks include turning on bluetooth (I need it to connect to Alpine head-unit AFTER the S6 or else the Alpine goes wonky), setting car mode to ON and going home (Car Home Ultra), launching the speed volume app so my volume fluctuates with speed (I don't want to have to touch the Alpine volume knob), and performs the media key operation of "play" to resume whatever music I had playing.

One difference for me is that I want to still use my phone for talking and don't want to do any texting from the car, so I don't use Tablet Talk. Although...texting via voice commands on the tablet would be handy. I will definitely set that up, so thanks for that idea.

It all works pretty well, but I'm only a day or two into doing all of this so I need to tweak stuff still.

Can anyone explain how automatic exit tasks work, like on my S6 - if it loses BT connection for just a second, wifi hotspot turns off, which then triggers the Nexus to perform a bunch of automatic tasks like exiting car mode, turn off bluetooth thus stopping music, etc. It seems to me like Tasker should show you the tasks it will perform when the State is exited. Sure, you can add exit tasks...does adding an exit task cause it to no longer perform its own invisible/assumed exit tasks? I am still a Tasker newb. In fact, this post clued me into the fact that Tasker has exit tasks, haha. I'd like it if it had some threshold so it wouldn't start doing these exit tasks so quickly. Like, maybe a "wait 5 seconds" exit task to see if the State turns on again. I'll do some reading and testing.

BhubrshQoRvbFAj

(imgur and google photos links don't work on XDA???)
link
 
Last edited:

mylk100

Member
Jan 29, 2014
7
0
Exit task not running

I was able to get the auto_connect to my hotspot with the waits. :victory: So thank you for the tip. However, I am running into issues of the task running an exit. It just doesn't seem to run when I disconnect from my Bluetooth device. Any ideas?
By the way, I am able to run each individual task and it works
 
Last edited:

Paansarkija

New member
Jan 17, 2018
1
0
Hey. I'm having a really hard time (5h) now figuring how to trigger the tether or in my phone. My car doesnt habe a bluetooth so i've been trying to trigger the tether with my tablets bluetooth. The problem is that the bluetooth needs to be activates from the settings each time. I tried with bluetooth suto connect addon but couldnt get that work either. I have Samsung s8+ and lenovo tab 4. Someone please help me :D
 

Buratei

Senior Member
Sep 12, 2012
152
16
since i am such a cheap bastard, i opted not to pay for tasker and ended up doing it with llama and e-robot, except it was for my g2 dedictated to nav duty rather than a nexus 7.

with bt auto connect on the g2and autotether on my main phone (bacon), it is a pretty much a hands free affair as long as i leave bt on on the bacon. presence of charging source and screen on/off are being used as the triggers to toggle airplane mode, bt, gps and the nav app

the only problem is, i get a massive battery drain with this setup. i usually find my phone either fully discharged or almost there when i come back on the next day. did the exact same on my mom's galaxy note 3 and thay one fares much better albeit not great (about -10% overnight). the battery on the g2 was replaced not too long ago. dunno, maybe it is the version of lineageos i am using (14.1 for d802/f320)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    About a year ago I mounted my Nexus 7 2012 Wifi in my car, and came up with some Tasker scripts to have my phone automatically start wifi tethering as soon as I turn the key. I’d like to share with you all how I did it, and answer any questions anybody might have.

    I made a video to provide a overview of my setup that can be found here. I can't post links yet so you'll have to copy and paste!

    Code:
    youtu.be (slash) jkDr9mLY568

    Hardware
    Nexus 7 Wifi 2012 rooted running stock KitKat with Xposed Framework installed.
    Nexus 5 rooted running stock KitKat with Xposed. I’ve also tested this with a GNex and G2 and it worked great with both of those.
    Previously I ran CM on both my phone and tablet and it worked fine.

    Software

    Connectivity:
    Tasker
    Secure Settings (I use Pro, but I don’t think it’s necessary, correct me if I’m wrong)
    Tablet Talk
    Tasker/Locale Plugin for Tablet Talk
    SSID Selector (Tasker plugin)
    All these except for SSID Selector need to be installed on both the phone and tablet.​

    Apps:
    AutoVoice - allows you to create your own voice commands and have Tasker parse them.
    GMD Gesture Control Create custom multitouch gestures.
    Waze
    Spotify
    Waze and Spotify are the only apps I have in focus 99% of the time. I have Torque installed and it works great, but I rarely use it.

    Tasker

    Tablet
    Profile: Wifi Tether Control
    State: Power any
    Entry task: Powered On
    1. Wifi Off: This disconnects me from my home network in case I’m using my home wifi
    2. Brightness up if Daytime profile active, turn down otherwise
    3. Tablet Talk Action: Start BT Mode - start Tablet Talk connection to phone, this tells the phone to turn on the hotspot.
    4. Display timeout: 20 min
    5. Wait 4 secs - this gives the phone time to start the hotspot. I’ve found everything works better if there is a pause here.
    6. SSID Selector - only connect to my phones wifi network
    7. Wifi on
    8. Secure Settings: GPS on
    9. Auto-Sync on
    Exit task: Unpowered
    1. Stop task if the powered on task is running. This is to prevent a problem I was having where if I turned the car key too slow, it would start this task while the entry task was still running, leaving the car running but the tablet and hotspot off.
    2. Get location and use Pushbullet to send location to phone
    3. Tablet Talk: Disable - this triggers the exit task on the phone that turns the hotspot off
    4. Wifi, GPS, autosync off.
    5. Send intent to close Waze - Waze doesn’t seem to respond well to being killed, so I use an intent to turn it off. If I don’t do this it is a MAJOR battery drain.
    6. Media Utilities Action: Pause - the built in media actions don’t seem to pause Spotify reliably, so I use this plugin
    7. Lock screen and set lockscreen PIN with Secure Settings

    Phone
    Profile: Car Tethering
    Entry task: Start Wifi Tethering
    1. Ringer on
    2. Wifi Tether on
    3. Notify Sound
    Exit Task: Stop Wifi Tethering
    1. Wifi Tether Off
    2. Notify Cancel: Tethering on notification
    3. Notify Sound: Tethering off
    4. Wait 5 secs
    5. Turn wifi back on
    6. Notify Cancel

    I've attached all the tasks and profiles I use on my tablet. I'll add some explanations for the rest of them later on if anyone is interested. They include things like:
    • Gathering sunset/sunrise times to automatically adjusting brightness
    • Switching to Waze if there is no touches detected for x number of seconds
    • AutoVoice tasks and profiles for searching Spotify, Waze, and Google Maps