- 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.
- 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).
Beta released (31.12.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.
- Compatible with OBD2AA
- Removes 6 tap limit
- Allow adjustment of DPI
How to use instructions:
- Download and install AAGateWay on both devices (master and slave)
Configure Master (no root required):
- Make sure your Bluetooth is turned on before starting the configuration.
- Open app
- Select Master on Welcome screen
- Make sure you do grant all permissions including modifying system settings (otherwise tethering cannot be automated)
- Select the car's Bluetooth from the list of BT devices
- If you want to automate the process select to enable tether
- If your device is rooted (and it's running Android 8.0 or lower) and you want you can enable the "Start headunit server" as well, however experience says generally it's much better if you start the headunit server manually and leave it running all the time and never bother with this option.
- If you want to change your DPI enable the option and change the value (My experience says 130 will usually look better)
- Exit the app
- Open Android Auto, go to About tap the "About Android Auto" header 10 times till you become a developer, then from the 3 dotted top right menu select "Start Headunit Server"
- Go to Settings -> Connected cars in Android Auto and make sure that "Add new cars to Android Auto" is enabled
- Exit Android Auto
- Configure a Hotspot which you will use on your slave device.
Configure Slave for TV Sticks or any other devices without input when in the car (broken screen phone, etc) - ROOT Only:
- Open App and on the welcome screen select Slave.
- Grant ROOT when prompted ( This will disbale Google Play Services on the device! Tv Sticks have a problem with defaults being overwritten by Google Play Service)
- Follow on-screen instructions
- If you are using an MK809V/MK808B stick enable the appropriate option (you can use this for other no screen devices as well, should work)
- In case you are using a battery power pack connected to the TV Stick as well and you want to reduce power consumption when car is not running, enable Toggle Wifi and option.
- If you are using an MK809V also enable Toggle USB on Wifi (this will make sure that the MK809V will establish a connection with the headunit)
- Make sure the device can connect to the Masters hotspot
- If first connection doesn't kick in for a couple of minutes, take the stick back to the house and re-check permissions, or enable the MK809V/MK808B option and use double power source for the first connection.
Configure Slave for phones (no root should be required)
- Open App and on the welcome screen select Slave.
- Granting Root to the app will disable Google Play Services on the device! If you are intending to use the device for other functions as well you might consider NOT granting root.
- Ignore all blurb about root and etc (assuming you don't have root)
- Make sure the device can connect to the Masters hotspot.
- With the phone being unlocked connect your Slave to the car, when prompted which app to use make sure you select AAGateWay and always. (if you granted ROOT you might never see this question!)
Wifi Address setting on slave
- In case you want to use a car Wifi Router rather then tethering from the master, make sure that the master IP is set to static, and input the masters IP in the IP field.
- Reverse tethering, using above logic you can set your slave to tether and master connect to it, BUT you will only be able to do this if your master runs Android Pie. This function will be further enhanced and properly build in, in future releases, currently if you wish to do this, use Tasker/Automater etc to handle logic on master (USB toggle if needed - see VAG cars below, Tethering start/stop, etc). Also you will need to make sure that the Master gets a static IP.
- Go to the car plug in your slave and start the car.
- Make sure your Master device is unlocked.
- If your slave is a phone (or a device with a screen) make sure the screen is unlocked at the first setup and when prompted you do chose AAGateWay and always!
- If everything is correct you will see a setup screen for AA on your phone, then it should also start on the car/headunit
What to watch out for:
- - It is highly possible that your car will initially display an error message saying to check your phone when it's safe, or phone not ready, or device not supported, etc this is normal, once the slave connects to the master this message should be gone and you should see Android Auto on the car's screen.
- - Sometimes connection can take a bit before they are set up.
- - On your Slave you will see 2 notifications for AAGateWay that is normal, one will stay on forever the other one will be displayed only when phone there is a connection in place
- - There might be cases when the slave won't reconnect after the car was turned off. This will depend on Slave & Car combination, if this happens you can try to enable the Toggle USB in the slave settings but that will need root.
- - It's generally a good idea to enable USB debugging on your slave device, in many cases it will help with establishing connection with the car.
- - Tv Sticks can be nasty occasionally. There where cases when I needed to reinstall the app 3 times same way till it worked, the problem is caused by granting USB permissions without a user input.
Maybe other cars/units as well, but VAG for sure. While most cars can be tricked to wait for the slave any amount of time after a handshake, the vag cars resets the USB after 20 seconds. To work around this, please do use a slave with ROOT and make sure you toggle both options Toggle USB and Toggle Wifi, this way when there is no power coming from the headunit the Wifi and USB will be switched off, then when you start the car, first the Wifi will be turned on and as soon as you have a connection with the master the USB will be activated so AA connection kicks in.
- - 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.
- - App is closed without error or reason. The app runs in a background process, with a minimal interaction with the foreground, some devices/OS will kill background apps. I saw this happening on Nokia and I saw this happening on OnePlus as well. Try disabling battery optimisation for AAGateWay, that might help.
- - 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
Any phone which normally works with Android Auto
- - Tested and know to work (all with stock Rom): - MK809V,MK808B, OnePlus 6T, Pixel 2 XL, Nexus 7, Odroid C2, Sony X Compact, Samsung S7 Edge
- - Tested and had problems:
- worked for a while after a factory reset and fresh install, but then device simply does not enter in USB Accessory Mode. Might be my device, but expereince not the best at the moment
- ZenPad Z380 (Wifi disconnects after a very short time)
- Xiaomi phones (MIUI makes a mess), probably it will work with a AOSP rom.
A: Assuming your car is already Android Auto compatible, then YES.
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. Can I increase boot time for TV Sticks/Phones by removing all unrelated software.
A. Yes, actually quite a lot. Once you have your configuration ready and everything is working as expected, you can uninstall/disable all packages beside this ones:
- package:com.notriddle.null_launcer (or any other launcher, but NULL launcher has no memory consumption, no app drawer no nothing, perfect for headless - see: https://github.com/notriddle/null-launcher )
adb shell pm list packages
adb shell pm disable xxxx
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. Sort-of, please see: https://github.com/borconi/AAGateWay this is only for the sketch, however new version does contain code which lift restrictions on 3rd party apps in Android Auto. To prevent the abuse of this by some, further code won't be updated to GitHub, however if you want to build your own version, please do contact me for details.
Guarantee or Warranty
- Due to the fact that there are so many possibilities and combinations of cars, head units, slave and master devices, there is no way for me to test all of them, however if you did purchase the software and you are not able to get it to work for any reason, please email me on [email protected] and I'm more then happy to refund the purchase.
How to install it?
- Download XDA Labs
- Install the app from https://labs.xda-developers.com/stor...emil.aagateway
- 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.
- 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)
- See common bit
Option B – Using a TV stick or any other non-screen device without ROOT as slave device.
- Install the app
- 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.
- See common bit
Option C – Using a phone or any other device where input is available at all times as slave device.
- Install the app (don’t even open it!)
- Plug the phone into the car, when prompted make sure you select AAGateWay and always.
- Turn on USB debugging on your device (this is not mandatory but it can help entering Android Auto mode on some no-name devices)
- On the phone create a Wifi hotspot
- Make sure your auxiliary (slave) device connects to the phones (master) Wifi.
- Your setup is now complete, proceed to 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:
- Create a Wifi hotspot (on your master phone)
- 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.
How to produce bug report?
1. Enabling Developer Mode
- Open Settings > About phone.
- Scroll down to the Build number.
- Tap the Build number 7 times in quick succession until "You're now a developer" appears.
- Return to the Settings menu and select Developer options.
- At the top of the screen, make sure 'Developer options' is set to On (green).
- Scroll down to Debugging and enable both USB debugging and Bug Report Shortcut on (green).
- 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.
32 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.
- Hold the Power button down until the menu appears.
- Select Take bug report. and wait for the device to capture the bug report.
- Tap the 'Bug report captured' notification when it appears.
- Share the bug report. (I recommend to email it to yourself.)
- Download the bug report to your computer.
- Send the bug report by email to [email protected]