Joelzeller / DigitalRaceDashSlim

Digital Race Dash designed for use on Raspberry Pi in a Honda S2000
177 stars 26 forks source link

DigitalRaceDashSlim

Digital Race Dash designed for use on Raspberry Pi in a Honda S2000

Features:

Screenshots & Photos:

Alt text Alt text Alt text Alt text Alt text Alt text Alt text Alt text Alt text

Hardware and Setup I used:

Install Kivy:

sudo apt-get update

sudo apt-get install libfreetype6-dev libgl1-mesa-dev libgles2-mesa-dev libdrm-dev libgbm-dev libudev-dev libasound2-dev liblzma-dev libjpeg-dev libtiff-dev libwebp-dev git build-essential

sudo apt-get install gir1.2-ibus-1.0 libdbus-1-dev libegl1-mesa-dev libibus-1.0-5 libibus-1.0-dev libice-dev libsm-dev libsndio-dev libwayland-bin libwayland-dev libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev libxv-dev x11proto-randr-dev x11proto-scrnsaver-dev x11proto-video-dev x11proto-xinerama-dev

Install SDL2:

Install SDL2_image:

Install SDL2_mixer:

Install SDL2_ttf:

Make sure the dynamic libraries cache is updated:

Install the dependencies:

Install pip3:

Install pip dependencies:

Install Kivy:

Copy code and data folders to /home/pi/DRDS

Navigate to DRDS directory and run main.py to create the config.ini file

Configure for use with touch screen:

Edit /.kivy/config.ini by:

Change [input] to:

mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput

Other Misc Setup:

In raspi-config -> Advanced Options -> Memory Split

Install Python OBD:

https://python-obd.readthedocs.io/en/latest/#installation

Install RPi.GPIO, Lite does not come with it..

Bluetooth Setup:

Start on Boot:

cd cd /home/pi/DRDS sudo python3 main.py cd


Ctrl+x to Save

We need to make the launcher script an executable, which we do with this cmd:
- `sudo chmod 755 launcher.sh`

Now test it, by typing in:
- `sh launcher.sh`
This should run DRDS.

Create a logs directory:
- `mkdir logs`

Type in:
- `sudo crontab -e`

Now, enter the line:
- `@reboot sh /home/pi/launcher.sh >/home/pi/logs/cronlog 2>&1`

Reboot for final test

## Configure Variables:
Modify in main.py 
- developermode 0=Off 1=On <- 0 for in vehicle use, 1 for development/demo use
- externalshutdown <- leave as 0 for now, in development
- AccelEnabled <- leave as 0 for now, Accelerometer in development
- OBDEnabled <- 1 if you are using OBDII features, leave it ON
- onPi <- its default 1, but will change to 0 in code if detected not running on Pi (for development on PC)
- autobrightness < 0 will keep brightness same as last boot, 1 allows custom time if using RTC, 2 will always dim on boot

## OPTIONAL Clean up boot:
- Disable the Raspberry Pi logo in the corner of the screen by adding logo.nologo to end of string in /boot/cmdline.txt
- Disable the Raspberry Pi ‘color test’ by adding the line disable_splash=1 to bottom of /boot/config.txt
- Clean up the text by adding quiet to end of /boot/cmdline.txt and replace “console=tty1” with “console=tty3”