Skip to content
inspector71 edited this page Jan 22, 2019 · 50 revisions

NOTE: This page is being re-written. GitHub does not provide a drafting tool so re-writes are done on-the-fly. This note will be removed when the re-write is finished (at least, by me!).

Starting with the Pre9 version, a Crankshaft head unit has been able to receive the 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.

In addition, prior to Crankshaft Alpha1, only one set of WiFi credentials was usable at a time. This made switching WiFi modes difficult if, for example, a user would like to use one set of credentials for Client Mode to connect to a home or public WiFi router whilst parked, and to their phone's hotspot mode to use Mobile Data whilst driving.

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 by adding the 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 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)

Crankshaft WiFi can operate in one of two modes:

  1. Hotspot: Crankshaft becomes a hotspot for your mobile phone to connect to
  2. Client: Crankshaft connects to a WiFi network such as your mobile running as a hotspot or home router

Client Mode

Since Alpha1, Crankshaft can use two sets of WiFi credentials in Client Mode.

To use Client Mode you need to set up your WiFi credentials in /boot/crankshaft/crankshaft_env.sh, most likely via SSH using a text editor such as nano. The crankshaft_env.sh file contains a lot of settings including default "sample" settings for WIFI. Since Alpha1, two sets of SSID (network name) and PSK (network password) are supported:

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 networks

To have the option to use two Client mode WiFi networks, edit both sets of credentials.

As long as the credentials are distinctly 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.

Enabling Android Auto over WiFi with Crankshaft in Client mode

  1. Make sure your mobile phone's hotspot mode is active
  2. Crankshaft will attempt to automatically connect to your phone's hotspot network (via SSID) and, if successful, display a WiFi button on the home screen
  3. Push the WiFi button and Crankshaft will attempt to receive the Android Auto projection from your phone

Hotspot Mode

The hotspot mode can be enabled inside the settings menu of your system. You can decide if only running in the current session or on every system start.

Running in current session:

Visit Settings -> BT / WiFi -> Wifi Mode and select Run Hotspot. This will start the hotspot and you can connect with your mobile phone (SSID and password is shown inside Network Information)

Start hotspot on every system start:

Visit Settings -> BT / WiFi -> Wifi Setup and tick Enable at Start system in Hotspot Mode.

  • Reboot or start manually like described in session.

Enabling Android Auto over WiFi with Crankshaft in Hotspot mode

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 - if there is only one client the system tries to auto connect your mobile phone.
  2. If more than one client select the correct one and push connect.
Clone this wiki locally