Retrofit Android Auto into Nav unit - E46Fanatics E46 BMW Social Directory E46 FAQ 3-Series Discussion Forums BMW Photo Gallery BMW 3-Series Technical Information E46 Fanatics - The Ultimate BMW Resource BMW Vendors General E46 Forum The Tire Rack's Tire Wheel Forum Forced Induction Forum The Off-Topic The E46 BMW Showroom For Sale, For Trade or Wanting to Buy

Go Back   E46Fanatics > Tuning & Tech > BAVSOUND Mobile Electronics Forum

BAVSOUND Mobile Electronics Forum
Have all your A/V and electronics questions answered here. Ipods, A/V, Radar Detectors Oh My!
Sponsored by BAVSOUND

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 09-05-2018, 04:33 AM   #1
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
Retrofit Android Auto into Nav unit

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-RESISTIVE...ler/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
    ()
  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!!!

Last edited by bmwdud121; 01-14-2019 at 04:27 PM.
bmwdud121 is offline   Reply With Quote
Old 09-08-2018, 11:59 AM   #2
starfox5194
Registered User
 
Join Date: Jan 2013
Location: Waterbury, CT
Posts: 76
My Ride: 2004 330ci
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.
starfox5194 is offline   Reply With Quote
Old 09-12-2018, 06:37 AM   #3
stück/piece
Registered User
 
Join Date: Mar 2017
Location: London
Posts: 107
My Ride: 325 Convertible
Transmission: Manual
Nice job. Might give this a go. Liking the idea of waze and spotify in an oem unit.
stück/piece is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 10-10-2018, 02:33 AM   #4
frostbytez
Registered User
 
Join Date: May 2010
Location: Perth, Australia
Posts: 79
My Ride: '04 M3
interested to see some video of it working.. thinking of attempting it

Last edited by frostbytez; 10-11-2018 at 10:56 AM.
frostbytez is offline   Reply With Quote
Old 10-10-2018, 08:23 AM   #5
Baddabing
Registered User
 
Join Date: Aug 2017
Location: Scotand
Posts: 42
My Ride: E46 330 CI
Well done!!!!

I'm a little bit behind you but this is very useful.

Thank you!!
Baddabing is offline   Reply With Quote
Old 10-10-2018, 12:07 PM   #6
Baddabing
Registered User
 
Join Date: Aug 2017
Location: Scotand
Posts: 42
My Ride: E46 330 CI
Alas - no more PiBus available at the moment and/or for the foreseeable... :-(
Baddabing is offline   Reply With Quote
Old 12-15-2018, 08:13 PM   #7
crazyazz
Registered User
 
Join Date: Mar 2014
Location: Australia
Posts: 129
My Ride: 2002 M3 2010 135i
Did you keep going with this? Is it possible to connect via wifi? Im keen to try it out
crazyazz is offline   Reply With Quote
Old 12-18-2018, 05:36 AM   #8
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
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.

Last edited by bmwdud121; 12-18-2018 at 05:37 AM.
bmwdud121 is offline   Reply With Quote
Old 12-18-2018, 10:11 PM   #9
crazyazz
Registered User
 
Join Date: Mar 2014
Location: Australia
Posts: 129
My Ride: 2002 M3 2010 135i
Awesome , I cant wait to try it. Thanks for talking the time!
crazyazz is offline   Reply With Quote
Old 12-30-2018, 10:55 PM   #10
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
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/cranks...roid-Auto-Wifi

Last edited by bmwdud121; 01-16-2019 at 05:04 AM.
bmwdud121 is offline   Reply With Quote
Old 12-31-2018, 09:12 AM   #11
TheRiddle
Sofa-king-what
 
Join Date: Oct 2002
Location: Tuscany & NY
Posts: 1,766
My Ride: M52TUB28-Vert
Awesome !!!!!!!!!!!!
__________________
TheRiddle is offline   Reply With Quote
Old 01-01-2019, 02:11 PM   #12
crazyazz
Registered User
 
Join Date: Mar 2014
Location: Australia
Posts: 129
My Ride: 2002 M3 2010 135i
bmwdud121 your a legend!
crazyazz is offline   Reply With Quote
Old 01-12-2019, 03:40 PM   #13
Xollen
Registered User
 
Join Date: Jul 2017
Location: Lithuania
Posts: 88
My Ride: E39
Is this same digitizer? Will it work? And got it it working problem no full screen and buttons not working
Attached Thumbnails
Click image for larger version

Name:	Screenshot_AliExpress_20190112-233325_1547329220566.jpg
Views:	33
Size:	64.4 KB
ID:	765809  

Last edited by Xollen; 01-13-2019 at 09:59 AM.
Xollen is offline   Reply With Quote
Old 01-14-2019, 04:53 AM   #14
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
Quote:
Originally Posted by Xollen View Post
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?
bmwdud121 is offline   Reply With Quote
Old 01-14-2019, 10:12 AM   #15
Xollen
Registered User
 
Join Date: Jul 2017
Location: Lithuania
Posts: 88
My Ride: E39
Quote:
Originally Posted by bmwdud121 View Post
Quote:
Originally Posted by Xollen View Post
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.

Last edited by Xollen; 01-14-2019 at 10:13 AM.
Xollen is offline   Reply With Quote
Old 01-14-2019, 04:27 PM   #16
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
Sorry for the poor instructions gals and guys. I've gone through them again. If the button mapping section is still not working, I'll post my evdev file instead
bmwdud121 is offline   Reply With Quote
Old 01-15-2019, 03:45 PM   #17
Xollen
Registered User
 
Join Date: Jul 2017
Location: Lithuania
Posts: 88
My Ride: E39
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 D idk my car is e39 if this makes a difference
Xollen is offline   Reply With Quote
Old 01-16-2019, 05:05 AM   #18
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
Updated post, but here's the contents of my evdev file:
https://pastebin.com/6xYHmS7S
bmwdud121 is offline   Reply With Quote
Old 01-20-2019, 01:25 PM   #19
Xollen
Registered User
 
Join Date: Jul 2017
Location: Lithuania
Posts: 88
My Ride: E39
Can you please make copy of your sd card? Then would be so much easier.

Last edited by Xollen; 01-20-2019 at 01:26 PM.
Xollen is offline   Reply With Quote
Old 01-31-2019, 05:37 AM   #20
bmwdud121
Registered User
 
Join Date: Nov 2015
Location: Melbourne
Posts: 116
My Ride: 2002 330i
Sure, have a go with this:

https://we.tl/t-0SR43ofVSN

The only thing you might have to change is the SDTV out mode in config.txt. I had to change mine to Japanese PAL, but you will probably need NTSC.
bmwdud121 is offline   Reply With Quote
Reply

Tags
android, android auto, navigation retrofit, pibus

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Censor is ON



All times are GMT -5. The time now is 07:42 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
(c) 1999 - VerticalScope Inc. All rights reserved.