Skip to content

Customizing Crankshaft

getsnoopy edited this page Apr 23, 2022 · 19 revisions

Configuration backup

All custom configuration files for Crankshaft are stored in the /boot/crankshaft/ folder.

Wallpaper 💖

From image 2018-03-09 (alpha 0.1.7) on, to use a wallpaper for the "plug the phone in" screen, simply put a PNG file named wallpaper.png (it might be case sensitive, the .png is lowercase, be careful) to the boot partition and inside the crankshaft folder. If you use Windows, boot is only partition your computer can see when you plug in your Cranskshaft SD card. Just drag the PNG file into the folder and enjoy your beautiful car screen :)

The wallpaper should have the dimensions 800 × 480 px (if you use the official screen), or whatever your screen resolution is.

GPIO triggers for Open Auto actions

You can add GPIO buttons to do really cool things. You can use physical buttons to adjust the volume or brightness or to activate the OK Google Assistant. Note that all the GPIO pins are customizable. Volume control by GPIO is enabled by default, but everything else requires you to open the /boot/crankshaft/gpio2kbd.cfg and uncomment a single line.

Here is one example:

Pi Frizing

Example: Map GPIO23 to Next Song

You can try looking at the /boot/crankshaft/gpio2kbd config file (just open the SD card with Windows). Say you want GPIO23 for NEXT track.

You have to look up what are mappable by looking at this list:

https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h

You see:

https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h#L243

#define KEY_NEXTSONG 163

Disregard the 163, it's irrelevant for us. Now, remove the KEY_ prefix. NEXTSONG is what we're interested in. Add a line that says:

NEXTSONG 23

GPIO23 should now map to the NEXTSONG button.

All you have to do now is boot Crankshaft; towards to the top right of screen, tap the Settings button; tap the Input tab; within the Buttons section, check Next track; tap Save.

Currently, Crankshaft exposes the following bindings supported by OpenAuto:

Enter -> [Enter]
Left -> [Left]
Right -> [Right]
Up -> [Up]
Down -> [Down]
Back -> [Esc]
Home -> [H]
Phone -> [P]
Call end -> [O]
Play -> [X]
Pause -> [C]
Previous track -> [V]/[Media Previous]
Next track -> [N]/[Media Next]
Toggle play -> [B]/[Media Play]
Voice command -> [M]
Wheel left -> [1]
Wheel right -> [2]

Source: https://github.com/htruong/openauto/blob/4fa68d1d7c977cccc2c4586b39f893cf9994113a/src/autoapp/UI/SettingsWindow.cpp#L237

Clone this wiki locally