E46 Fanatics Forum banner
1 - 20 of 31 Posts

·
Registered
Joined
·
143 Posts
Discussion Starter · #1 · (Edited)
The software installation guide for this has changed. Refer to my updated post below.
E46 Android Auto (AA) installation
What you'll need (apart from basic tools):
  • Pibus - to interface with the iBUS - read more about it at the thread over here https://forum.e46fanatics.com/showthread.php?t=940693
  • Raspberry pi (I use an old 2B, but a 3B+ would be better as it has inbuilt Bluetooth which is now working in AA)
  • 6.5" touchscreen overlay with USB controller to use with the factory nav - to install on top of the navigation screen. I used one pretty much the same as this https://www.ebay.com/p/6-5-RESISTIV...h-800x480-LCD-Panel-USB-Controller/1955863050
  • Some custom cables to extend the LCD digitizer, I used some thin wire similar to jumper wire from an electronics store.
  • Some double-sided tape to install the screen
  • A Dremel or a small file
  • 8GB SD card - crankshaft doesn't use too much (8gb is just what I had spare)
  • Latest crankshaft NG image - download it here http://getcrankshaft.com/ I was working with an earlier version (they update this on a weekly basis and it's impossible to keep up), but this guide should still be usable
  • Notepad++ - for editing some configuration files
  • Win32DiskImager - writing the image
  • Putty - SSH into the pi for further configuration
First, this guide includes a fair few steps and use of the terminal, so if you get stuck either let me know when I've been unclear and I'll try and clear it up. Or just google it...
Part one: software
  1. Download the crankshaft NG image from the website (https://getcrankshaft.com/), extract the .img from the zip file and write it to an SD card using Win32DiskImager (or similar).
  2. Once it's written to the sdcard, plug the sdcard into your computer (you'll need an sd card reader for this), open the file boot/crankshaft/chrankshaft_env.sh using Notepad++ or similar (don't use notepad).
  3. Scroll down to the bit that says DEV_MODE=0 and change it to DEV_MODE=1, and change the part that says DEV_MODE_APP=0 and change it to DEV_MODE_APP=1
  4. Scroll further down to the Wifi and enter your SSID and password, this will make it much easier to edit (this is for Pi3/pi's that have a USB wifi adapter installed). Save and exit the file.
  5. Open the file boot/config.txt and remove the part "console=serial0,115200" from the first line.
  6. Insert the SD card into the pi and power on, give it a minute or two, then connect to it via SHH using putty. Username is 'pi' and password is 'raspberry'.
  7. At the terminal, enter the following commands
    sudo systemctl stop [email protected]e
    sudo systemctl disable [email protected]e
    sudo systemctl mask [email protected]e
  8. Download pibus by typing
    wget http://pibus.info/pibus-install.sh
  9. at the terminal Type
    sudo nano pibus-install.sh

    and go down to lines 131-133 where it reads:
    OSMC="0"
    HOMEDIR="/storage"
    CONFIGDIR="/flash"

    And change it to:
    OSMC="0"
    HOMEDIR="/home/pi/"
    CONFIGDIR="/home/pi/"
  10. Press Ctrl+x and hit y to save
  11. Back at the terminal type:
    bash pibus-install.sh
    When it asks what skin, just select no skin and continue
  12. Back at the terminal, type
    sudo nano /etc/rc.local
    scroll down to the second last line (above the line that reads 'exit'), and insert on a new line
    ./home/pi/pibus -c22 -v4 &
    then ctrl+x and y to save
  13. Type
    sudo nano /boot/config.txt
    and remove the line
    dtparam=audio=on
    and insert
    dtoverlay=hifiberry-dac
  14. ctrl+x then y to save
  15. Type
    sudo nano /etc/asound.conf
    and add
    pcm.!default {
    type hw card 0
    }
    ctl.!default {
    type hw card 0
    }

    ctrl+x then y
  16. Reboot with
    sudo nano reboot
  17. To confirm that pibus is running, at the terminal type
    ps ax
    and look for an entry that looks like /home/pi/pibus -c22 -v4
    if it exists, then the software config part is done, otherwise work your way back through the steps to get things going.
  18. Connect the pibus to the car (see the thread for info), turn to accessories and confirm that the crankshaft homescreen comes up. Plug your phone in to the raspberry pi to confirm it works, then unlock your phone and play some music (stereo controls aren't activated yet, have to re-do my mappings).
  19. I'm still mapping the buttons so that you can have basic controls (including steering controls) without a touch screen, and am halfway there. I'll update this post when done.
  20. Onto the hardware...

Part 2: the hardware (you only need to do this if you want a touch screen, otherwise skip)


  1. Remove the nav unit from the front console. There's a guide that I found (I had to muddle through it myself) to disassemble the head unit here
    (https://www.youtube.com/watch?v=OSfExX5cgX4)
  2. Once you have the screen cover removed, cut some double-sided tape into thin strips and place around the edge of the screen.
  3. Place the touchscreen (be careful to place it so that the touch-sensitive part is facing outwards!) on top of the screen with the ribbon cable facing up (as we fill feed it a special way).
  4. Feed the touchscreen's ribbon cable over the top of the circuit board and connect the ribbon to the extension cable (whatever it's called).
  5. Using a Dremel or small file, enlarge a section of the hole where the ribbon cable goes so that you have room for the large plug on the cable extension. Or you could just slide the thin part through the slot first and the connect it to the LCD ribbon cable if you are smart, unlike me...
  6. With the touch-screen on top of the LCD, you'll have to Dremel/file some of the inside of the cover window as it won't fit due to the added thickness. Be careful to cut evenly, taking small parts away at a time. Cut, try to mount onto the screen, and if necessary cut again. Once it sits nicely, reassemble the screen assembly and put the two dials back on.
  7. Feed the touchscreen extension cable and LCD ribbon cable back into the main unit, plug the ribbon cables in, then re-attach the front assembly to the two side arms.
  8. Connect the extension cable you have (jumper wires etc) to the touchscreen cables that then run to your (mine sits in the boot, so my jumper wires went to an old dynavin extension cable that was installed previously, giving me access to the Pi in the boot) the USB controller, and that into the Pi. I haven't noticed any ill effects with the cable length from the screen to the boot, as the limit is with USB cable length.
  9. Re-assemble the rest of the nav unit and re-mount it into the dash.
  10. With mine, I had the problem of the y-axis being inverted on the touch screen (touches on the top registered on the bottom etc.), so I swapped the y+ and y- cables before they went into the USB controller, meaning that I didn't have to do any hardware calibration. I did this after the fact, so don't stress if you don't do it straight away.
  11. Plug the USB controller into the raspberry pi, power on, plug your phone in, and start touching. If anything is inverted, work out which axis is the offender, and swap the cables over as they go into the USB controller.
  12. Job done!
    Here's my only photo atm, as I don't have the car at the moment. I'll upload some video over the weekend :)


It took a fair bit of tinkering, and I'll update the list as new releases come out. Good luck!!!
 

·
Registered
Joined
·
42 Posts
Thanks for sharing! This is really interesting. Is it possible to get this to work with apple carplay via jailbreaking or something else?

How do the volume controls work? do most of the factory buttons work?

Thanks.
 

·
Registered
Joined
·
143 Posts
Discussion Starter · #8 · (Edited)
Yes - I've been playing with it over the past few weeks. I now have android auto wireless working (I have a pixel 2 xl) and Bluetooth (using an external dongle). I'm using the 2018-11-24 image, as the newest ones have an annoying startup message. I've also remapped the keys to work with the stock nav unit, which is a handy feature. I'll post some instructions soon!
ALso, have to edit my tutorial - a lot of those steps are redundant now.
 

·
Registered
Joined
·
143 Posts
Discussion Starter · #10 · (Edited)
Wanted to get this in before 2019!
I've got some updated instructions below. I suggest you read the original to get the jist of it, then install the latest release following these instructions instead. This guide is for Pre-16, but it should be good for future releases.

1: Install crankshaft to the SD using win32imgburn or etcher.

2: Plug the SD card in and power on the Pi. I connect it to a monitor and keyboard for rest of the install, as I can test the buttons and change things in the crankshaft gui more easily. Also, when changing settings, not only do you have to press 'save' at the bottom, but you need to click restart on the main screen so that all the changes are saved to the SD card. Just pulling the power cable is a no-no!

3: In the gui, go to the input tab and enable following buttons: next, previous, toggle, enter, home, left, right, wheel, back, up, down.

4: In the h/w tab, enable the dac by selecting hifiberry-dac, and Bluetooth if you need it. You'll have to click the little checkbox before you hit save or the settings won't save.

5: Now we'll SSH into crankshaft and install pibus and make some other changes. To enable dev mode, open the file crankshaft/chrankshaft_env.sh on the boot partition (that's what you see when you open the SD card on Windows) with Sublime Text, then edit so it says DEV_MODE=1. You also need to enter you wifi info so you can SSH in (unless you use ethernet). Save the file, put the card into the Pi and start it, then wait for it to restart. Voila! You're in dev mode.

6: SSH into the pi (I find the IP address by going into my router's devices list). Username is "pi" and password is "raspberry", both without the quotation marks.

7: Once you've SSH'd in, run the command
Cd /
Then
sudo mkdir /storage
Now we can download, configure, and install pibus.

8: At the command line
wget http://pibus.info/pibus-install.sh
then
sudo nano pibus-install.sh
Scroll down, and change the directories to /storage and /storage on lines 135,136 (might be a line or two off, but both directories should be /storage)
Install pibus with
sudo bash pibus-install.sh
I didn't install a skin, and just let it run until finished.

9: Now we'll add pibus to startup by using the command:
sudo nano /etc/rc.local
Scoll down to the second last line, so that you're one line above the EXIT command, and insert this on a new line
./storage/pibus -c22 -v4 &
Then ctrl+x to save and exit.

10: Run the following commands:
sudo chmod +x /storage/pibus
sudo chmod +x /storage/.config/autostart.sh
If the second one doesn't work, try it after you've restarted. Sometimes it doesn't work at all for me, but my system runs fine anyway.

11. Restart the system
Sudo nano reboot
SSH in again, and run the following command
sudo ln -s /dev/null /storage/ibus.txt
This stops pibus writing logs, making it read only and protecting the card.

12. Now we'll change the button mapping on the pi so that the nav controls work for AA. At the command prompt, type:
sudo nano /usr/share/X11/xkb/keycodes/evdev
In this file are the keymaps to edit. Each line will look like:
< AE01 > = 10;
And each line maps the input to a button press. Using the guide below, we're going to re-map the buttons. For example, to remap the up and down buttons to 1 and 2 (which is what crankshaft uses to move left/right, and pibus maps to the right wheel), you would change:
< AE01 > = 10; to < AE01 > = 116;
and
< AE02 > = 11; to < AE02 > = 111;

(note that I added spaces between < and the character otherwise it formatted strangely on this forum)
The list below shows the original keymapping that you need to edit. You've already remapped the first two buttons, by searching for the key mapped to 10 , and replacing that 10 with 116. You need to do this for each example below

10: replace with 116
11: replace with 111
57: replace with 60
55: replace with 59
65: replace with 56
43: replace with 9
113: replace with 23
9: replace with 22

If there are keys that are mapped to two inputs, add two zeroes to the redundant commands to they don't screw up everything. Once you're done, ctrl+x to save and exit. You'll have to restart for the changes to take effect. If you've got a keyboard plugged in, you can test the commands from pibus to see if they keys have mapped correctly.

Or... Open evdev, remove everything, and replace with this version: https://pastebin.com/6xYHmS7S. Save (ctrl+x) and restart.

13: The controls work like this:
Steering wheel controls skip and go back and pause as usual
Right wheel on the nav will move up and down the menus
Pressing the right wheel is enter
Pressing < > (the button next to the clock) will open the context menu for the page you're in (maps, music etc.). To go right, you need to select something and press enter, not use the right key
Pressing the clock will swap the active item between the function menu at the bottom and the options in that page (maps, music etc). If you want to go home, press the clock, then scroll to the circle button to go home. To scroll between the different tiles on the home screen, press that clock button again.
Pressing 6 will activate voice commands. You'll need a USB mic plugged in for this to work. I'm still investigating a way to wire the mic, possibly by tapping into the factory mic...
Long-pressing 4 will go to the home screen
I find with these I can move around the interface pretty well. While it's much easier to use my touchscreen, I'm still yet to solve the glare issue. If anyone in Melb wants to swap their stock nav screen for my touch modified panel, let me know!

I hope that helps someone! I'm sorry for the crappy first write-up, and I hope this version helps a bit more ***128522;

PS. If you have a pixel you can even enable AA wireless! Just use the hotspot feature, and follow the guide here: https://github.com/opencardev/crankshaft/wiki/Android-Auto-Wifi
 

·
Registered
Joined
·
143 Posts
Discussion Starter · #14 ·
Is this same digitizer? Will it work? And got it it working problem no full screen and buttons not working
That looks like the same one I got, I can't read Chinese, but the digitizer, controller etc. all look the same.

Are you having problems with the buttons? As in only some work, or none work at all?
 

·
Registered
Joined
·
88 Posts
Is this same digitizer? Will it work? And got it it working problem no full screen and buttons not working
That looks like the same one I got, I can't read Chinese, but the digitizer, controller etc. all look the same.

Are you having problems with the buttons? As in only some work, or none work at all?
your updated instructions is to hard to understand, we with friend tried and can't make buttons work... First post easy and detailed noob friendly.
 

·
Registered
Joined
·
88 Posts
10: Run the following commands:
sudo chmod +x /storage/pibus
sudo chmod +x /storage/.config/autostart.sh
If the second one doesn't work, try it after you've restarted. Sometimes it doesn't work at all for me, but my system runs fine anyway.

2 line don't work for me :( plugged to car buttons still not working only right wheel works, screen showing half size... cant use it ;( trying 3 days now cant make it working :DD idk my car is e39 if this makes a difference
 
1 - 20 of 31 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top