[Q] How to use Tasker to enable WIFI when entering Airplane Mode? - General Questions and Answers

I'm using Tasker to enable Airplane Mode on my OnePlus automatically when I lose cellular signal and recheck for signal again in five minutes time. (this is so that battery isn't constantly drained looking for signal). This is useful at my workplace where I have wifi but no cellular connection. I would like to enter airplane mode but would like to keep Wifi on so that I can still use my internet connection. Can someone please tell me how I can go about turning my wifi on when Airplane mode is activated? Or better yet, not tuning wifi off at all? (note, I'm using SEcure Settings to enable/disable airplane mode as 4.4.4 does not allow it to do that natively in Tasker.)
Thank you!
I just figured it out, but please tell me if you have any thoughts. I used Secure settings to Turn wifi on after Airplane Mode comes on. Tasker native 'wifi on' does not work but using the Secure Settings plugin worked fine) I would still prefer to keep wifi on when Airplane mode is entered so I do not lose wifi connection while the Wifi card is being restarted. Please let me know what you think.
I have been using this tutorial to achieve airplane mode when signal is weak: (taken from http://android.stackexchange.com/qu...-and-how-can-i-keep-it-from-eating-my-battery )
Task "InitVars":
Variable -> Variable Set: %SIGSTATE = 0
Task "SigLow":
Net -> Mobile Data: Off
Variable -> Variable Set: %SIGSTATE = 1
Alert -> Notify Vibrate: Title "IzzySignal"; Text: "Signal Low; Mobile data disabled (Signal: %CELLSIG)"
Task "SigLost":
Variable -> Variable Set: %WLANSTATE = 0
Variable -> Variable Set: %WLANSTATE = 1 IF %Wifi ~ on
Net -> Airplane Mode: On
Net -> Wifi: On IF %WLANSTATE ~ 1
Variable -> Variable Set: %SIGSTATE = 2
Alert -> Notify Vibrate: Title "IzzySignal", Text: "Signal Lost; Entering Airplane Mode"
Task "SigReturn":
Task -> Wait: 5 Minutes
Net -> Airplane Mode: Off
Task -> Wait: 15 Seconds
(give the device some time to find a new signal!)
Net -> Mobile Data: On IF %ROAM ~ Off
(prevent bad surprise when returning from vacation abroad!)
Variable -> Variable Set: %SIGSTATE = 0
Alert -> Notify Vibrate: Title "IzzySignal", Text "Signal On; Airplane Mode disabled (Signal: %CELLSIG)"
Now for the profiles:
Profil SigLowCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Less Than", Value "1"
State -> Phone -> Signal Strength: From 0 To 2
State -> Tasker -> Profile Active: "SigLost", [x] Invert
(make sure to avoid a conflict: %SIGSTATE~0 && SignalStrength~1 would match both profiles condition)
Task: SigLow
Profil SigLostCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Less Than", Value "2"
State -> Phone -> Signal Strength: From 0 To 1
Task: SigLost
Profile SigReturnCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Greater Than", Value "0"
Task: SigReturn
Profile Init:
Event -> Tasker -> Monitor Start
Task: InitVars

neopl666 said:
I'm using Tasker to enable Airplane Mode on my OnePlus automatically when I lose cellular signal and recheck for signal again in five minutes time. (this is so that battery isn't constantly drained looking for signal). This is useful at my workplace where I have wifi but no cellular connection. I would like to enter airplane mode but would like to keep Wifi on so that I can still use my internet connection. Can someone please tell me how I can go about turning my wifi on when Airplane mode is activated? Or better yet, not tuning wifi off at all? (note, I'm using SEcure Settings to enable/disable airplane mode as 4.4.4 does not allow it to do that natively in Tasker.)
Thank you!
I just figured it out, but please tell me if you have any thoughts. I used Secure settings to Turn wifi on after Airplane Mode comes on. Tasker native 'wifi on' does not work but using the Secure Settings plugin worked fine) I would still prefer to keep wifi on when Airplane mode is entered so I do not lose wifi connection while the Wifi card is being restarted. Please let me know what you think.
I have been using this tutorial to achieve airplane mode when signal is weak: (taken from http://android.stackexchange.com/qu...-and-how-can-i-keep-it-from-eating-my-battery )
Task "InitVars":
Variable -> Variable Set: %SIGSTATE = 0
Task "SigLow":
Net -> Mobile Data: Off
Variable -> Variable Set: %SIGSTATE = 1
Alert -> Notify Vibrate: Title "IzzySignal"; Text: "Signal Low; Mobile data disabled (Signal: %CELLSIG)"
Task "SigLost":
Variable -> Variable Set: %WLANSTATE = 0
Variable -> Variable Set: %WLANSTATE = 1 IF %Wifi ~ on
Net -> Airplane Mode: On
Net -> Wifi: On IF %WLANSTATE ~ 1
Variable -> Variable Set: %SIGSTATE = 2
Alert -> Notify Vibrate: Title "IzzySignal", Text: "Signal Lost; Entering Airplane Mode"
Task "SigReturn":
Task -> Wait: 5 Minutes
Net -> Airplane Mode: Off
Task -> Wait: 15 Seconds
(give the device some time to find a new signal!)
Net -> Mobile Data: On IF %ROAM ~ Off
(prevent bad surprise when returning from vacation abroad!)
Variable -> Variable Set: %SIGSTATE = 0
Alert -> Notify Vibrate: Title "IzzySignal", Text "Signal On; Airplane Mode disabled (Signal: %CELLSIG)"
Now for the profiles:
Profil SigLowCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Less Than", Value "1"
State -> Phone -> Signal Strength: From 0 To 2
State -> Tasker -> Profile Active: "SigLost", [x] Invert
(make sure to avoid a conflict: %SIGSTATE~0 && SignalStrength~1 would match both profiles condition)
Task: SigLow
Profil SigLostCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Less Than", Value "2"
State -> Phone -> Signal Strength: From 0 To 1
Task: SigLost
Profile SigReturnCheck:
State -> Variable -> Variable Value: Name "%SIGSTATE", Op "Math: Greater Than", Value "0"
Task: SigReturn
Profile Init:
Event -> Tasker -> Monitor Start
Task: InitVars
Click to expand...
Click to collapse
So when you enter airplane mode wifi disconnects and re connects again.
Sent from Galaxy Note 3 SM-N9005

thahim said:
So when you enter airplane mode wifi disconnects and re connects again.
Sent from Galaxy Note 3 SM-N9005
Click to expand...
Click to collapse
That's correct.
I am trying to find a way to stop it from disconnecting so that I do not lose my internet connection. I would also like to make it a bit more involved and disconnect Wifi ONLY IF there are no known networks in rage. Any ideas would be much appreciated!

Related

Disabling Direct Push on Dolphin 9900 Handset

I have a Dolphin 9900 handset which runs WM 6.1. Each day at 12:00PM and 12:00AM the device turns on automatically. There are no e-mail accounts setup on this device. I have tried to disable Direct Push, assuming that's the reason for its issue, but nothing has worked. I have tried the following:
[HKEY_CURRENT_USER\ControlPanel\Notifications\Remin ders\AutoSnooze]
"AutoSnoozeMins"=dword:0
HKCU\ControlPanel\Notifications\{A877D65A239C-47a7-9304-0D347F580408}
set value "Options" to 20000000 (hexadecimal) or 536870912 (decimal)
And the steps found here:
The Exchange Security Policy (4131) updates the device policy:
HKLM\Security\Policies\00001023: 0 = Enabled; 1 = Disabled
To change the inactivity timer:
HKLM\Comm\Security\Policy\LASSD\AE\{50C13377-C66D-400C-889E-C316FC4AB374}\
AEFrequencyType: 0 = No inactivity time; 1 = Activity time enable
AEFrequencyValue: = number of minutes before timeout
To change the password strength policy:
HKLM\Comm\Security\Policy\LASSD\LAP\lap_pw\
MinimumPasswordLength: minimum number of characters in password (0 defaults to 1)
PasswordComplexity: 0 = Require Alphanumeric; 1 = Require numeric (PIN); 2 = No restriction
And finally to change the Device wipe settings:
HKLM\Comm\Security\Policy\LASSD\
DeviceWipeThreshold: -1 = disabled; (any positive number) = # failed attempts before device memory gets whacked
CodewordFrequency: # of attempts before a codeword is displayed to prevent accidental device wipe.
None of these steps worked as the device still turns on at 12:00 each time. Does anyone have any suggestions?

[Q] Android Services Help

Hi,
I'm trying to write some scripts that will turn on/off various functions of my rooted phone running a Cyanogen 6 based ROM (especially those functions that can't be programmatically manipulated through standard apps on non-rooted phones).
One approach I figured (Approach 1), would be to simply write 1/0 in the sqlite settings database for various settings (/data/data/com.android.providers.settings/databases/settings.db). However, simply writing on/off there does not automatically turn on/off those functions. After a reboot this will work though.
Another approach (Approach 2) would be to call various services with various parameters. For example this:
wifi on: service call wifi 13 i32 1
wifi off: service call wifi 13 i32 0
Will turn on/off the Wifi.
My questions are:
Which of these 2 approaches would you recommend?
Do you recommend any other approaches?
For "Approach 1", do you know of another way (besides rebooting the phone) that would force the phone to take the new settings in the database into consideration?
For "Approach 2", where could I find some documentation so that I will know how to manipulate the other services? (I'm interested especially in: GPS, Mobile Networks Location, 2G/3G switch, Data connection, Background data connection, Ringer, Auto sync)
Thanks,
Andrei
adding few more commands
This is not the answer, but I've found few more commands which can be helpful.
#service call connectivity 14 i32 1 -> Mobile Data ON (NEED ROOT)
#service call connectivity 14 i32 0 -> Mobile Data OFF (NEED ROOT)
#service call connectivity 12 i32 1 -> Background service ON
#service call connectivity 12 i32 0 -> Background service OFF
maybe a late reply, almost 2 years sincs op.
i look up information about the service interface directly from the aidl files, these files are well documented.
so for the example you gave, look at IWifiManager.aidl, the methods are numbered in sequence (starting at 1). the 13 entry is for setWifiEnabled(Bool), notice that i32 is encoding an integer into a boolean value.
for more information, the underlying system of IPC in android is managed by Binder.

[Q] Tasker: Periodic Data Check with wifi + cell near and BG

Hello,
i have a problem with my WiFi and think is the periodic data check profile but not sure. what i want.
If i am @home so my wifi goes on and connected to my router and mobile data is of but auto-sync is on
if i leav my home i use mobile data but should be only on if i switch the screen on.
so if i let the screen of the tasker should be switch the mobile data and auto sync every 10 minutes on for 20 seconds or less.
i creat this profiles and task:
Profile1: Display Off
--> Event --> Display --> Display Off
Tasks: Data off
Wait = 5 sec.
Stop = if %SCREEN ~ on
Auto Sync = off
WiFi = off
----------------------------------------
Profile2: Display on
--> Event --> Display --> Display on
--> Time: From 07:00 Till 22:30
Tasks: Mobile Data
Auto-Sync = on
Mobile Data = on if WIFI ~ off
WiFi = on
----------------------------------------
Profile3: Periodic check
--> Time: From 06:30 every 10m Till 22:30
Tasks: Periodic
if %SCREEN ~ off
Mobile Data = on
Auto-Sync = on
Stop if %SCREEN ~ on
Wait = 20 sec.
Auto-Sync = off
Mobile Data = off
End if
----------------------------------------
Profile4: [email protected]
--> State --> Cell Near --> scan my network cell....
--> Event --> Display --> Display on
Tasks: WiFi on
WiFi = on
Auto-Sync = on
The problem is that all works but after few minutes or sometimes wifi is disconnected and only if tasker is on. i test it without tasker and is working 60 minutesand no problems so wifi works fine.
test it and deactivate the profile "periodic check" and is woring too so must be there......
i tried also to put this option "--> Event --> Display --> Display on " in the profile but then the periodic check ins´t working if the display is off.
hope anybody can help me?
sorry for my bad english
Jack
Handy: Samsung Galax S III 9300i
Tasker version: 1.2.1u1m

[Q] Help: Tasker profile to turn on/off mobile data

Situation: I want Tasker to turn on 3G/4G when certain apps are launched, and then restore the phone to the previous state before the app was launched. For example, if 3G/4G was already on, then it should leave it on. If it was off, then turn 3G/4G off.
My tasker profile:
CONDITION: On App launch (Chrome, Maps, etc)
EXECUTE:
Set Variable %WIMAXprior to 0 if %WIMAX is NOT SET ... (assigns value of 0 if 3G/4G is turned off)
Set Variable %WIMAXprior to 1 if %WIMAX is SET ... (assigns value of 1 if 3G/4G is turned on)
Mobile Data ON
EXIT ACTION:
Set Mobile Data OFF if %WIMAXprior = 0
Set Mobile Data ON if %WIMAXprior = 1
Unfortunately, I can't get it to work. After quite a bit of testing, I think the problem is that Tasker is unable to read the Wimax status. As a debug feature, I asked Tasker to say aloud the value of the variable %WIMAXprior and it reads "0", whether or not 3G/4G was enabled before the task was launched.
Does anyone have any ideas?

Automatic selection of Wifi or 3G using the app called Llama

Hi everybody,
I am using Llama for several things on my i9100g. The first one is to control sound profile at work and at home, this is straightforward. The second thing is to control when the Wifi or the 3G signal should be on. I would like to have some input in order to optimize the process, since I believe is kind of messy.
Basically there are three principles that I want to use.
a. When I am physically at home I want to use only my Wifi, I have no flat 3G plan plus I believe the Wifi consumes lets battery that the 3G connection.
b. When I am out, of course I want to turn off Wifi and turn on the 3G.
c. Always optimize my battery consumption. So far with low use, I have two full days without charging the battery again.
For these reasons, I have created the following events, variable and zones.
Zones
Home: This zone covers my house and roughly 4 blocks around, including restaurants and a friend place.
Llama Variables
Wifi: when ‘Wifi’ is Disabled the Wifi signal is off and vice versa.
Mobile data: when ‘Mobile data’ is Disabled the 3G is off and vice versa.
Force: It a kind of flag variable that I have created to “force” Llama to check for a Wifi signal after some period of time.
Events
• Wifi On - Home:
Between 06:30 and 22:59 at Home when 'Wifi' has a value of 'Disable' when 'Force has a value of 'Disable' - disable mobile data, set Llama variable 'Mobile Data' to 'Disable' and enable Wifi
Note on this event. I like to turn off all signals (3G and Wifi) after 11 pm at home, since I am probably sleeping.
• Force On: When ‘Force’ has a value of ‘Enable’ – delay for 30 min and then set Llama variable ‘Force’ to ‘Disable’
• No Wifi Available: When your phone disconnects from <Any Wifi network> - delay for 1 minute and then disable Wifi and set Llama variable ‘Wifi’ to ‘Disable’. And set Llama variable ‘Force’ to ‘Disable’
Note on this event. It will fire the event after one minute if all conditions are still valid. I use this extra setting to avoid turning off the Wifi, when the signal just goes away for few seconds.
• Force Mobile Data – On: At home between 06:30 and 22:59 when your phone disconnects from <Any Wifi network> when ‘Force has a value of ‘Disable’ – delay for 5 minutes and then enable mobile data, set Llama variable ‘Mobile Data’ to Enable’, disable Wifi and set Llama variable ‘Force’ to ‘Enable’ every 1 minute.
Note on this event. I will repeat this event as long as all the conditions hold. Please see note 1 at the end of the thread for an extra explanation why I need the repetition.
• Mobile Data Away – On: Upon leaving home enable mobile data, set Llama variable ‘Mobile Data’ to ‘Enable’ disable Wifi and set Llama variable ‘Wifi’ to ‘Disable’
• Evening: Between 23:00 and 6:29 at Home disable all signals.
A general explanation of the events.
I am sometimes in a restaurant in my Home zone, but not physically at home. Therefore, the “Wifi Home – On” will try to connect to the wireless network at home, but of course is not available. Therefore, the “No Wifi Available” will fire after one minute, disabling Wifi. At this stage my phone has neither Wifi nor 3G connected.
For roughly 5 minutes after the firing “No Wifi Available”, the “Force Mobile Data” event turn on the 3G if all conditions are met. At this moment, the ‘Force’ Llama variable will be ‘Enable’.
After 30 min, the ‘Force’ variable is ‘Disable’ again, this is my way to tell Llama, please check again if my home Wifi network is available, if not fire again “No Wifi Available” and later “Force Mobile Data” and one more time the cycle of 30 min is on.
The “Mobile Data away-on” is an evet that kind of overright all the other process. When I am not at Home, is pointless to check for my home Wifi conection,so I tell Llama to turn on the Mobile data regardless of time (maybe I am in a party).
I hope I have explained more of less the process.
Note 1. The repetition of 1 minute is because on my way home, I have to walk few blacks on my Home zone, and I want Llama to always check (every 1 minute) if I have arrived at home or not. If all the conditions in ”Force Mobile Data” are true, means I have not arrived yet in my house, if not, Llama will fire “Wifi On”.
Cheers

Categories

Resources