FORUMS
Remove All Ads from XDA

How to turn on/off wifi hotspot on bluetooth connect/disconnect

85 posts
Thanks Meter: 5
 
By glenb83, Member on 15th June 2017, 12:57 AM
Post Reply Email Thread
Hi All,

I'm new to Tasker but reading around various forums, it seems it will do what I need, just not sure HOW and I'm hoping someone here can help?!

I have an Android car radio and a Nexus 6P. I want to be able to setup a task/profile so that when my phone pairs to the headunit via bluetooth at power on, it turns the phone WiFi off and the WiFi hotspot on. Then when the car is turned off and bluetooth disconnects, it will turn off my phone hotspot and turn my phone WiFi back on.

I'm sure it's fairly simple for someone who knows what they are doing, any assistance would be much appreciated!
15th June 2017, 02:04 AM |#2  
Senior Member
Thanks Meter: 34
 
More
I have this set up with a profile like so:

State=bluetooth connected, 'CAR KIT'
--->task 'CarTether' (WiFi Tether=Set On)
<---exit task 'CarTetherExit' (WiFi Set On)

I have another profile that turns off bluetooth after 1 minute if it's not connected, thats what triggers the exit task (since it's no longer connected to 'CAR KIT' when I turn off the car). AFAIK when you turn hotspot on your phone will turn off wifi on its own, but you need to turn it back on (hence the exit task), and when wifi turns back on the hotspot should turn off.
21st June 2017, 01:24 AM |#3  
OP Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by Andromeda_Station

I have this set up with a profile like so:

State=bluetooth connected, 'CAR KIT'
--->task 'CarTether' (WiFi Tether=Set On)
<---exit task 'CarTetherExit' (WiFi Set On)

I have another profile that turns off bluetooth after 1 minute if it's not connected, thats what triggers the exit task (since it's no longer connected to 'CAR KIT' when I turn off the car). AFAIK when you turn hotspot on your phone will turn off wifi on its own, but you need to turn it back on (hence the exit task), and when wifi turns back on the hotspot should turn off.

Thanks for the advice, I've managed to setup a tasker profile that turns on wifi hotspot when Bluetooth connects and turns on wifi when it disconnects. The task works well, except that when the hotspot turns on, the radio won't connect, it gets stuck on obtaining IP address and Los to connecting, obtaining IP address but never connects. If I manually turn hotspot off and on again with the quick menu toggle it connects straight away. Any thoughts?

Sent from my Nexus 6P using Tapatalk
21st June 2017, 02:29 AM |#4  
Senior Member
Thanks Meter: 34
 
More
Quote:
Originally Posted by glenb83

The task works well, except that when the hotspot turns on, the radio won't connect, it gets stuck on obtaining IP address and Los to connecting, obtaining IP address but never connects

Hrmm...I've not come across that one. If I had to guess, maybe one is trying to do something before the other is totally ready? The only thing I can think to try is experiment with a 1 or 2 second delay in different places, like a 'wait 1 sec' in between the bluetooth connecting and the hotspot turning on
21st June 2017, 05:26 AM |#5  
OP Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by Andromeda_Station

Hrmm...I've not come across that one. If I had to guess, maybe one is trying to do something before the other is totally ready? The only thing I can think to try is experiment with a 1 or 2 second delay in different places, like a 'wait 1 sec' in between the bluetooth connecting and the hotspot turning on

That sounds like a good plan, I'm not sure how to add in a delay though? If I edit the task of turning on the hotspot I get the option of adding an if variable, but not sure how to put in a delay...

Sent from my Nexus 6P using Tapatalk
21st June 2017, 01:00 PM |#6  
Vagelis1608's Avatar
Senior Member
Flag Athens
Thanks Meter: 844
 
More
Quote:
Originally Posted by glenb83

That sounds like a good plan, I'm not sure how to add in a delay though? If I edit the task of turning on the hotspot I get the option of adding an if variable, but not sure how to put in a delay...

Action > Task > Wait
22nd June 2017, 05:25 AM |#7  
Senior Member
Thanks Meter: 34
 
More
What Vagelis said^
Once the 'wait' is in your task you can 'grab' it by the right edge of the screen and drag it up or down, wherever you need it.
25th December 2019, 12:34 PM |#8  
Mark ter Grote's Avatar
Senior Member
Flag Enschede
Thanks Meter: 130
 
More
i looks like tasker does something wierd in Android 10, this worked always in Android 8 or 9 but now it doesnt.
when i get connected with my radio tasker turns on Tether but never turns is off when i disconnect bluetooth from my car.


can someone help me out tho think about a sulotion?
25th December 2019, 02:44 PM |#9  
ktmom's Avatar
Forum Moderator
Thanks Meter: 2,688
 
More
Quote:
Originally Posted by Mark ter Grote

i looks like tasker does something wierd in Android 10, this worked always in Android 8 or 9 but now it doesnt.
when i get connected with my radio tasker turns on Tether but never turns is off when i disconnect bluetooth from my car.


can someone help me out tho think about a sulotion?

Is the exit task actually running? What does the run log show?

This could be a device issue on A10 as well. If tasker is getting killed, it can't run. Take a look at https://dontkillmyapp.com/ for what ever device you have.

It also helps to post the description of your profile when asking for help. There is a sticky post in this forum with instructions.
Post Reply Subscribe to Thread

Tags
auto off, hotspot, tether, wifi

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes