Skip to content

Android Auto Wifi

inspector71 edited this page Jan 23, 2019 · 50 revisions

Since the 9th Pre-Alpha version, Crankshaft can receive an Android Auto projection from your phone over WiFi instead of a USB cable.

However, the practicality of using Crankshaft over WiFi was limited to phones that allowed concurrent WiFi and Mobile Data. The Android Auto projection would be broadcast from phone to Crankshaft and the phone's Mobile Data used for supplying internet connectivity to provide mapping, streaming downloads, etc. As some Android phone OEMs choose to limit or block concurrent WiFi and Mobile Data, Android Auto over WiFi was not practical for users of these phones.

In addition, prior to Crankshaft Alpha1, only one set of WiFi credentials was usable at a time. Therefore Crankshaft could not connect to your phone's WiFi hotspot, to use Mobile Data whilst on the move, and connect to your home, work or a public WiFi router when parked to potentially save on expensive Mobile Data fees.

Crankshaft Alpha1 has addressed these issues by enabling two sets of credentials in Client Mode whilst Hotspot Mode now has default credentials to enable easier testing should you wish to continue using Hotspot Mode.

Crankshaft WiFi setup

To set up WiFi in Crankshaft, you need to edit the /boot/crankshaft/crankshaft_env.sh file, most likely over an SSH connection using a text editor such as nano.

Note: The /boot/ partition will need to be unlocked from read-only mode via csmt boot unlock before you can save changes to your /boot/crankshaft/crankshaft_env.sh file.

WiFi country code

In both Client and Hotspot modes, Crankshaft will need to use the appropriate country code for your region.

Whilst you can set the WiFi country code in the Settings app on the BT / WiFi tab, you can also set it while editing the /boot/crankshaft/crankshaft_env.sh file, such as when adding WiFi credentials as described below, by appending your two-letter (uppercase) country code to this line:

  • WIFI_COUNTRY=

Forcing an update

Once you have set your WiFi credentials by editing the /boot/crankshaft/crankshaft_env.sh file (as described below), regeneration of the /boot/crankshaft/wpa_supplicant.conf file Crankshaft uses for WiFi networking will be required.

To force Crankshaft to regenerate this the /boot/crankshaft/wpa_supplicant.conf file, edit the following line in your /boot/crankshaft/crankshaft_env.sh file, from:

  • WIFI_UPDATE_CONFIG=0

... to:

  • WIFI_UPDATE_CONFIG=1

Special note: If you have an existing, functional wpa_supplicant.conf file you can use it within /boot/crankshaft/. If the wpa_supplicant.conf file is detected it will not be overwritten with credentials from /boot/crankshaft/crankshaft_env.sh (only params like country are checked without changing the credential section).

Choosing Crankshaft's WiFi mode

Crankshaft WiFi can operate in one of two modes:

  1. Client: Crankshaft connects to a router (home, work, public) or your phone's hotspot
  2. Hotspot: Crankshaft becomes a hotspot for your mobile phone to connect to

Client Mode

To use Client Mode you need to enter WiFi credentials in the /boot/crankshaft/crankshaft_env.sh file.

Default "sample" settings for WIFI may already be in place.

Connecting to a WiFi router

To connect to a WiFi router such as a home, work or public router, edit the first pair of credentials:

  • WIFI_SSID="sample"
  • WIFI_PSK="sample"

Connecting to your phone's WiFi hotspot

To connect to your phone's WiFi hotspot, edit the second pair of credentials:

  • WIFI2_SSID="sample"
  • WIFI2_PSK="sample"

Setting up two Client Mode networks

To set up a choice between two Client Mode WiFi networks, edit both sets of credentials:

  • WIFI_SSID="sample"
  • WIFI_PSK="sample"
  • WIFI2_SSID="sample"
  • WIFI2_PSK="sample"

Priority

As long as the credentials are unique, Crankshaft will automatically use the stronger network signal if both networks are available.

Alternatively, you can force which Client Mode WiFi network you wish to use in the Settings app, on the BT / WiFi tab, under the Wifi Mode section.

Hotspot Mode

Starting Crankshaft's Hotspot Mode temporarily

  1. Tap the Settings button
  2. Tap the BT / WiFi tab
  3. Under Wifi Mode, tap Run Hotspot

Crankshaft will immediately attempt to initialize WiFi in Hotspot Mode and if successful, the SSID and Password (PSK) credentials required to connect to Crankshaft (from your phone, tablet, laptop, etc) will be displayed within the Network Information section. These credentials will be the following defaults unless you have changed them by editing the /boot/crankshaft/crankshaft_env.sh file:

  • SSID: CRANKSHAFT-NG
  • Password: 1234567890
  1. Tap the Save button

Starting Crankshaft in Hotspot Mode permanently

  1. Tap the Settings button
  2. Tap the BT / WiFi tab
  3. Under Wifi Setup, tick Enable alongside Start system in Hotspot Mode
  4. Tap the Save button
  5. Tap the Power button
  6. Tap the Reboot button

Enabling Android Auto over WiFi with Crankshaft

After connecting your phone to the CRANKSAFT-NG WiFi network, there's one last step required to receive the Android Auto projection on your Crankshaft head unit:

  1. Launch Android Auto on your phone
  2. Enable Android Auto developer mode
  3. Delete all known cars (a once-off requirement) via:
  • tap the hamburger menu
  • tap Settings
  • tap Connected cars
  • tap overflow menu dots
  • tap Forget all cars
  1. In Android Auto:
  • tap the hamburger menu
  • tap Settings
  • tap Info
  • tap the overflow menu dots
  • tap Start head unit server

  1. In Crankshaft, push the WiFi button on the top left of the home screen

Crankshaft will attempt to automatically connect to the Android Auto projection on your phone.

If, after a delay, Android Auto takes over the screen on your Crankshaft head unit, you're up and running!

If Crankshaft is unable to detect the Android Auto projection automatically, a dialog will appear with a list of detected IP addresses. Choose the IP address of the device (most likely your phone) running Android Auto and tap Connect.

After a delay, Android Auto should take over the Crankshaft screen and you're up and running!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.