yashsingh1/xdaforums huggingface dataset:
[Paid Software Announcement and Discussion] skatermike21988:
[MENTION=842765]Emil Borconi[/MENTION] Not sure if you've seen my posts about the bluetooth issue with my connection. Basically it seems that my head unit requires Android Auto to re-establish the bluetooth connection with the head unit. If I'm running wifi launcher I can never get it to connect as it loads up on bt connect, connects to hotspot and sends the intent correctly and is establishing the connection to the slave fine. But that's were things end. AA says connected to car briefly and goes away to never be seen again.

But using tasker, I can have it triggered by bluetooth which then turns off bluetooth on my master and connects it to the hotspot while setting a variable to keep it from triggered the connect sequence again. With bluetooth off and the master connected to the hotspot I then send the intent via tasker and viola, I get AA on my head unit and AA re-establishes the bluetooth connection

Is it possible for you to bake this into Wifi Launcher as an option? I have a feeling that some users who are experiencing the same 3-5 second connected notification may be having the same thing going on.
[Paid Software Announcement and Discussion] charles8814:
Thank you for reply.

I almost succeeded to follow your advices.

But only one thing is not solved. My master phone is working on Android10. So the 'wifi connect for Tasker' app is not working.

So it is impossible automatically connect to the "HUR". Of course master gonna connect to HUR in general Wifi setting but slave doesn't have a sim. So no network. Hence my master trying to disconnect HUR.

I need an auto wifi refreshing tweak on the tasker but could not find it. Or its gonna be okay if I could keep the HUR wifi connection with the mobile network at the same time (Actually previously AAGW app support this function, as I remember... when AAGW succeeded to connection, both network, wifi(from slave) and mobile data existed simultaneously.
[Paid Software Announcement and Discussion] mellda:
What version of AAGateway and Wifi launchee do you use? Still no dropout? Does it reconnect every time without the need of restarting or reconnecting the tv stick? Could you post the link where you bought the mk809?
[Paid Software Announcement and Discussion] pflarini:
In my case (Jeep UConnect 8.4), I don't need to stop bluetooth. I made a small version of your script:

1. Wait for BT connection

2. Turn wifi on

3. Connect to HUR

4. Wait 15 seconds

5. Send intent do AA

It works very well, but I was trying to simplify even more, like this:

1. Wait for Wifi HUR connection

2. Wait 5 seconds

3. Send intent do AA

But Tasker does not detect when HUR is connected.
[Paid Software Announcement and Discussion] skatermike21988:
If using the wifi connection state try setting the "active" condition to "no" I tried that method as well and that's the only way I could get tasker to detect the hur connection without data service through the hotspot.

---------- Post added at 02:39 PM ---------- Previous post was at 02:36 PM ----------

Mine works simultaneously without any problems as long as I have switch to mobile data enabled
[Paid Software Announcement and Discussion] morpho26:
I have the problem, that AndroidAuto (Master) stops immediately after starting (Tasker sends Intend), while Wifi stays connected to Slave. Did i something wrong?
[Paid Software Announcement and Discussion] skatermike21988:
Did you try sending the intent with bluetooth turned off? That was my problem.
[Paid Software Announcement and Discussion] Emil Borconi:
[MENTION=9760396]martin.armstrong[/MENTION] - It shouldn't be like that. Did you enable the "auto switch to mobile data" in Wifi Preferences? Maybe check in the developer options to keep the mobile data always on, that might help. What's happening with the stick? [MENTION=4670039]LLStarks[/MENTION] - Is your slave running 7? I'll email you the older version, but what is the exact expereince please? [MENTION=10409579]skatermike21988[/MENTION] - Can you please enable for logging inside Android Auto developer options then grab me a bug report from the master? It might be a double start thing or similar, but I will need to understand what's happening behind the scene.
[Paid Software Announcement and Discussion] Emil Borconi:
[MENTION=9760396]martin.armstrong[/MENTION] - It shouldn't be like that. Did you enable the "auto switch to mobile data" in Wifi Preferences? Maybe check in the developer options to keep the mobile data always on, that might help. What's happening with the stick?
[MENTION=4670039]LLStarks[/MENTION] - Is your slave running 7? I'll email you the older version, but what is the exact expereince please?
[MENTION=10409579]skatermike21988[/MENTION] - Can you please enable for logging inside Android Auto developer options then grab me a bug report from the master? It might be a double start thing or similar, but I will need to understand what's happening behind the scene.
[Paid Software Announcement and Discussion] pflarini:
No success. But if I lock phone and unlock, the profile is executed..

---------- Post added at 04:52 PM ---------- Previous post was at 04:44 PM ----------

No success. But if I lock phone and unlock, the profile is executed..
[Paid Software Announcement and Discussion] skatermike21988:
Sent a bug report with force logging on and using wifi launcher.
[Paid Software Announcement and Discussion] pflarini:
I Migrated to MacroDroid and now it's working perfectly.
[Paid Software Announcement and Discussion] martin.armstrong:
Sorry, false alarm with the MK809V stick. I tried it in car with mini HDMI screen and found I had somehow denied it superuser privileges, so I re-installed it for good measure and it worked, but with the following caveats:

Left to itself it never got an AA connection, maybe because it never put a tick in the box for usb 'connect to pc'. The only way I could get an AA connection was if I toggled the master bluetooth and as soon as the master BT reconnected to car, the AAGateway put a tick in the 'connect to pc' box and the AA picture appeared.

As far as mobile data on the master is concerned, it always had it when connected via the stick (and always the 4G icon was missing on AA screen!)

I reported the problem with mobile data with a slave phone providing the hotspot in a post last week after testing it over and over again and I think other people had similar problems but had not worked out the exact circumstances.

I have had both settings for mobile data switching and always on, for some time now, since I first had problems.
[Paid Software Announcement and Discussion] JKLIMES1:
Anyway you can share that macro so I can plug it into macroDroid as well?

Couldn't figure out how to do it.

Thanks
[Paid Software Announcement and Discussion] pflarini:
Ok, you can download at: https://drive.google.com/open?id=1N7-6eMX5wOqSiwPQT7PIZAkzNFIbWiMw

You will need to change Bluetooth connection name, because it's linked to my car.
[Paid Software Announcement and Discussion] JKLIMES1:
Awesome! Thank you ?

I'll see if I can get it working
[Paid Software Announcement and Discussion] charles8814:
If I use MacroDroid with your scripts, then I no need to use the 'Wifi luncher' app by Emil, am I right?

And could you share the setting on your slave phone as well?
[Paid Software Announcement and Discussion] pflarini:
No need for Wifi launcher app. But you need to create manually a hotspot named HUR in slave.

In slave, I just set to start tethering. It's a moto G5 with Oreo and rooted.
[Paid Software Announcement and Discussion] propi62:
But aagateway is still needed on slave?

My slaves hotspot ip keeps chaning. I think this happens since android 9? Can someone confirm fix ip on android 8?
[Paid Software Announcement and Discussion] Emil Borconi:
So for those who experience connection problem with Wifi Launcher try turning off every BT profile except the handsfree one.
[Paid Software Announcement and Discussion] mistermojorizin:
What happens when you go into titanium backup, click on google play services, scroll one screen to the right? My first option there is "force close app." Pixel 2 xl
[Paid Software Announcement and Discussion] mentalinc:
Anyone tried this with openauto running on a pi?

Also can people share their tasker profiles to enable wifi hotspot etc? maybe add to OP to save us all time creating the same profiles.

thanks and looking forward to getting this working, have already purchased.
[Paid Software Announcement and Discussion] bwall244:
Update for me. AAGATEWAY kept crashing as soon as I plugged it in on galaxy s5. I decided to root the from and install an oreo rom and all works well now. I'm experiencing some audio cut out for about the first 2 minutes of playing something then it goes away. I'm currently trying to figure out a working order for connecting and disconnecting so that I don't have to interact with either phone.
[Paid Software Announcement and Discussion] SLAB_8002:
Yep, exactly. It worked great. I was able to activate Teamviewer on the stick and control it from my phone without connecting a screen to the HDMI output.
[Paid Software Announcement and Discussion] jeromeo01:
Hi

It definitely take time to start properly.

My biggest problem is everytime the connection is requested between car and slave. The slave ask for USB option and if I do nothing I got cannot connect to device. Once selected (even cancel selection works)

It works. My slave is rooted and I did select USB connection in developer mode.

So maybe people with sticks have the same problem but then don't know because they don't have the screen.

Also spotify crashes after first song. No sound and AA hangs red screen on master. Exit screen and reconnect Aa to HU works.
[Paid Software Announcement and Discussion] Salkod:
So good news to anyone with an MK 809 IV stick.

I've made it work with automation.

the steps:

1. download automate from play store

2. download those two flows:

Flow AA: https://www.dropbox.com/s/k4uw8evucny40cu/AA.flo?dl=0

Flow B: https://www.dropbox.com/s/bsvu9tcr1owit0u/B.flo?dl=0

3. open both flows on your stick and choose to run them with automate.

4. run both flows, go to automate settings and check start at boot (you only have to do this once)

5. install AAgateway and open it then deny root access .

That's it, no need to disable anything or do anything else.

Both flows are super simple, but took a lot of trial and error:

flow A will wait for boot completion and then open settings, press usb and enable connection to PC (you can actually see it do that after every boot if you connect it to a screen).

flow B will actually wait for the prompt to choose the default app (this happens every 2 - 3 boots where the default app will be reset) and will choose AAGateway and press always.

.

after doing this it worked every time, it takes roughly 30 sec to start Android Auto from the time I start my car.

I found it to be very responsive with no lag on this stick.

Hope this helps you all. :)
[Paid Software Announcement and Discussion] dhughes72:
if you are using a rooted (android phone) slave, you can always try this to make the boot time quicker: https://techviral.net/make-your-android-boot-faster/
[Paid Software Announcement and Discussion] jpin321:
Using my old Nexus 6p as my proxy device. I can get it to work without issue but I can't seem to keep the AAgateway app from crashing. Might run 10min might go longer, but it will crash everytime. Disabled battery optimization, that seemed to make it last a little longer. I wiped the phone and only installed xda labs and the gateway thinking maybe it was getting knocked out of memory by another app. Anyone have any ideas on why it's crashing/closing?
[Paid Software Announcement and Discussion] Jainyankee1993:
Is the extension supposed to be .flo? I can't open it with automate
[Paid Software Announcement and Discussion] Salkod:
Yes, either import it from automate or simply opening it should prompt automate to ask you if you want to import it as a flow.
[Paid Software Announcement and Discussion] zsamson:
It keeps showing up as a bin file when I download it. I'm installing Solid Explorer to try and rename the file.

EDIT: The BIN files appear to work but you have to import from the app instead of trying to open them in an file explorer.

---------- Post added at 11:50 PM ---------- Previous post was at 11:29 PM ----------

I'm watching this as it boots, the settings screen loads but that's it. It doesn't do anything further? Not sure if I am doing something wrong?

EDIT AGAIN: Give Automate superuser access and it seems to be working now. Going to try it on my radio.
[Paid Software Announcement and Discussion] salkod93:
Well the interface has to be identical to mine and that may not be the same for all the sticks. You can use my flows as base and change the decision blocks in the flow so it picks the right element on the screen.
[Paid Software Announcement and Discussion] zsamson:
I realized Automate didn't have superuser access and/or enough permissions. I just gave it access. The settings/USB option works now after a reboot. Going to try it in my car. Will report back shortly.

---------- Post added 19th July 2018 at 12:33 AM ---------- Previous post was 18th July 2018 at 11:59 PM ----------

Still can't get it to work. The first part of enabling the connect to pc works but it's not working for me after that. I tried not opening AAGateway after installing and even tried to open it to make sure it was setup first. I'm using the MK809 IV also. 2015 Hyundai Sonata is the radio. Pixel XL master device. Hotspot enabled, AA head server running. Any ideas on what else I can try?
[Paid Software Announcement and Discussion] Jainyankee1993:
Yup, can safely say, the automate flow isn't working for me either. Watching on screen and nothing is happening.

Edit: I'm and idiot, and didn't check start at boot . Looking at it now, it does automatically check connect to PC but haven't tested it in the car. Will do that in the AM.
[Paid Software Announcement and Discussion] Miamicane99:
I've confirmed that plugging in the slave after it's connected to the hotspot is effective but if this hurdle can't be overcome I think this is a non-starter for me. The point of this, for me at least, is to get into my car without interacting with a device and using AA. The only way I see around it would be to disable the usb port on the slave device (requiring root I'm sure) until connected to a wifi hotspot. I'm a software engineer but I don't work with Android. Is it possible to disable data communication (while still allowing charging) through a USB port until a designated wifi hotspot is connected to? Or can you put some delay into your existing code?

Thanks for all of your work Emil. I wish I had time to help.
[Paid Software Announcement and Discussion] bggold:
If you have root I found a way to turn off and on the usb port. I have not tested it in the car. I issued the following commands from my laptop and it turned off the usb debug and lost connection to the shell on my pixel xl. It still charges that is good news so your device will still have power. This is why I am not positive it will work until tomorrow when I test it in my car.

I am thinking the plan is to create at script in the /system/etc/init.d to disable it on boot.

Use automate or tasker to issue the command to enable it once wifi is connected and issue the disable command once wifi is disconnected.

To disable type: echo 0 > /sys/devices/virtual/android_usb/android0/enable

To enable type: echo 1 > /sys/devices/virtual/android_usb/android0/enable

To create the script enter the following into a file /system/etc/init.d/usb_off

#!/system/bin/sh

echo 0 > /sys/devices/virtual/android_usb/android0/enable

Then issue the this command on the file: chmod +x /system/etc/init.d/usb_off

Remember you do need root.

Please let me know if this works or not.

I will post my automate flo and the script file tomorrow after I test if it works.

Credit: https://stackoverflow.com/questions/26964620/how-to-disable-android-device-usb-port/26968293#26968293

---------- Post added at 07:36 AM ---------- Previous post was at 06:45 AM ----------

Good news I couldn't sleep so I set it up and so far after several tests it works.

I was not able to put the script in the initial.d due to it not being there and only an init folder. That did not work. If anyone can help with the correct location on phones without the init.d that would be great.

I will upload my flows tomorrow. (See below)

One looks for boot complete and will disable USB. Worse case if you have to reboot just disconnect your phone from the USB cable until it finishes booting.

The other script looks for wifi connected to the hotspot ssid and issues as su the enable command. Once the wifi disconnects from the hotspot it will issue the disable command.

Remember you need root and your phone will still charge.

I know Emil does not like to depend on root but maybe he can implement these functions for rooted devices until he figures out a universal way.

EDIT:

Flow to disable USB on boot.

https://drive.google.com/open?id=1gg9e4CmnMJwgMF94w1qB9KQrR2za0e36

Flow to enable/disable USB on Wifi state.

https://drive.google.com/open?id=165rBgACql_gLnM2zfTgj-RbGvRhz93av
[Paid Software Announcement and Discussion] fusedwire:
Hi Emil,

Would it be possible to use a wireless otg drive and eliminate the requirement of a slave device completely?

https://www.teamgroupinc.com/en/product/m152
[Paid Software Announcement and Discussion] jeromeo01:
How do you start teamviewer on slave if you dont have a screen.?
[Paid Software Announcement and Discussion] blackbird42:
I've tried it with Crankshaft and it's working
[Paid Software Announcement and Discussion] Salkod:
I reset my stick to factory to try and see if this method will work again if starting from scratch, I realized you actually need to open aagateway once and Deny it superuser access.

then just shut off the stick and connect it to the car with the automation provided, make sure the master's hotspot is on and that the stick boots in the car (don't keep the stick on with a portable battery), I've noticed that the best way for this to work is that the stick has to connect to the hotspot then to connect to the car's USB and that's why in the automation I made it wait for full boot (which by then the wifi will be connected) then to flip the "connect to pc" switch.

it's been working for about 10 times in a row for me now, hopefully it will keep working. :fingers-crossed:
[Paid Software Announcement and Discussion] Demran:
For me it is functional with any Hotspot on the master, i only have aagateway on my nexus5x (slave - rooted) abd no additional app on my Xiaomi mi mix 2s (master). The connection establishes every time i start my car/infotainment system. My slave is always on and connected and i only have to start the hotspot at my master ( i could leave it on the hole time). For my setup, i only set the aagateway app as system app via inapp dialog and then manually once connected to my master-hotspot and it is functional.

Thanks to dev ;)
[Paid Software Announcement and Discussion] Freejack77:
Does the headunit server from AA starts automatically on your master? The first post indicates, that with case 3 and a master with Android 8 or lower without root, you need to manually start the headunit server on the master.
[Paid Software Announcement and Discussion] Marshy33:
The new version 5 of Android Auto looks like it has fixed my audio issues with Spotify!

Edit... Thinking about it, it could be a combination of Emil's new app, updating my phone to the latest Android 10 miui.eu weekly and the new AA. Either way over the moon it's working properly!

Just drove 1 hour without any issues using case 3 :) hopefully this isn't just a one off.

Note for people using Xiaomi phones and Miui for the master. Case 1/2 should work but you will not be able to get an internet connection, as Miui does not allow you to be connected to WiFi and use mobile data.

Thanks emil for this awesome app!

---------- Post added at 12:39 PM ---------- Previous post was at 12:36 PM ----------

Are you using lineageos on the slave, I believe this is a feature where the IP gateway will change everytime you use the hotspot.

If your using tasker/macrodroid on the master to launch. You can read the IP gateway, save this as a variable and use this in the intent to launch AA.

---------- Post added at 12:52 PM ---------- Previous post was at 12:39 PM ----------

Emil, Is there anyway to fully disable the usb via a shell script.

Even when changing the value for .../virtual/android_usb/android0/enable my headunit still requires me to pull the usb and plug back in from a cold start. It's like my headunit will fully disable the data connection via usb and even changing the above from 0 to 1 does not re-enable it.

I can see with the above set to 0 my phone still charges. So wondering if there is anything else I can try to try, which will trick my headunit to think the usb had been unplugged and plugged back in.

Thanks
[Paid Software Announcement and Discussion] Emil Borconi:
No but you can leave the headunit server running so you don't need to turn it on and off every time.
[Paid Software Announcement and Discussion] propi62:
Yesterday i changed rom from lineage androi 9 to aosip android 10. Still dynamic ip on hotspot. Next i will try the android 8. [MENTION=8784428]pflarini[/MENTION] , I could import your macrodroid template, looks very good with the variables and timings. Now i can test the timings (seconds)for my own setup. Thank you.
[Paid Software Announcement and Discussion] Marshy33:
https://drive.google.com/file/d/110B-VoszfW6KgRSjIeWPSOPBpozLEwCW/view?usp=drivesdk

I've not shared something on Google drive before so hopefully you can download it.

Basically on connection HUR network it will read the IP and then send the intent.

If you can't download PM me and I'll send it to you.

Edit... Thought you @ me then. Anyway this should get you on the right path.
[Paid Software Announcement and Discussion] jimsey:
i'm still struggling to get the new versions to work.

occasionally i can get it to connect when using my master as the hotspot, but it's very hit and miss.

i cant seem to get option 1 working at all( where the slave creates the hotspot)

my slave ( motog3 with root) recognises the car when it's plugged in, creates the HUR hotspot, my master (s10)connects to the hotspot, but nothing else, the slave does not initiate Android auto on the car screen?

i've tried with and without wifi launcher, Manually connecting to the HUR hotspot and launching AA headunit server. no success with either method :(
[Paid Software Announcement and Discussion] Demran:
No it doesn't start automatically.

The master is on android 9.

I thought if i want to start headunit server automatically i need to root my master?
[Paid Software Announcement and Discussion] Freejack77:
Hi naqand,

the openauto.ova is not available. Can you provide it somehow?

Thanks
[Paid Software Announcement and Discussion] skatermike21988:
+1 to this, emil helped me out with my bluetooth issue and by doing this I was able to get it working with wifi launcher instead of having to use tasker and disable bluetooth.
[Paid Software Announcement and Discussion] pflarini:
What exactly means "turning off every BT profile except the handsfree one"?

---------- Post added at 07:17 PM ---------- Previous post was at 07:16 PM ----------

iPhone alternative:

https://www.youtube.com/watch?v=p6YjBjySpxc&t=2s
[Paid Software Announcement and Discussion] Rc_086:
Emil, could you please write new runshell code for tasker to start AA headunit server? Since last update in summer, previous code doesn't work.

I returned for previous scheme with headunit server on master and AAgateway apps on both devices, because still no luck with last versions.
[Paid Software Announcement and Discussion] Marshy33:
You need root, but this works for me to start the AA headunit server...

am start-foreground-service -W com.google.android.projection.gearhead/com.google.android.projection.gearhead.companion.DeveloperHeadUnitNetworkService