I'm not sure where to post this since it encompasses several Android devices, so I guess I will put it here. So I am putting the finishing touches to my car set up and I have one last thing to accomplish.
I have a Pioneer Appradio2 that is powered via a Galaxy Nexus (wifi only) it automatically connects to the Appradio2 via bluetooth for transferring the touch screen input. I also have a Nexus4 that has mobile data, what I am trying to accomplish is for wifi hotspot to be enabled on the N4 without having to remove it from my pocket. I have tried tasker and setting a profile for when connected to my Appradio2 via BT, but since it only connects as a hand free device (since the GNex is the primary device via BT) it wont automatically connect, just upon receiving a phone call.
I have also tried the autotether app, but since it relies on a BT connection between the GNex and N4 to trigger the hotspot it seems to interfere with the touchscreen controls on the Appradio2 causing it to lag and become unusable, exiting the app and all returns to normal.
Any ideas? What I would really love would be a state in tasker for when the a BT device is present but not specifically connected, but that doesn't seem to exist. Or some way or sending an action from the Gnex via BT to the N4 and then have the N4 set wifi hotspot to enabled.
So after much searching and trying autotether again, I have finally decided to approach this a different way. I bought one of those cheap USB powered BT to 3.5mm jack adapters, I'm hoping that if I wire it to the accessory circuit of the car it will be powered only when the car is on and I can then pair it only to the N4, and here is the only concern, but I am hoping that the adapter will initiate a BT by itself (since Android devices rely on a connection request from the other device for auto connection) then I can use tasker to turn on hotspot when connected to this adapter and turn off when not connected. It's not my preferred way to do it, but if it works without interaction I will be happy.
FYI for anyone still wanting to do this. I also wanted to automatically turn on the stock hotspot when I connect to my car's bluetooth stereo and for some reason, Tasker would not initiate any tasks based on my bluetooth connectivity. So I searched for a different solution and found this app.
AutoTether for Automatica
You don't need to own an Automatica if all you want to do is turn on and off wifi hotspot tethering based on a bluetooth connection. I wish Tasker worked for me since I use it for other tasks, but if you also can't get the bluetooth triggers to work for this purpose or you don't need Tasker for anything else, this works great and that's all it does. Very simple.
Disclaimer:
I literally just found it a few minutes ago and while it works great for turning hotspot on and off based on connectivity to your choice of bluetooth device(s), I have no idea about any side effects (battery, data, etc).
Any more on this?
Want my wife's Z3C to auto turn on hotspot when her phone connects to the bluetooth of the android head unit in her car.
The automatica app mentioned just force closes.
I ended up trading the AppRadio for a generic Andoird headunit so I was just able to use Tasker to turn it on and off when connecting to the headunit via BT.
My Tasker is turning on the hotspot when BT connects, then turns it off when BT disconnects. However, it doesn't turn wifi back on and I can't figure out a good way to automate it. Tasker doesn't have an Event of "hotspot disable" nor "BT disconnect", which is pretty lame if you ask me.
Hi,
This App does it! Compatible with Android >5.0 (tested with 6.0) and without root.
Check it: http://play.google.com/store/apps/details?id=de.thjunge11.autohotspotfree
manos78 said:
Hi,
This App does it! Compatible with Android >5.0 (tested with 6.0) and without root.
Check it: http://play.google.com/store/apps/details?id=de.thjunge11.autohotspotfree
Click to expand...
Click to collapse
Doesn't work with 7.0+, hot spot is never turned on despite the toast message saying otherwise.
snake2332 said:
My Tasker is turning on the hotspot when BT connects, then turns it off when BT disconnects. However, it doesn't turn wifi back on and I can't figure out a good way to automate it. Tasker doesn't have an Event of "hotspot disable" nor "BT disconnect", which is pretty lame if you ask me.
Click to expand...
Click to collapse
Just add it to the exit task for the tasker profile BT connected, that is effectively BT disconnect.
jakejm79 said:
Doesn't work with 7.0+, hot spot is never turned on despite the toast message saying otherwise.
Click to expand...
Click to collapse
Version v2 adds support for Nougat... it uses the new API introduced in 6.0.
This tool is the only one that just works! :good:
I'll check it out, thank you.
Does not work with Samsung S7 with Nougat. Seems to be a permissions issue...
I have the Samsung Galaxy S8 and it doesn't work either! I had the LG G6 and it used to work fine
"Hot Spot Starter" worked fine with my Nexus 5x on 7.1.2, but just upgraded to Oneplus 3 (7.1.1) and doesn't work anymore.
Anything else out there that I could try?
snake2332 said:
My Tasker is turning on the hotspot when BT connects, then turns it off when BT disconnects. However, it doesn't turn wifi back on and I can't figure out a good way to automate it. Tasker doesn't have an Event of "hotspot disable" nor "BT disconnect", which is pretty lame if you ask me.
Click to expand...
Click to collapse
jakejm79 said:
Just add it to the exit task for the tasker profile BT connected, that is effectively BT disconnect.
Click to expand...
Click to collapse
I'm pretty new to Tasker, but did my best to follow the logic above. For those of you who know this pretty well, does the following look about right?
Two profiles: One that creates a BT Context variable when BT connect state exists and clears it when it stops. The second which turns on Hotspot if BT connect state exists, and turns Hotspot off (and Wifi back on) when BT is no longer connected (state no longer exists and BT Context variable is no longer set):
Code:
Profile: BT Context (8)
State: BT Connected [ Name:* Address:* ]
Enter: Set Bt Var (9)
A1: Variable Set [ Name:%BTConnected To:1 Recurse Variables:eek:ff Do Maths:eek:ff Append:eek:ff ]
Exit: Clr Var (10)
A1: Variable Clear [ Name:%BTConnected Pattern Matching:eek:ff ]
Profile: Turn Hotspot On Off (2)
State: BT Connected [ Name:Rons-Xtrons Address:* ]
Enter: Hotspot On (3)
A1: WiFi Tether [ Set:eek:n ]
Exit: Hotspot Off (7)
A1: WiFi Tether [ Set:eek:ff ] If [ %BTConnected !Set ]
A2: WiFi [ Set:eek:n ] If [ %BTConnected !Set ]
There is now a plugin for tasker called Nought Tasker Tethering Plugin, it works for me on my Nexus 5X on 7.1.2 when nothing else has (I am rooted and did have to install it has a system app).
I think you are over thinking things.
Just create a new profile with a state of BT connected (you can then pick the specific BT device if its a previously paired device).
Create a task using the above plugin that simply just enables the hotspot, make this the starting task for the above profile.
Create a task using the above plugin that simply shuts off the hotspot, make this the exit task for the above profile.
Doesnt seem to work
manos78 said:
Hi,
This App does it! Compatible with Android >5.0 (tested with 6.0) and without root.
Check it:]
Click to expand...
Click to collapse
As of 6/17/2017 this doesnt work for me. Guess ill have to root my phone.:silly:
---------- Post added at 06:31 PM ---------- Previous post was at 06:18 PM ----------
2wyce said:
FYI for anyone still wanting to do this. I also wanted to automatically turn on the stock hotspot when I connect to my car's bluetooth stereo and for some reason, Tasker would not initiate any tasks based on my bluetooth connectivity. So I searched for a different solution and found this app.
You don't need to own an Automatica if all you want to do is turn on and off wifi hotspot tethering based on a bluetooth connection. I wish Tasker worked for me since I use it for other tasks, but if you also can't get the bluetooth triggers to work for this purpose or you don't need Tasker for anything else, this works great and that's all it does. Very simple.
Disclaimer:
I literally just found it a few minutes ago and while it works great for turning hotspot on and off based on connectivity to your choice of bluetooth device(s), I have no idea about any side effects (battery, data, etc).
Click to expand...
Click to collapse
I dont mind payonf a few bucks but it looks like they want to charge 99.00. No way JOSE
jakejm79 said:
Doesn't work with 7.0+, hot spot is never turned on despite the toast message saying otherwise.
Just add it to the exit task for the tasker profile BT connected, that is effectively BT disconnect.
Click to expand...
Click to collapse
jakejm79 said:
There is now a plugin for tasker called Nought Tasker Tethering Plugin, it works for me on my Nexus 5X on 7.1.2 when nothing else has (I am rooted and did have to install it has a system app).
I think you are over thinking things.
Just create a new profile with a state of BT connected (you can then pick the specific BT device if its a previously paired device).
Create a task using the above plugin that simply just enables the hotspot, make this the starting task for the above profile.
Create a task using the above plugin that simply shuts off the hotspot, make this the exit task for the above profile.
Click to expand...
Click to collapse
You said it yourself. The problem isn't the logic. The problem is that as of now, there is no way to trigger the hotspot (wifi tether) via an app/plugin unless you are rooted. Period. The only alternative so far is to use a combination of tasker and autoinput to simulate the process of navigating to the hotspot settings screen and pressing the correct button.
manos78 said:
Version v2 adds support for Nougat... it uses the new API introduced in 6.0.
This tool is the only one that just works! :good:
Click to expand...
Click to collapse
Still not working for me on a Google Pixel XL with Android 7.1.2
adlezama1909 said:
Still not working for me on a Google Pixel XL with Android 7.1.2
Click to expand...
Click to collapse
Then contact with the developer. For me (using 6.0) it's the only tool that works.
How to Turn Hotspot on/off Using Tasker/Autoinput/TouchTask on un-rooted Phone
I have un-rooted Galaxy S8 (Nougat). I finally was able to come up with a Tasker script (also using AutoInput and TouchTask) which does the following:
When I get in the car and turn on the engine:
1. S8 bluetooth connects to px5 head unit. I give phone a few seconds to internally SmartLock unlock. Then I issue AutoInput unlock to basically turn screen on.
2. Phone turns off wifi.
3. Phone launches Hotspot & Tethering screen, and if it is off, turns it on.
4. Head unit connects to Internet using phone wifi.
When I turn engine off:
1. Upon S8 BT disconnect, it issues AutoInput unlock (in case screen is off).
2. Phone launches Hotspot & Tethering screen and if it is on, turns it off.
2. Phone turns on WiFi.
Important Notes: Because the phone is not rooted, I could not use Tasker "wifi tether on/off" action. The bulk of this profile is manually launching the screens and pressing the buttons needed to unlock phone and turn on wifi. Oh, and this is VERY important: The only reason the screen unlocks is because the phone itself is unlocked when I get in the car. I use Android's "SmartLock" technology to automatically unlock the phone when it senses it is in my garage (by location) or BT connects to my head unit (by device).
Code:
Profile: Turn Hotspot On Off 03 (21)
State: BT Connected [ Name:Rons Xtrons Address:* ]
Enter: Hotspot On 05 (26)
A1: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A2: Variable Set [ Name:%Hotspot To:0 Recurse Variables: Off Do Maths: Off Append: Off ]
A3: Screen unlock [ Configuration:Screen unlock Timeout (Seconds):5 Continue Task After Error: On ]
A4: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A5: Flash [ Text:Launch hotspot app Long: Off ]
A6: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps: Off Always Start New Copy: On ]
A7: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A8: Flash [ Text:Launch autoinput ui query Long: Off ]
A9: AutoInput UI Query [ Configuration:App Package: com.android.settings
Variables: off()
Only Visible: true Timeout (Seconds):45 Continue Task After Error: On ]
A10: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A11: Flash [ Text:aitext() = off Long: Off ] If [ %aitext() ~ *Off* ]
A12: Flash [ Text:aitext() = on Long: Off ] If [ %aitext() ~ *On* ]
A13: Flash [ Text:Turning WiFi Off Long: Off ] If [ %aitext() ~ *Off* ]
A14: WiFi [ Set: Off ] If [ %aitext() ~ *Off* ]
A15: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A16: Flash [ Text:Tap hotspot on Long: Off ] If [ %aitext() ~ *Off* ]
A17: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):45 Continue Task After Error: On ] If [ %aitext() ~ *Off* ]
A18: Flash [ Text:Hotspot should be on Long: Off ] If [ %aitext() ~ *Off* ]
A19: Variable Set [ Name:%Hotspot To:1 Recurse Variables: Off Do Maths: Off Append: Off ] If [ %aitext() ~ *Off* ]
A20: Popup [ Title: Text:aitext does not contain Off or On. Copied to clipboard. Error: %err
%errmsg Background Image: Layout:Popup Timeout (Seconds):5 Show Over Keyguard: On ] If [ %aitext() !~ *On* & %aitext() !~ *Off* ]
A21: Set Clipboard [ Text:%aitext()
errors %err
%errmsg Add: Off ] If [ %aitext() !~ *Off* & %aitext() !~ *On* ]
Exit: Hotspot Off 03 (14)
A1: Screen unlock [ Configuration:Screen unlock Timeout (Seconds):5 Continue Task After Error: On ]
A2: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A3: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps: Off Always Start New Copy: On ]
A4: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A5: AutoInput UI Query [ Configuration:App Package: com.android.settings
Variables: on()
Only Visible: true Timeout (Seconds):20 Continue Task After Error: On ]
A6: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A7: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):30 ] If [ %aitext() ~ *On* ]
A8: Variable Set [ Name:%Hotspot To:0 Recurse Variables: Off Do Maths: Off Append: Off ] If [ %aitext() ~ *On* ]
A9: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A10: WiFi [ Set: On ] If [ %Hotspot eq 0 ]
Related
I am having mobile instrument with built in GPS [ XDA Orbit ]. i would like to switch it to silent mode when i am in the office and switch back to normal mode when out of office. is there any existing s/w which switches profile based on GPS location?
thanks.
Don't know about GPS but there are a few which switch based on cell location which may be of use.
Here
dosent work on xda orbit
thanks for nice suggestion, but unfortunately it dosent support xda orbit [ HTC 3300 ] devices. is there any other program [ preferably freeware ] to switch profile based on location [ even if its based on tower details ].
I'd like to suspend/wake a server when I disconnect/connect with my home wifi network.
I can suspend it via ssh'ing and running pm-suspend (it runs Ubuntu) and I can wake it by sending a Wake On Lan packet.
Scripting a cron job would be adequate if doing it on the wifi events isn't practical as I'm usually at home at the same times.
(Using a HTC Desire with a recent Oxygen ROM).
Thanks in advance for any suggestions.
Wake on Lan when you connect is pretty straight forward.
Make app with service running, if connected to wifi with certain SSID, send wake on lan.
Suspending the server will have to be done on the server, as the android won't know when it disconnects and normally can't use the network at the point it knows.
You could make a cronjob on the server with a script that counts the time your android is disconnected (not straight away if you are having connection problems) and suspend it after X minutes if you device doesn't reconnect.
Hi all,
I just begin using Tasker. My first profile is to, after bootup, wait 4 minutes then run app A, this one works fine. But I have trouble with my second profile:
it will run app B when wifi connected(no specific SSID or MAC,etc.), and as an Exit task, kill that app with taskkill plugin, if wifi disconnected. The problem is: if I MANUALLY switch ON and OFF wifi, it works fine, but it does not run that app after bootup (I installed SmartWifiToggler app which will automatically turn on wifi and connect.).
Any idea?
Hey Guys -
I've played with Tasker for a couple of months now and it's the #1 reason I like Android! I'm trying to set up a specific task and have many options as to how to go about it. I've tried a few things myself as you'll see below, but it doesn't always work well. Therefore, I wanted to post to see what the community suggested...
Goal
When at home or work, WiFi is On and Bluetooth is off
When not at home or work, HotSpot is On (Therefore also turning off WiFi) and Bluetooth is on
My Questions
1. Do you suggest I use Tasker's Location, AutoLocation's GeoFence, AutoLocation's Location, , AutoLocation's "Fuse", Near WiFi, a combination of these, or something else?
2. What's the best suggestion you have as to set this up to run as smoothly as possible? I'm concerned about battery, but would give it up if it meant it worked better.
Methods
I've come across a few different ways to do this. Below is what I've considered / tried so far:
- Location Based (Native Tasker)
- Location Based (AutoRemote)
This has GeoFencing and Location profiles. According to the app's FAQ, Geofencing is low power and uses cell + WiFi signals and Location uses GPS. It also says the can work together using "Fuse Location" but I cannot find that option
- WiFi Near (Native Tasker)
Note: I do keep the Location setting for Tasker set to "High Accuracy" in Android's settings
My Current Setup
Currently, I use Tasker's native Location but have found it doesn't work that well. Below's how I have it set up:
- Task: "Enable HotSpot"
- Enables Hotspot / Wait 3 Sec / Disable Bluetooth
- Task: "Disable Hotspot"
- Enables WiFi (Disabling Hotspot) / Enable Bluetooth
- Profile: Home - (Location)
- Task: "Disable Hotspot"
- Exit Task: "Enable HotSpot"
- Profile Work (Location)
- Task: "Disable Hotspot"
- Exit Task: "Enable HotSpot"
My Ideal Setup
I'd like to have it use one of the Locations OR well as WiFi near to trigger. Since you can't directly set an "OR" command in tasker, I am trying a workaround which does the following:
- Task: "Dummy"
- Wait 1ms
- Profile Home (Location)
- State: Location
- Task: Dummy
- Profile Work (Location)
- State: Location
- Task: Dummy
- Profile Near WiFi
- State: Near WiFI HOMESSID/WORKSSID
- Task: Dummy
- Task: "Disable HotSpot"
- Enables WiFi (Disabling Hotspot) / Enable Bluetooth
- Task: "Enable Hotspot"
- Wait 10 Seconds
- If %PACTIVE doesn't match *,Home (Location),*|*,Work (Location,*
- Enables HotSpot (Disables WiFi) / Disable Bluetooth
- End if
- Profile: Auto Hotspot
- State: Variable -> Variable Value: %PACTIVE Matches *,Home (Location),*|*,Work (Location,*
- Task: "Disable Hotspot"
- Exit Task: "Enable Hotspot"
All of the above basically because Tasker doesn't have an "OR" command.
So... what do you think? Have any suggestions? Thanks!
The removed "Keep WiFi on during sleep" setting adb workaround below worked for me properly before doing a reset. I just enabled it on my Android 10 and 11 devices and its working in reverse where wifi stays on during sleep except when charging it turns off?? Any advice appreciated
To set it:
adb shell settings put global wifi_sleep_policy 1
To find out what it is now:
adb shell settings list global
Keep WiFi on during sleep: Always = 2
Keep WiFi on during sleep: Only When Plugged In = 1
Keep WiFi on during sleep: Never = 0