FORUMS
Remove All Ads from XDA
H10 Turbo

[Android 3.0+]Proxy/GateWay for Android Auto

1,898 posts
Thanks Meter: 1,299
 
By Emil Borconi, XDA Ad-Free Recognized Developer on 6th July 2018, 06:00 PM
Post Reply Email Thread
Background
- Couple of years ago Google have launched Android Auto, but up till recently the only way to connect your device to the car/head unit was to plug in a USB cable. As of 2018 this starts to change, BUT it looks like you will need to get new hardware for this and older cars/head units won't be upgraded to support this, neither phones with older OS.

Concept
- Since many of us will like to have this wire free but not ready / willing or have the possibility to upgrade the units/cars/phones I have thought of a way to achieve this, by using a small auxiliary device, like for example a very cheap and basic Android TV stick, which can be plugged in/mounted in the car and which can fulfil the roll of a Wifi antenna for your car.

This app should allow you to transform any android powered device into a Wifi receiver for your Android Auto compatible Car/Headunit. Please do not confuse Android Auto, with Android powered headunit (usually Chinese, like MTCB, MTCD, Joying, etc).

AAGateWay Documentation.

Initial alpha version released (16.07.2018)

What is it?
AAGateWay is a super small and simple app which should allow you to use and auxiliary (slave) device to connect your existing Android Auto compatible car to your phone (master) using a hotspot created on your phone.

How to install it?
  1. Download XDA Labs
  2. Install the app from https://labs.xda-developers.com/stor...emil.aagateway
  3. Google play version will be available once app is in stable state.

How to set up?
Option A – Using a TV stick or any other non-screen device with ROOT as slave device.
  1. Install and open the app, grant ROOT permission, once the app notifies you that it’s all set and done, reboot your device (important bit to reboot)
  2. See common bit

Option B – Using a TV stick or any other non-screen device without ROOT as slave device.
  1. Install the app
  2. Most TV sticks will have 2 micro USB ports one for power and one for OTG. Take your laptop or portable powerpack and power up the TV stick using the power micro usb port. Go out to the car, and without disconnecting it from the power source connect it to the car as well using the OTG port. Now wait for a few seconds, then disconnect the OTG cable, but make sure the device does is still connected to a power source, go back in the house and reconnect your device to a HDMI screen for viewing. Using a mouse or any other input device, make sure you select AAGateWay from the visible prompt.
  3. See common bit

Option C – Using a phone or any other device where input is available at all times as slave device.
  1. Install the app (don’t even open it!)
  2. Plug the phone into the car, when prompted make sure you select AAGateWay and always.

Common bit:
  1. Turn on USB debugging on your device (this is not mandatory but it can help entering Android Auto mode on some no-name devices)
  2. On the phone create a Wifi hotspot
  3. Make sure your auxiliary (slave) device connects to the phones (master) Wifi.
  4. Your setup is now complete, proceed to connection.

Connection:
As soon as the car tries to establish a connection with the auxiliary (slave) device (this is connected tot the car using the USB) the app will try to connect to the headunit server on the master phone using the Wifi, in order to be able to do this, you phone needs to:
  1. Create a Wifi hotspot (on your master phone)
  2. Make sure Android Auto headunit server is running - on the master phone - (this can be started once when the phone powers up and left running, if the icon bothers you, you can hide the icon). To start the headunit server you will need to:
    • a) Open Android Auto on the (master) phone
    • b) Go to About menu
    • c) If you haven’t done this till now tap the “About Android Auto” header 10 times, till you see a message about being a developer. (This step has to be done only once)
    • d) From the 3 dotted right top corner select Start Headunit Server
    • e) Close Android Auto.
    • When this conditions are met the app will be able to connect to Android Auto using the Wifi connection.
    • Now simply plug in the auxiliary (slave) device to your car, in case you are using a TV stick make sure you connect it using the OTG connection on the stick.

FAQ.
Q: Can I use this with any car and phone combination?
A: Assuming your car is already Android Auto compatible, then YES.


Q: Is the any way to automate all this?
A: YES, Probably the easiest way is to set up a Tasker profile (or any other similar automation software) to create a Wifi hotspot as soon as the phone connects to the car’s Bluetooth.


Q: Can I also automate the start of the Headunit server?
A: Only with a rooted phone, using the following shell command: am startservice -W com.google.android.projection.gearhead/com.google.android.projection.gearhead.companion.D eveloperHeadUnitNetworkService

Q: Can I use Wifi-Direct to connect instead of WIfi?
A: Not yet, but it will be possible.

Q: Does the traffic come out from my monthly data allowance?
A: NO, traffic between auxiliary device and phone hotspot does NOT count as internet traffic, HOWEVER if you do have other apps on the auxiliary device which download updates, etc in the background that WILL be counted as internet traffic. So I suggest double check the apps on the aux device and disable all those which aren’t needed.


Q: Will the car/head unit provide enough power?
A: It should provide at least 500mA that’s the standard USB current, while I cannot guarantee that will be enough in all cases, it should do, assuming you do turn off all unneeded services on the TV stick.

Q. What about start up time?
A. It will depend a lot on the device you are using. A low-entry TV stick boot time is about 1 minute, which can be a bit too much for an initial car setup. As mentioned earlier, these devices usually have 2 USB ports, you can for example connect the power USB port to a continues power supply in the car, in which case the boot time will be non-existent since the device is always running. If you are using a phone, the phone battery will probably hold the charge just fine for a couple of days, if you disable all apps on it and you set up a profile to go into aeroplane mode when it’s not charging. Tasker or Automate are your friends for that. If you cannot connect the TV stick to a continues power source, you might consider using a small portable power pack which powers the tv stick (should hold power for a few days) and the power pack can be charged while the car is running.

Q. Will using Wifi 5Ghz give me better performance?
A. Well if both of your devices support it, SURE!

Q. Is the source code available?
A. Yes, please see: https://github.com/borconi/AAGateWay




Know problems:
  • - Occasionally connection can fail and can leave your phone in hang status where the phone shows a notification that is connected to Android Auto, but it isn’t. To clear this you will need to force stop Google Play Services on the phone
  • - Latency & lag. This will be really down to the devices you are using. I have tested it with a MK808B Plus, it work’s ok most of the time but occasionally you will get the odd lag. I’ve also tested it with a Nexus 7 tablet, and there was no lag at all, so device does matter, as well as probably ROM.
  • - I get random disconnection. There can be 2 causes for this, one the USB connection fails between the car and the auxiliary device, or the Wifi fails between the phone and the auxiliary device. In my tests I saw a few Wifi disconnections without any reason on the MK808, but non on the Nexus. Changing the tethering option from WPA2 to Open did help with this.
  • - I just cannot get it to work… Try using a phone, that will at least give you some visual guidance. Make sure that your device connects to the phone Wifi hotspot, make sure that AA Headunit server is running on the phone (try to force stop Goolge Play Services, stop and restart the headunit server)… All fails contact me (after I’m back from the holiday on the 28th of July).


Teaser:
The Following 61 Users Say Thank You to Emil Borconi For This Useful Post: [ View ]
 
 
6th July 2018, 08:28 PM |#2  
Member
Thanks Meter: 15
 
More
VERY interested in the progress on this, Emil. For one, this would allow me to charge my Samsung using the Quick Charge adapter in my cigarette lighter, rather than relying on the anemic power output of my truck's USB port. Or if I want to get fancy, I could install a wireless charger and use that.

Thanks for all of your hard work.

Sent from my SM-G935V using Tapatalk
The Following 3 Users Say Thank You to SLAB_8002 For This Useful Post: [ View ] Gift SLAB_8002 Ad-Free
6th July 2018, 09:01 PM |#3  
Jackos's Avatar
Inactive Recognized Developer
Flag Warsaw
Thanks Meter: 944
 
More
Hi Emil,
What about original headunits that have integrated Wifi, but do not have Wireless Android Auto enabled? Is this something that you could enable to work as well?
The Following 3 Users Say Thank You to Jackos For This Useful Post: [ View ] Gift Jackos Ad-Free
6th July 2018, 09:59 PM |#4  
Member
Thanks Meter: 6
 
More
Another great idea.
Definitely interested..
thanks.



Sent from my iPad using Tapatalk
The Following User Says Thank You to jeromeo01 For This Useful Post: [ View ] Gift jeromeo01 Ad-Free
6th July 2018, 10:21 PM |#5  
moralesnery's Avatar
Senior Member
Thanks Meter: 288
 
More
I thought of you instantly when I saw this thread on Reddit, but didn't imagine that you were the creator.
Congratulations and thanks again!
The Following User Says Thank You to moralesnery For This Useful Post: [ View ] Gift moralesnery Ad-Free
6th July 2018, 11:20 PM |#6  
OP Recognized Developer
Flag Wakefield
Thanks Meter: 1,299
 
Donate to Me
More
Quote:
Originally Posted by Jackos

Hi Emil,
What about original headunits that have integrated Wifi, but do not have Wireless Android Auto enabled? Is this something that you could enable to work as well?

Sadly no, that will require altering the firmware on the car and each unit is different. It is possible that those unit might get an official update for Wifi support, but although I'm not 100% certain, I think it will only work with 5Ghz Wifi network, so if you're unit is 2.4Ghz only probably it won't get the update.


If I will ever have times (something which I never have ) I might look into adding this to some units out there, but that is so far down the line, that realistically speaking probably will never happen.
The Following User Says Thank You to Emil Borconi For This Useful Post: [ View ]
7th July 2018, 10:23 AM |#7  
Senior Member
Thanks Meter: 202
 
More
Very interesting idea. I have a couple of these android sticks here and maybe even a modern mediabox that might offfer a bit more performance. I guess you want to power it from the USB socket from the car. Not sure how much current you can draw from these ports.
What is the pc below the radio doing?
7th July 2018, 10:58 AM |#8  
Senior Member
Flag Melbourne
Thanks Meter: 35
 
Donate to Me
More
This is awesome news! looking forward to progress!
7th July 2018, 03:03 PM |#9  
OP Recognized Developer
Flag Wakefield
Thanks Meter: 1,299
 
Donate to Me
More
Quote:
Originally Posted by lukesan

Very interesting idea. I have a couple of these android sticks here and maybe even a modern mediabox that might offfer a bit more performance. I guess you want to power it from the USB socket from the car. Not sure how much current you can draw from these ports.
What is the pc below the radio doing?

Performance is not really needed the slowest device should work just fine. You can theoretically disable all processes and apps, so even a device with 512Mb ram will do.
Indeed I'm taking power directly from the headunit/car in the demo I use an MK808B powered directly from the Sony XAV-100 which only provides like 500mA, so should do (especially if you kill all apps which can use CPU and turn of everything but Wifi on the stick).

The PC is the power source , to lazy to make a separate power switch so I powered the Sony from my PSU directly
The Following User Says Thank You to Emil Borconi For This Useful Post: [ View ]
7th July 2018, 03:22 PM |#10  
Senior Member
Thanks Meter: 202
 
More
Quote:
Originally Posted by Emil Borconi

Performance is not really needed the slowest device should work just fine. You can theoretically disable all processes and apps, so even a device with 512Mb ram will do.
Indeed I'm taking power directly from the headunit/car in the demo I use an MK808B powered directly from the Sony XAV-100 which only provides like 500mA, so should do (especially if you kill all apps which can use CPU and turn of everything but Wifi on the stick).

The PC is the power source , to lazy to make a separate power switch so I powered the Sony from my PSU directly


Ok, got the Mk802, 808 etc etc so I might finally have a good destination for those. Lazy and working is a combo that also works.
Wondering if there is like a beta test thing, or is it complex to get it up and running? I'm pretty sure a lot of people are seriously interested in this. It would offer the freedom of charging your phone the proper way.
7th July 2018, 03:39 PM |#11  
OP Recognized Developer
Flag Wakefield
Thanks Meter: 1,299
 
Donate to Me
More
Quote:
Originally Posted by lukesan

Ok, got the Mk802, 808 etc etc so I might finally have a good destination for those. Lazy and working is a combo that also works.
Wondering if there is like a beta test thing, or is it complex to get it up and running? I'm pretty sure a lot of people are seriously interested in this. It would offer the freedom of charging your phone the proper way.

Not that far away, the only problem this will be braking my fix for obd2aa, so I need to make the 2 things compatible. I also need to do find a way to set the defaults without plugging into the car, you won't really be able to plug in a HDMI screen when you plug it in the car.

I've started fully rewriting my HUR app moving all the code from C to Java, once that is done and I fix other issues with obd2aa I will be pushing this forward

Ideally I will like to have a release available before I go on holiday on the 17th of July but not sure I will manage to do it all by that time.
The Following 3 Users Say Thank You to Emil Borconi For This Useful Post: [ View ]
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