Tasker auto-sync problem - Tasker Tips & Tricks

Dear Tasker users,
I'm going crazy!
I recently created a function to turn on wifi and turn off mobile data when there is a near wifi network and viceversa.
If I launch the app manually it works fine but if I wait it to work it doesn't.
I controlled the timings in the preferences but the Service Check Milliseconds is 1500 (when display is on), Wifi Scan Seconds are 120, All checks (when display is off) are 240 seconds.
It seems that the service does not work in background both when phone is locked and when is unlocked.
It works only sometimes (i can't understand exactly when)
The function is:
Profile: Known WiFi (3)
Stato: Near WIFI [ SSID:* MAC:* Functionality:* Minimum activation signal:4 Channel:0 Alternate Wififf ]
Start: WiFi And Data (2)
A1: Delete Notification [ Title: Warn does not existff ]
A2: If [ %WIFI ~ off ]
A3: Run Shell [ Command:svc wifi enable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A4: Wait till [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ] If [ %WIFI ~ on ]
A5: End If
A6: If [ %WIFII ~ *CONNECTION* ]
A7: LED Notification [ Title:WiFi Connected Text:%WIFII Icon:hd_device_access_network_wifi Number:1 Color:Green Evaluate:17 Priority:3 Actions1) ]
A8: Notification [ Titolo:%WIFII Testo: Icona:hd_device_access_network_wifi Numero:0 Permanenteff Priorità:3 ]
A9: Run Shell [ Comando:svc data disable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Results In: ]
A10: Else
A11: Run Shell [ Command:svc data enable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A12: LED Notification [ Title:Mobile ON Text:%CELLID Icon:hd_content_import_export Number:1 Color:Red Evaluate:1 Priority:3 ]
A13: Run Shell [ Command:svc wifi disable Timeout (Seconds):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A14: End If
My android version is 6.0.1.
The scanning time (when is locked) is 120sec and the service check is 1500 msecs.
Could you please help me?

Have you Tasker taked out off doze? Maybe that's the reason.
Sent from my Nexus 5 using Tapatalk

Sorry, I don't understand? What you mean? Do you suggest that Tasker is in standby? How do you suggest to resolve?
Thanks
R4V3N-2010 said:
Have you Tasker taked out off doze? Maybe that's the reason.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse

Go to settings->special settings->battery manager->protected applications->check tasker
Sent from my ALE-L21 using XDA-Developers mobile app
---------- Post added at 12:05 PM ---------- Previous post was at 12:03 PM ----------
renero76 said:
Dear Tasker users,
I'm going crazy!
I recently created a function to turn on wifi and turn off mobile data when there is a near wifi network and viceversa.
If I launch the app manually it works fine but if I wait it to work it doesn't.
I controlled the timings in the preferences but the Service Check Milliseconds is 1500 (when display is on), Wifi Scan Seconds are 120, All checks (when display is off) are 240 seconds.
It seems that the service does not work in background both when phone is locked and when is unlocked.
It works only sometimes (i can't understand exactly when)
The function is:
Profile: Known WiFi (3)
Stato: Near WIFI [ SSID:* MAC:* Functionality:* Minimum activation signal:4 Channel:0 Alternate Wififf ]
Start: WiFi And Data (2)
A1: Delete Notification [ Title: Warn does not existff ]
A2: If [ %WIFI ~ off ]
A3: Run Shell [ Command:svc wifi enable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A4: Wait till [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ] If [ %WIFI ~ on ]
A5: End If
A6: If [ %WIFII ~ *CONNECTION* ]
A7: LED Notification [ Title:WiFi Connected Text:%WIFII Icon:hd_device_access_network_wifi Number:1 Color:Green Evaluate:17 Priority:3 Actions1) ]
A8: Notification [ Titolo:%WIFII Testo: Icona:hd_device_access_network_wifi Numero:0 Permanenteff Priorità:3 ]
A9: Run Shell [ Comando:svc data disable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Results In: ]
A10: Else
A11: Run Shell [ Command:svc data enable Timeout (Secondi):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A12: LED Notification [ Title:Mobile ON Text:%CELLID Icon:hd_content_import_export Number:1 Color:Red Evaluate:1 Priority:3 ]
A13: Run Shell [ Command:svc wifi disable Timeout (Seconds):0 Use Rootn Save Result In: Save Errors In: Save Result In: ]
A14: End If
My android version is 6.0.1.
The scanning time (when is locked) is 120sec and the service check is 1500 msecs.
Could you please help me?
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Touch the second option, protected apps, I think, and check Tasker
Sent from my ALE-L21 using XDA-Developers mobile app

renero76 said:
Sorry, I don't understand? What you mean? Do you suggest that Tasker is in standby? How do you suggest to resolve?
Thanks
Click to expand...
Click to collapse
Go to your settings >battery tap the tree doots in the upper right corner then battery optimization. Tap not optimized and all apps. Check Tasker and it should work.
Sent from my Nexus 5 using Tapatalk

But, do you mean Settings of Tasker or in my android? If you intend the last one I can't find what you say. I only found Battery--> Details than I deselected Tasker
R4V3N-2010 said:
Go to your settings >battery tap the tree doots in the upper right corner then battery optimization. Tap not optimized and all apps. Check Tasker and it should work.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse

I mean in Android. Yeah maybe depends on your phone on my N5 it calls like I wrote. Check Tasker go back if Tasker is in the list not optimized apps then in should work.
Sent from my Nexus 5 using Tapatalk

I restarted my phone and it immediately worked but, changing the floor (where another Network is present), it did not work again.
It seems that it works only once, then stops
R4V3N-2010 said:
I mean in Android. Yeah maybe depends on your phone on my N5 it calls like I wrote. Check Tasker go back if Tasker is in the list not optimized apps then in should work.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse

renero76 said:
I restarted my phone and it immediately worked but, changing the floor (where another Network is present), it did not work again.
It seems that it works only once, then stops
Click to expand...
Click to collapse
Glad that you figured out. I am sorry but with your second problem I am not able too help you because my Tasker knowledge is not so high. Maybe someone with more knowledge is able too help you.
Sent from my Nexus 5 using Tapatalk

Dear all,
I noticed that the profile works only when activated after being deactivated previously.
It does not work when the phone is locked.
Any suggestions?

Related

Wifi tether used to work, now it doesn't work

With either built in, or secure settings. Here's the error I get with net state. I changed roms and now it no longer works.
19.00.56/E current state: 1
19.00.56/E WiFi Tether: cur: false new: true
19.00.56/M lastWifiDisableAgoMS: 1464735656284
19.00.56/E check AP state
19.00.56/E AP state: 1
19.00.56/M lastWifiDisableAgoMS: 1464735656284
19.00.56/E current state: 1
19.00.56/E curval: 1
19.00.56/E WiFi: cur: false new: false
19.00.56/E wait for 200ms
19.00.56/E wait finished
19.00.56/E WiFi Tether: setWifiEnabled()
19.00.56/Mirror setWifiApEnabled: InvocationTarget: java.lang.reflect.InvocationTargetException, java.lang.SecurityException: ConnectivityService: Neither user 10083 nor current process has android.permission.CONNECTIVITY_INTERNAL.
19.00.56/E WiFi Tether: enable failed
19.00.56/E Action WiFi Tether failed.
Sent from my Nexus 6P using Tapatalk
No one?
?
Sent from my Nexus 6P using Tapatalk
I know this is old but I have the same problem... Looking for help on this as well.
Still not working for me, I just gave up on it.
Me2 Can anyone offer a work around or alternative? It turns off Wifi but does not turn on the Mobile Hotspot on my Note 7
This has been broken for a while, at least if you don't have root. If rooted, you should not get this error. I would guess that since Android 5.0 or 5.1, this has been broken without root, at least on multiple Samsung devices that I've had (Note 5, S6, and S7 Edge, all Verizon-variants).
Any fix would be great. It was actually the one good reason to have root on my S7 Edge, but root slowed down my device so much that I couldn't deal with it and unrooted. Now, my Nexus 7 in my car-dash won't have any hotspot to tether to automatically. First world problems, right?
I kind of thought someone would figure out a way to emulate the action of turning on the stock wifi tether since the Tasker task requires root to work (at least on Verizon Samsungs). All it would have to do is emulate touching the quick-setting icon for "Mobile hotspot". I guess it's not that simple, eh?
WiFi Tether Failed
I just got the New Samsung Galaxy S8 and I have a profile that when it connects to my car BT it turns on the WiFi Tether. It was working with my LG G6 which was running 7.0 as well. I have searched Google for a Solution with no results. Please see the error message on the attached photo. I have tried secure settings, no luck. 
llaugerm said:
I just got the New Samsung Galaxy S8 and I have a profile that when it connects to my car BT it turns on the WiFi Tether. It was working with my LG G6 which was running 7.0 as well. I have searched Google for a Solution with no results. Please see the error message on the attached photo. I have tried secure settings, no luck. 
Click to expand...
Click to collapse
It fails with a security exception due to the lack of a permission. OP has the same issue, but with a different permission.
You need to execute as root, or, somehow, grant Tasker the permission mentioned in the error.
Vagelis1608 said:
It fails with a security exception due to the lack of a permission. OP has the same issue, but with a different permission.
You need to execute as root, or, somehow, grant Tasker the permission mentioned in the error.
Click to expand...
Click to collapse
There's no root on the Galaxy S8 in the US yet. What I have done is to use auto input.
---------- Post added at 10:23 AM ---------- Previous post was at 10:22 AM ----------
Krunk_Kracker said:
Still not working for me, I just gave up on it.
Click to expand...
Click to collapse
I used autoinput and I got it to work really well.
llaugerm said:
There's no root on the Galaxy S8 in the US yet. What I have done is to use auto input.
---------- Post added at 10:23 AM ---------- Previous post was at 10:22 AM ----------
I used autoinput and I got it to work really well.
Click to expand...
Click to collapse
adb shell pm command might be able to grant Tasker the permission mentioned in your error, without root.
Look into it.
Vagelis1608 said:
adb shell pm command might be able to grant Tasker the permission mentioned in your error, without root.
Look into it.
Click to expand...
Click to collapse
Can you please instruct me on the command and the permission? I would love to try it.
llaugerm said:
Can you please instruct me on the command and the permission? I would love to try it.
Click to expand...
Click to collapse
Enable adb on the phone, get the adb binaries and drivers for your phone on your PC, connect your phone to your PC, on your PC, in cmd:
adb devices
Make sure your phone is there
adb shell "pm grant net.dinglisch.android.taskerm android.permission.TETHER_PRIVILEGED"
That should do it.
Vagelis1608 said:
Enable adb on the phone, get the adb binaries and drivers for your phone on your PC, connect your phone to your PC, on your PC, in cmd:
adb devices
Make sure your phone is there
adb shell "pm grant net.dinglisch.android.taskerm android.permission.TETHER_PRIVILEGED"
That should do it.
Click to expand...
Click to collapse
Thank you for your feedback and your willingness to help, but I getting this message now:
C:\platform-tools>adb -d shell pm grant net.dinglisch.android.taskerm android.pe
rmission.TETHER_PRIVILEGED
Operation not allowed: java.lang.SecurityException: Package net.dinglisch.androi
d.taskerm has not requested permission android.permission.TETHER_PRIVILEGED
C:\platform-tools>
llaugerm said:
Thank you for your feedback and your willingness to help, but I getting this message now:
C:\platform-tools>adb -d shell pm grant net.dinglisch.android.taskerm android.pe
rmission.TETHER_PRIVILEGED
Operation not allowed: java.lang.SecurityException: Package net.dinglisch.androi
d.taskerm has not requested permission android.permission.TETHER_PRIVILEGED
C:\platform-tools>
Click to expand...
Click to collapse
The permission is missing from Tasker's manifest.
You can add it by editing the apk.
Or, talk to the developer about it.
llaugerm said:
There's no root on the Galaxy S8 in the US yet. What I have done is to use auto input.
---------- Post added at 10:23 AM ---------- Previous post was at 10:22 AM ----------
I used autoinput and I got it to work really well.
Click to expand...
Click to collapse
How did you get it to work with autoinput? I've tried with click and long click and text and point and get nothing.
SomebodySysop said:
How did you get it to work with autoinput? I've tried with click and long click and text and point and get nothing.
Click to expand...
Click to collapse
PM your email and I'll send you the project.
llaugerm said:
There's no root on the Galaxy S8 in the US yet. What I have done is to use auto input.
---------- Post added at 10:23 AM ---------- Previous post was at 10:22 AM ----------
I used autoinput and I got it to work really well.
Click to expand...
Click to collapse
llaugerm said:
PM your email and I'll send you the project.
Click to expand...
Click to collapse
OK, finally figured out what I was missing. I just figured autoinput and touchtask weren't working on my phone because none of the taps on the Hotspot and Tethering screen worked -- until I added waits. Then, magically, they all work.
Here is description of my profile to turn hotspot on/off based on bluetooth connectivity:
Code:
Profile: Turn Hotspot On Off (13)
State: BT Connected [ Name:Rons-Xtrons Address:* ]
Enter: Hotspot On (11)
A1: Variable Set [ Name:%Hotspot To:0 Recurse Variables:off Do Maths:off Append:off ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps:off Always Start New Copy:off ]
A4: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A5: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):30 ]
A6: Variable Set [ Name:%Hotspot To:1 Recurse Variables:off Do Maths:off Append:off ]
Exit: Hotspot Off (12)
A1: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps:off Always Start New Copy:off ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):30 ]
A4: Variable Set [ Name:%Hotspot To:0 Recurse Variables:off Do Maths:off Append:off ]
A5: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A6: WiFi [ Set:on ]
FYI, on my phone, wifi on/off works, but not wifi tether on/off.
SomebodySysop said:
OK, finally figured out what I was missing. I just figured autoinput and touchtask weren't working on my phone because none of the taps on the Hotspot and Tethering screen worked -- until I added waits. Then, magically, they all work.
Here is description of my profile to turn hotspot on/off based on bluetooth connectivity:
Code:
Profile: Turn Hotspot On Off (13)
State: BT Connected [ Name:Rons-Xtrons Address:* ]
Enter: Hotspot On (11)
A1: Variable Set [ Name:%Hotspot To:0 Recurse Variables:off Do Maths:off Append:off ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps:eek:ff Always Start New Copy:off ]
A4: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A5: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):30 ]
A6: Variable Set [ Name:%Hotspot To:1 Recurse Variables:off Do Maths:off Append:off ]
Exit: Hotspot Off (12)
A1: Launch App [ App:Settings:Hotspot and Tethering Data: Exclude From Recent Apps:off Always Start New Copy:off ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Actions [ Configuration:Action: Tap Method: Point (x,y) Selection: 958 315 Timeout (Seconds):30 ]
A4: Variable Set [ Name:%Hotspot To:0 Recurse Variables:off Do Maths:off Append:off ]
A5: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A6: WiFi [ Set:on ]
FYI, on my phone, wifi on/off works, but not wifi tether on/off.
Click to expand...
Click to collapse
Excellent. I'm glad it worked for you.

Created a Tasker profile for continuous notification upon receiving SMS, how to Exit?

I have created below tasker profile to generate continuous notification with Flash on & off upon receiving a text message with word "Emergency" in it. It works perfectly however I cannot find a way to stop the sound, vibration and Flash light loop.
I tried to create a scene with TAP action = cancel alarm (disable any) but it just opens system's alarm app.
Please suggest a way to stop this loop. I created this profile so I do not miss any Important SMS page from work while sleeping.
P. S. = I used alarm as notification type because it will play even while my phone is set to silent profile (Device - oneplus 3T). If alert slider is set to silent only alarms are working.
Code:
Profile: SMS_Notif_911 (15)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (12)
A1: Vibrate Mode [ Mode:eek:ff ]
A2: Ringer Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A3: Alarm Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A4: Notification Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A5: Media Volume [ Level:30 Display:eek:ff Sound:eek:ff ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:eek:n Show Over Keyguard:eek:n Continue Task Immediately:eek:n ]
A7: Play Ringtone [ Type:Alarm Sound:Rhythm Stream:4 ]
A8: Vibrate [ Time:200 ]
A9: Torch [ Set:eek:n ]
A10: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A11: Torch [ Set:eek:ff ]
A12: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A13: Goto [ Type:Action Number Number:7 Label: ]
The ringtone action can't be stopped, it runs autonomously (unless the "silence ringer" action works on your device).
So, I would use a Music Play action with the output stream set to alarm. Then in the scene, you can have a Music Stop action attached to a button in the scene. If you don't have a stop button in the scene, you need to add one.
There is also a variable "%PerotStop" that I added. It is set to "true" when the stop button is tapped and the GoTo action executes only if it's not true.
Notice that the GoTo doesn't go back to the Music Play action, but only back to cycle the vibrate and torch. It's not necessary to do more, just check the box to loop the music in the Music Play action.
Finally, after the GoTo stops executing, we clear the "%PerotStop" variable and it's ready for the next time.
Note: the [X] at action 7 shows that it's paused and won't run.
Code:
Profile: SMS_Notif_911 (179)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (180)
A1: Vibrate Mode [ Mode: Off ]
A2: Ringer Volume [ Level:6 Display: Off Sound: Off ]
A3: Alarm Volume [ Level:7 Display: Off Sound: Off ]
A4: Notification Volume [ Level:7 Display: Off Sound: Off ]
A5: Media Volume [ Level:30 Display: Off Sound: Off ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button: On Show Over Keyguard: On Continue Task Immediately: On ]
A7: [X] Play Ringtone [ Type:Alarm Sound:Cuckoo clock Stream:4 ]
A8: Music Play [ File:Ringtones/fur_elise_dubstep.mp3 Start:0 Loop: On Stream:4 Continue Task Immediately: On ]
A9: Vibrate [ Time:200 ]
A10: Torch [ Set: On ]
A11: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A12: Torch [ Set: Off ]
A13: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Goto [ Type:Action Number Number:9 Label: ] If [ %PerotStop !~ true ]
A15: Variable Clear [ Name:%PerotStop Pattern Matching: Off Local Variables Only: Off ]
These are the actions that the stop button that is displayed in the scene should have. They are added on the "tap" tab within the element edit. Notice the final action of the stop button is to clear the scene.
Code:
A1: Variable Set [ Name:%PerotStop To:true Recurse Variables: Off Do Maths: Off Append: Off ]
A2: Music Stop [ Clear Dir: Off ]
A3: Destroy Scene [ Name:PerotNotifStop ]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thank you so much. It worked.
ktmom said:
The ringtone action can't be stopped, it runs autonomously (unless the "silence ringer" action works on your device).
So, I would use a Music Play action with the output stream set to alarm. Then in the scene, you can have a Music Stop action attached to a button in the scene. If you don't have a stop button in the scene, you need to add one.
There is also a variable "%PerotStop" that I added. It is set to "true" when the stop button is tapped and the GoTo action executes only if it's not true.
Notice that the GoTo doesn't go back to the Music Play action, but only back to cycle the vibrate and torch. It's not necessary to do more, just check the box to loop the music in the Music Play action.
Finally, after the GoTo stops executing, we clear the "%PerotStop" variable and it's ready for the next time.
Note: the [X] at action 7 shows that it's paused and won't run.
Code:
Profile: SMS_Notif_911 (179)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (180)
A1: Vibrate Mode [ Mode: Off ]
A2: Ringer Volume [ Level:6 Display: Off Sound: Off ]
A3: Alarm Volume [ Level:7 Display: Off Sound: Off ]
A4: Notification Volume [ Level:7 Display: Off Sound: Off ]
A5: Media Volume [ Level:30 Display: Off Sound: Off ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button: On Show Over Keyguard: On Continue Task Immediately: On ]
A7: [X] Play Ringtone [ Type:Alarm Sound:Cuckoo clock Stream:4 ]
A8: Music Play [ File:Ringtones/fur_elise_dubstep.mp3 Start:0 Loop: On Stream:4 Continue Task Immediately: On ]
A9: Vibrate [ Time:200 ]
A10: Torch [ Set: On ]
A11: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A12: Torch [ Set: Off ]
A13: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Goto [ Type:Action Number Number:9 Label: ] If [ %PerotStop !~ true ]
A15: Variable Clear [ Name:%PerotStop Pattern Matching: Off Local Variables Only: Off ]
These are the actions that the stop button that is displayed in the scene should have. They are added on the "tap" tab within the element edit. Notice the final action of the stop button is to clear the scene.
Code:
A1: Variable Set [ Name:%PerotStop To:true Recurse Variables: Off Do Maths: Off Append: Off ]
A2: Music Stop [ Clear Dir: Off ]
A3: Destroy Scene [ Name:PerotNotifStop ]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse

Since 52.0.A.3.163 Bluetooth problems with my car (android choosing wrong codec)

With the latest FW 52.0.A.3.163 on the H8266 I run into some crappy Bluetooth issues with my car (BMW F20 Build 06/2018). The FW before all was fine!
Every time I connect to the car the codec is auto-set to AAC, which results in stuttering/buffering. I need to set the codec every time to sbc for a smooth playback. Even if I set it in the developer settings to SBC. The problem seems to be a general android problem - see here.
My Question: is there a option to make the developer-codecsettings sticky? Or is there a (non-root) app, which can do this for me?
Yesterday I made a factoryreset (which was a waste of time) - nothing changed.
Today I also called sony customer care and they said i'll have to send it to repair. But in my opinion this is nonsense, because its a software related issue and they wont find something to repair.
This issues are also decribed in this (german) forum for bmw/mini: https://www.motor-talk.de/forum/bluetooth-aussetzer-android-und-aac-t6545334.html
here my workaround with the (non root apps) Tasker and Autoinput:
Code:
Profile: Hs Connected (2)
State: BT Connected [ Name:BMW 38661 Address:* ]
State: BT Status [ Status:eek:n ]
Enter: SBC Auto Set2 (6)
A1: AutoInput Unlock Screen [ Configuration:Unlocking Screen.
Android 7 and above:
This will only unlock your screen if you're using a non-secure lock screen or if Smart Lock (Trusted Places, Trusted Devices, etc) is currently active.
Android 6 and below:
it's highly recommended that you use the Tasker 'System Lock' action at the end of this task. If you don't, your screen's lock will be permanently off and your system might even become unstable.
This action WILL NOT work with a secure screen lock even if you are using Smart Lock. It will only work if you have screen lock security set to none or swipe. Timeout (Seconds):10 Continue Task After Error:eek:n ]
A2: Wait [ MS:0 Seconds:15 Minutes:0 Hours:0 Days:0 ]
<entwickleroption starten>
A3: Launch App [ App:Developer Options Data: Exclude From Recent Apps:eek:n Always Start New Copy:eek:n ]
A4: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
<enable autoinput>
A5: AutoInput Action [ Configuration:Type: Text
Value: ACCESS DEVELOPER OPTIONS
Action : Click
Manage Accessibility Service: Enable Before Action Timeout (Seconds):5 ]
A6: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A7: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 200,1990
End Point: 200,87
Duration: 509 Timeout (Seconds):60 ]
A8: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A9: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 200,1990
End Point: 200,87
Duration: 509 Timeout (Seconds):60 ]
A10: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A11: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 200,1990
End Point: 200,400
Duration: 509 Timeout (Seconds):60 ]
A12: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A13: AutoInput Gestures [ Configuration:Gesture Type: Swipe
Start Point: 200,1990
End Point: 200,400
Duration: 509 Timeout (Seconds):60 ]
<Long wait!>
A14: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
<öffne Codec einstellung>
A15: AutoInput Action [ Configuration:Type: Text
Value: Bluetooth-Audio-Codec
Action : Click Timeout (Seconds):20 ]
A16: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
<SPC auswählen, dann autoinput aus>
A17: AutoInput Action [ Configuration:Type: Text
Value: SBC
Action : Click
Manage Accessibility Service: Disable After Action Timeout (Seconds):20 ]
A18: Wait [ MS:244 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A19: Go Home [ Page:0 ]
A20: Media Volume [ Level:30 Display:eek:n Sound:eek:n ]
A21: Launch App [ App:Spotify Data: Exclude From Recent Apps:eek:ff Always Start New Copy:eek:ff ]
Hi there,
I'm experiencing same issue with my xz3, also after 52.0.A.3.163 fw update.
I have contacted Sony and they have me record and sent a bug report. They also promised to look into this issue. Unfortunately next fw 52.0.A.3.202 doesn't solve the issue either.
It seems that this thing is more related to android then just sony. The bug is also present on oneplus 6t with January update.
Hi there,
I am having the same issues with my XZ3 in my BMW F48 - buffering during Bluetooth streaming is really annoying. At the moment the only solution is to set bluetooth codec to sbc everytime I connect my phone to my car. With my bluetooth speaker from sony everything is fine. Interestingly I am also facing streaming issues at home with my yamaha avr over wlan....
Today I got the 52.0.A.8.14 update and the problem unfortunately still exists :-\
chero90 said:
Today I got the 52.0.A.8.14 update and the problem unfortunately still exists :-\
Click to expand...
Click to collapse
Play a bit with the bluetooth settings in the developer options and send the stock support the working settings and the bluetooth hardware version of the device you want to use.
They fixed my problem in the next monthly update in the past.
MartinX3 said:
Play a bit with the bluetooth settings in the developer options and send the stock support the working settings and the bluetooth hardware version of the device you want to use.
They fixed my problem in the next monthly update in the past.
Click to expand...
Click to collapse
I am still having the same issue. At the moment I reset the Bluetooth codec to SBC everytime I enter my car..... whom should I send the mentioned information?
Thanks
wwjokerk said:
I am still having the same issue. At the moment I reset the Bluetooth codec to SBC everytime I enter my car..... whom should I send the mentioned information?
Thanks
Click to expand...
Click to collapse
here
https://support.sonymobile.com/global-en/contactUs/
But I dit it... But the Support does not know anything - my experience. I've contacted them in dezember 18 and march 19 and nothing...
Sony is still not able or competent enough to change the software. Today I got the reply that it is not clear if it is a handling mistake or a setup error. They simply do not understand that their software is the reason for the misconnecting....
Yep. Its annoying. After 12 Years of pure Sony loyality the XZ2 will be my last phone from them.
chero90 said:
here
https://support.sonymobile.com/global-en/contactUs/
But I dit it... But the Support does not know anything - my experience. I've contacted them in dezember 18 and march 19 and nothing...
Click to expand...
Click to collapse
I listed them my tried settings and the Bluetooth hardware generation where it works and where it doesn't works
And the fixed it a month later.
You could also try omnirom.
great news! Firmware 52.0.A.8.50 fixed all my Bluetooth Problems.
Same here, at the moment music streaming in my car is working without any interruptions. Why it took so long to find this solution will be the secret of Sony for a long time

Media Control action is not executed during locked screen

Hey,
I've an issue with the "Media Control" action and I'm running out of ideas how to find or solve it.
I would like Deezer to start playing music when my headset or car unit is connected via bluetooth and the play command was sent.
Everything works fine when the screen is unlocked. But when the screen is locked, Deezer comes up but don't start playing music.
I added some "beeps" into the task to be sure that it's executed, and to determine were it maybe stops.
Code:
A1: Beep [ Frequency:8000 Duration:200 Amplitude:50 Stream:3 ]
A2: Browse URL [ URL:deezer://www.deezer.com/profile/[ID]?autoplay=true ]
A3: Beep [ Frequency:8000 Duration:200 Amplitude:50 Stream:3 ]
A4: Wait [ MS:0 Seconds:8 Minutes:0 Hours:0 Days:0 ]
A5: Turn On [ Block Time (Check Help):500 ]
A6: Beep [ Frequency:8000 Duration:200 Amplitude:50 Stream:3 ]
A7: Media Control [ Cmd:Play [Simulated Only] Simulate Media Button:eek:n Package/App Name:Deezer Use Notification If Available:eek:ff ]
A8: Beep [ Frequency:8000 Duration:200 Amplitude:50 Stream:3 ]
I can hear all four beeps. The Tasker log shows no error.
Same issue with an third-party action of "Hue Essentials". I would like to enable some devices when I'm coming home. Everything works fine when the screen is unlocked. But as soon as the screen is locked, Hue Essential is telling me that it can't reach the Hue bridge. This is not an Tasker issue for sure. But I guess the reason could be the same as why Tasker can't execute the "Play" command when the screen is locked.
Any ideas, folks?
Jas
Seems that I've found the solution by myself
The main issue was that Deezer was not able to register the MediaButtonReceiver for itself when the screen is locked. so if I connected my mobile phone to the car, and I used another media app like YouTube before, Tasker started Deezer, but Deezer was not able to register the MediaButtonReceiver. The BT command "Play", which is send by the car unit, was received by the last registered media app (e.g. YouTube) then.
I tried to set the secure setting value with Tasker by executing "settings set secure media_button_receiver [VALUE]". But this did not solved the issue.
In the end it was Androids battery optimization for Deezer which I had to disable to get my task running. Now Deezer comes up and starts to play music when my mobile phone is connected to my car via BT.
I added a check for the MediaButtonReceiver value to prevent the start of Deezer again and again, when I just had a few short stops.
Code:
A1: Run Shell [ Command:settings get secure media_button_receiver Timeout (Seconds):5 Use Root:eek:n Store Output In:%media_button_receiver Store Errors In: Store Result In: ]
A2: If [ %media_button_receiver !~ *deezer.android.app* ]
A3: Browse URL [ URL:deezer://www.deezer.com/profile/[ID] ]
A4: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A5: Media Control [ Cmd:Play [Simulated Only] Simulate Media Button:eek:n Package/App Name:Deezer Use Notification If Available:eek:ff ]
A6: End If

YouTube Vanced AutoPlay after being disconnected (not paused) from car bluetooth

Hello,
I came across XDA in my various searches for Tasker and media related inquiries. I posted this originally on Reddit and got some replies and made some things happen but it seems I've hit a dead end. What I would like to do is have my YouTube Vanced auto restart playback when I am reconnected to my car. Depending on the sequence of things, at times, the application can be paused (with the play button visible in the mini-player) and other times it has a pause button displayed in the mini player and won't initiate playback after turning back on the car.
I've been able to follow this description left by a user on Reddit - which has allowed me to playback any "APM Policy Manager start and stop output". It works with the toast notification but alas if my car is turned off and I see the pause button and not the play button, it won't continue playback on connection. My car seems to send a disconnect message and therefore I see the pause button - my headphones seem to send a pause and therefore I see a play button on the mini-player if they are ever disconnected.
Initially we are acting on logcat messages - perhaps I thought about deciphering the difference between my car disconnect message and the headphone disconnect message but I am not sure. Here is the code to make this happen - anyone try the same thing?
XML:
Profile: LP-MEDIA-DETECT
Settings: Enforce: no Notification: no
Event: Logcat Entry [ Output Variables:* Component:APM_AudioPolicyManager Filter:startOutput() Grep Filter (Check Help):Off ]
Enter Task: media-DETECT
Settings: Run Both Together
A1: [X] Multiple Variables Set [
Names: %lp_media_apps
Variable Names Splitter: #
Values: youtube|maxmpz|newpipe|bbc.sound|kodi|mx|
Values Splitter: #
Max Rounding Digits: 3 ]
A2: Run Shell [
Command: dumpsys media_session
Timeout (Seconds): 0
Store Output In: %data
Use Global Namespace: On ]
A3: Variable Search Replace [
Variable: %data
Search: (?<=packages=).*?(?=\s)
Store Matches In Array: %app ]
A4: Stop [ ]
If [ %app1 !~R %lp_media_apps ]
A5: Variable Set [
Name: %LP_STATE
To: 1
Max Rounding Digits: 3 ]
A6: Variable Search Replace [
Variable: %app1
Search: .unlock
Replace Matches: On
Continue Task After Error:On ]
If [ %app1 ~R maxmpz ]
A7: Variable Set [
Name: %lp_media_app
To: %app1
Max Rounding Digits: 3 ]
If [ %app1 !~ (?i)%lp_media_app & %app1 ~R (?i)%lp_media_apps ]
A8: Flash [
Text: %app1
Tasker Layout: On
Background Colour: #FF000000 ]
EXIT
[MEDIA STOP] PROFILE it's the same profile name and other filter
Profile: LP-MEDIA-DETECT
Settings: Notification: no
Event: Logcat Entry [ Output Variables:* Component:APM_AudioPolicyManager Filter:stopOutput() Grep Filter (Check Help):Off ]
Enter Task: media-EXIT
Settings: Run Both Together
A1: Run Shell [
Command: dumpsys media_session
Timeout (Seconds): 0
Store Output In: %data
Use Global Namespace: On ]
A2: Variable Search Replace [
Variable: %data
Search: (?<=packages=).*?(?=\s)
Store Matches In Array: %app ]
A3: Stop [ ]
If [ %app1 !~R %lp_media_apps ]
A4: Variable Clear [
Name: %LP_STATE ]
A5: Stop [ ]
A6: [X] Flash [
Text: %app1
Continue Task Immediately: On
Dismiss On Click: On ]
Here is the Reddit link as well: YouTube Vanced - AutoPlay
I have had some success with making a task with Play (simulated) on %app1 etc... but %app1 can change to the display or .... LED cover if the screen is just opened on my phone... etc. I've even tried Open App, %app1, or YouTube Vanced... simulate play or toggle paused... no avail.
Can you intercept the bluetooth disconnect message in a logcat and block it? Or change it to something? Is Tasker the right tool for all automation ideas? I have tried MacroDroid, Automate... they seem more userfriendly but then I found myself left underwhelmed - perhaps my lack of experience and knowledge is the only factor.
Cheers,
Erik

Categories

Resources