This is outdated - refer to this for more updated instructions
- Code that listens and parses CAN messages. (Though I do use this and it is amazing)
- Gauge Cluter/Dashboard
- A raspberry pi will listen for CANBUS messages and whatever program you use (or make) will reactive to those messages.
- I used Two apps:
- backend Node.js app that listens to CAN messages (and sends info to a front end via websockets)
- front Chromium web app that displays your information. (you can use whatever you want though)
- Powered by car's 12v (using DC-DC converter)
- Everything auto-starts on power up
- Everything saves and closes on power down
- Raspberry Pi 3
- PiCAN2
- Heatsinks - (keep that CPU cooler)
- 7" Raspberry Pi Touchscreen Display(Note: I later upgraded to two 10 inch screens)(See how to force resolution below)
- DC-DC converter (12v input to 5v usb) - Use this to power your Pi in the car
- Powerblock for safe power on and power off
Folow what I have below but also feel free to give this a quick look too: heavily inspired by this
- Download and RASPBIAN STRETCH LITE onto your micro SD card.
(configure the pi) in the console:
sudo raspi-config
- Go to Change User Password and CHANGE LOGIN PASSWORD
- Go to Network Options: setup wifi if needed; you want to update your firmware, drivers, software, etc.
- Go to Boot Options --> B1: Desktop / CLI: console - Auto login (So when it powers up, it automatically logs in. You can turn this off later after development if needed)
- Go to Boot Options --> B2: Wait for Network Boot: NO (dont wait for it - it will boot faster but may take a bit before you can actively do a apt-get or ssh action )
- Go to Interface Options --> SSH: YES (makes it so you can log into your Pi through your wifi)
- Go to Advance Options --> memory split: 256
- (anything else you want, you can always come back)
- FINISH
sudo apt-get -y update && sudo apt-get -y upgrade ; sudo apt-get autoremove
sudo reboot
This will be needed to get Chromium hardware accelerated.
- Install drivers:
sudo apt-get install libgl1-mesa-dri
- Then enable the the driver:
sudo raspi-config
- Advance Options --> A7: GL Driver --> G2 (FAKE KMS)
- This will allow chromium to hardware accelerate stuff...(but more on that later)
- Reboot:
sudo reboot
Chromium and the thing that will "host" chromium
sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox
sudo apt-get install --no-install-recommends chromium-browser
openbox is now installed; let's make it so our window's manager starts up chromium (auto start stuff comes later)
sudo nano /etc/xdg/openbox/autostart
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
chromium-browser --kiosk --disable-overscroll-edge-effect --disable-sync --disable-suggestions-ui --disable-signin-promo --mmal-frame-copy --mmal-frame-buffers=4 --ignore-gpu-blacklist --enable-native-gpu-memory-buffers --start-maximized --disable-infobars 'http://your-url-here'
- Above - we eliminate basically ALL of the tool bars, notifications etc.
- We also enable a bunch of crap so we can get "accelerated" canvas, etc
- Later - when we get our web server running,
http://your-url-here
will be replaced with our actual url. - To start chromium now: type
startx -- -nocursor
- To quit chromium/x server - hit
Ctrl-Alt-Backspace
sudo nano /home/pi/.bash_profile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
sudo apt-get -y install can-utils libsocketcan2 libsocketcan-dev
- Enable SPI either through
raspi-config
or adddtparam=spi=on
to/boot/config.txt
- put the following in:
/boot/config.txt
#CAN bus controllers
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
sudo nano /etc/network/interfaces
- Paste this into there
auto can0
iface can0 inet manual
pre-up /sbin/ip link set can0 type can bitrate 500000 triple-sampling on
up /sbin/ifconfig can0 up
down /sbin/ifconfig can0 down
helpful links:
- Raspberry Pi & CAN-bus
- Stack Exchange
- Node-CAN NodeJS library that is ready to rumble for CAN messages
- Second Dash setup
5v power from your DC-DC will go directly to this! You're ignition 5v switch/signal with go to the Powerblock's signal jumper.
- Install their driver. That's it.
- For the most current, navigate to Install Node.js on Raspberry Pi
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
On the latest setup, I have two 10 inch screens but I still force the resolution at 800x480 for the first rasp pi and 1080x720 for the second r-pi.
sudo nano /boot/config.txt
- make sure these exist and are uncommented For main dash:
framebuffer_width=800
framebuffer_width-480
For second rpi/screen:
framebuffer_width=1080
framebuffer_width-720
Now that we have installed most of the required OS stuff....LET'S MAKE A BACKUP! Whenever you make successful changes to your OS, always backup your SD image just in case you corrupt your SD card's file system. (like if you shutdown incorrectly, or install something crappy, or screwup a boot config...etc etc etc)
- READ THIS PAGE
- From your mac:
sudo dd bs=4m if=/dev/rdisk2 of=someCoolBackupName.img
how are you planning to set up the web server?