FORUMS
Remove All Ads from XDA

[Android 4.1+]Proxy/GateWay for Android Auto

3,037 posts
Thanks Meter: 2,453
 
By Emil Borconi, XDA Ad-Free Recognized Developer on 6th July 2018, 07:00 PM
Post Reply Email Thread
15th January 2020, 11:02 AM |#1981  
OP Recognized Developer
Flag Tg. Secuiesc / Kezdivasarhely
Thanks Meter: 2,453
 
Donate to Me
More
Quote:
Originally Posted by naqand

I may have missed the battery optimization thing after numerous reinstallations of aagateway... Oops!
Anyway, an android shortcut for just starting the aagateway service without opening the gui would be awesome! It allows for monitoring by Tasker and starting the service if necessary without user interaction or display unlock.

---------- Post added at 10:07 AM ---------- Previous post was at 10:04 AM ----------


Probably for the same reason as me... The master loses mobile data when connecting to the slave's hotspot.
I read something about wifi direct though, which sounds like the best solution for this. Only I couldn't find information on how to set it up for aagateway. Could it work? If yes, how?

The problem is that if you're master is not connected to a Wifi you can't use the method build into AA to start the projection service as that will check if the phone is connected to a Wifi, so Wifi DIrect won't work, which means you will need to have the headunit server running. The problem with the headunit server is that it can get stuck and that means you need to reboot the phone, hence connecting master to slave hotspot is preferred. Normally if you open Settings -> Wifi -> Wifi Preferences there should be an option to "Auto switch to mobile data" which will make sure that the phone keeps using mobile data even when you are connected to a Wifi. This option is only available starting with Android Pie though.
The Following User Says Thank You to Emil Borconi For This Useful Post: [ View ]
15th January 2020, 11:08 AM |#1982  
Junior Member
Thanks Meter: 0
 
More
Can someone tell me the max DPI on a Pioneer Avic F88dab ? Thx
15th January 2020, 11:30 AM |#1983  
Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by Emil Borconi

The problem is that if you're master is not connected to a Wifi you can't use the method build into AA to start the projection service as that will check if the phone is connected to a Wifi, so Wifi DIrect won't work, which means you will need to have the headunit server running. The problem with the headunit server is that it can get stuck and that means you need to reboot the phone, hence connecting master to slave hotspot is preferred. Normally if you open Settings -> Wifi -> Wifi Preferences there should be an option to "Auto switch to mobile data" which will make sure that the phone keeps using mobile data even when you are connected to a Wifi. This option is only available starting with Android Pie though.

I understand... Having it set up without the headunit server would be great indeed.
The setting you mentioned works differently on Samsung though, it never lets both networks be connected at the same time. However, there is a developer setting that does exactly that!
So I'll be testing it tonight, and let you know.
Thanks for your awesome support!
15th January 2020, 11:45 AM |#1984  
Member
Thanks Meter: 19
 
More
Quote:
Originally Posted by Emil Borconi

Actually this might be exactly what you need:

https://tasker.joaoapps.com/userguide/en/java.html

There is an example on how to get the wifimanager, but instead of calling the iswifienabled() function you should use getDhcpInfo()
That returns an object and the objects gateway prompt is the ip

@Emil Borconi

I have connected my slave phone to my laptop and using ifconfig inside adb shell, in the output is an inet address in the wlan0 section which I presume is the ip address of my slave phone hotspot but this changes every time AAGateway restarts the hotspot.
Therefore I need to obtain this ip address every time I run my task. I have tried inserting the following java code in a tasker task as a java scriptlet as per the example in the java help and with your suggested modification (I assume the ip address should afterwards then be in the variable %enabled?):

Variable Set, %service, wifi
Java Function, wiman = CONTEXT.getSystemService( %service )
Java Function, %enabled = wiman.getDhcpInfo()

but it brings a java error 'unexpected identifier', seemingly on the first line. Any suggestions about what I have done wrong?
15th January 2020, 11:47 AM |#1985  
Member
Thanks Meter: 19
 
More
Quote:
Originally Posted by martin.armstrong

@Emil Borconi



I have connected my slave phone to my laptop and using ifconfig inside adb shell, in the output is an inet address in the wlan0 section which I presume is the ip address of my slave phone hotspot but this changes every time AAGateway restarts the hotspot.

Therefore I need to obtain this ip address every time I run my task. I have tried inserting the following java code in a tasker task as a java scriptlet as per the example in the java help and with your suggested modification (I assume the ip address should afterwards then be in the variable %enabled?):



Variable Set, %service, wifi

Java Function, wiman = CONTEXT.getSystemService( %service )

Java Function, %enabled = wiman.getDhcpInfo()



but it brings a java error 'unexpected identifier', seemingly on the first line. Any suggestions about what I have done wrong?

This gives me the correct IP when connected to the slave hotspot....

ip route list match 0 table all scope global | awk 'NR==1{print $3}'

I think we are both attempting the same thing, but I'm using macrodroid and you are tasker.

I managed to read the IP this morning from the slave and then use that to launch AA in another task successfully. But then had audio connection issues.

Sent from my MI 8 using Tapatalk
15th January 2020, 11:59 AM |#1986  
OP Recognized Developer
Flag Tg. Secuiesc / Kezdivasarhely
Thanks Meter: 2,453
 
Donate to Me
More
One thing to consider if you can't get the connection running at all, try turning off the USB debugging on the slave (it might cause a double start) but this is car and phone depended....
15th January 2020, 12:51 PM |#1987  
fma965's Avatar
Senior Member
Thanks Meter: 1,663
 
Donate to Me
More
Quote:
Originally Posted by smoki3

I saw you got it working on you Ford Focus with Sync.
But it is only working if you do a hotspot on the master right? To do this automatically you new tasker or something else or not? Also the hotspot on the master will cause a huge battery drain.

Quote:
Originally Posted by naqand

Yes, I'm using Tasker to turn on the hotspot when my phone is connected to the car's bluetooth.

Quote:
Originally Posted by Emil Borconi

How do I collect a bug report / logcat

1. Enabling Developer Mode
1. Open Settings > About phone.
2. Scroll down to the Build number.
3. Tap the Build number 7 times in quick succession until "You're now a developer" appears.
4. Return to the Settings menu and select Developer options.
5. At the top of the screen, make sure 'Developer options' is set to On (green).
6. Scroll down to Debugging and enable both USB debugging and Bug Report Shortcut on (green).
7. Tab on Logger buffer sizes: Default setting is 256K. Select 16M to help capture more information for debugging. Of note, it can affect the apps performance especially with lower spec phone, so change it back after you have finished submitting bug reports.


2. Capturing a Bug Report
It's very important to do this right after you experience the issue again, so your device can log at least one occurrence of the issue.
1. Hold the Power button down until the menu appears.
2. Select Take bug report. and wait for the device to capture the bug report.
3. Tap the 'Bug report captured' notification when it appears.
4. Share the bug report. (I recommend to email it to yourself.)
5. Download the bug report to your computer.
6. Send the bug report by email to [email protected]

Quote:
Originally Posted by smoki3

I sent you the reports a few mins ago

Hmm, i will have to try it this way and see if it also works for me, i've not had time to get a bug report yet, mostly because it's cold and i don't want to sit in my car for a bit in the cold
15th January 2020, 12:53 PM |#1988  
Member
Thanks Meter: 19
 
More
Quote:
Originally Posted by Marshy33

This gives me the correct IP when connected to the slave hotspot....

ip route list match 0 table all scope global | awk 'NR==1{print $3}'

I think we are both attempting the same thing, but I'm using macrodroid and you are tasker.

I managed to read the IP this morning from the slave and then use that to launch AA in another task successfully. But then had audio connection issues.

Sent from my MI 8 using Tapatalk

the thing is I have macdroid but have hardly used it but I have a tasker task to replace wifi launcher because wifi launcher does not trigger the connection always and I need to get the ip of the slave hotspot on my phone, which unlike my MK809V stick changes each time, into a variable in tasker and use this to provide the ip address for my task. I'm not sure how to execute your command in tasker, but I will look further after lunch.
15th January 2020, 12:55 PM |#1989  
Member
Thanks Meter: 19
 
More
Quote:
Originally Posted by martin.armstrong

the thing is I have macdroid but have hardly used it but I have a tasker task to replace wifi launcher because wifi launcher does not trigger the connection always and I need to get the ip of the slave hotspot on my phone, which unlike my MK809V stick changes each time, into a variable in tasker and use this to provide the ip address for my task. I'm not sure how to execute your command in tasker, but I will look further after lunch.

https://android.stackexchange.com/qu...terminal-shell

This looks like what you may need.

Sent from my MI 8 using Tapatalk
15th January 2020, 01:24 PM |#1990  
OP Recognized Developer
Flag Tg. Secuiesc / Kezdivasarhely
Thanks Meter: 2,453
 
Donate to Me
More
Quote:
Originally Posted by fma965

Hmm, i will have to try it this way and see if it also works for me, i've not had time to get a bug report yet, mostly because it's cold and i don't want to sit in my car for a bit in the cold

Cold where )) LOL
Come here... -10 or even -16
Attached Thumbnails
Click image for larger version

Name:	IMG_20200108_130325.jpg
Views:	118
Size:	271.6 KB
ID:	4927145   Click image for larger version

Name:	IMG_20200115_081028.jpg
Views:	112
Size:	549.8 KB
ID:	4927147   Click image for larger version

Name:	IMG_20200108_102548.jpg
Views:	120
Size:	516.8 KB
ID:	4927149  
15th January 2020, 01:29 PM |#1991  
Member
Thanks Meter: 19
 
More
Just tried with HUR app on master and the audio is also stopping. Spotify shows the track as playing on the headunit but no sound.

Finally having success with both case 1 and 3 though!

So big thanks to Emil for this!


Sent from my MI 8 using Tapatalk
Post Reply Subscribe to Thread

Tags
android auto wifi

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

Advanced Search
Display Modes