Code Monkey home page Code Monkey logo

pi-dgc's Introduction

PiDGC

Raspberry Pi based Digital Gauge Cluster by Josh Ellis / [email protected]

*** Please Note: This library is designed for, and without heavy modification, will not work on anything other than the Raspberry Pi 4B running a 2021 version of RaspiOS (in my case 2021-05-07-raspios-buster-armhf-lite.img). There are files compiled specifically for this architecture. Additionally, this is hardcoded to support a 1280x480 display. It will look weird on other displays. ***

Setup steps on Buster Lite:

  • raspi-config
    • System Options
      • Boot / Auto Login
        • Select "Console Autologin"
      • Network at Boot
        • Select "No," do not wait for network at boot
    • Interface Options
      • I2C
        • Enable I2C
    • Advanced Options
      • GL Driver
        • Select "GL (Fake KMS)"
  • Follow ALL STEPS in files/PICAN3_UGA_10.pdf to setup/enable the PiCAN3. You must enable the CANBUS and RTC.
  • Follow instructions on https://www.raspberrypi.org/forums/viewtopic.php?t=24679#p227301 to set the proper resolution. This should be 1280x480.
  • Export environment variables needed for Qt:
    • export QT_QPA_PLATFORM=eglfs
    • export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5.15/plugins/platforms
    • export LD_LIBRARY_PATH=/usr/local/qt5.15/lib
  • Install dependencies needed for PiDGC:
    • sudo apt-get install libgles2 libpulse-dev libdouble-conversion-dev libegl1-mesa libmtdev-dev libinput-tools default-jdk
    • sudo apt-get install libts-dev libxkbcommon-x11-0 libwebpdemux2 libgstreamer-plugins-base1.0-0 gstreamer1.0-gl gstreamer1.0-plugins-bad
    • sudo apt-get install gstreamer1.0-plugins-good pulseaudio
  • Add pi user to render group. This is required for good performance.
    • sudo gpasswd -a pi render
  • Copy the files/qt5.15.tar.gz archive to your Raspberry Pi 4, and then decompress it into /usr/local, so you end up with a /usr/local/qt5.15 folder with files under it.
  • Make PiDGC folder and copy over all files:
    • mkdir ~/pidgc
    • Copy files/display into ~/pidgc folder
    • Copy files/images folder and all files it contains into ~/pidgc folder
    • Copy files/hw-interface.jar into ~/pidgc folder
  • Edit /boot/config.txt. Append:
initial_turbo=60
disable_splash=1
boot_delay=0
  • Append quiet fastboot to /boot/cmdline.txt
  • Append contents of files/network_interfaces to file /etc/network/interfaces
  • Copy contents of files/pidgc-display.service to /etc/systemd/system/pidgc-display.service
  • Copy contents of files/pidgc-hw-interface.service to /etc/systemd/system/pidgc-hw-interface.service
  • Enable both services
    • sudo systemctl enable pidgc-display.service
    • sudo systemctl enable pidgc-hw-interface.service
  • Bring up CAN:
    • sudo /sbin/ip link set can0 up type can bitrate 500000
  • Add user pi to dialout group:
    • sudo adduser pi dialout
  • Install font:
    • Copy files/bladi-two-4f-italic.ttf to /home/pi/.fonts
    • Run fc-cache -v -f
  • Disable unused services once everything is done. This decreases boot time substantially:
    • sudo systemctl disable ssh
    • sudo systemctl disable hciuart
    • sudo systemctl disable nmbd # If you have samba installed
    • sudo systemctl disable smbd # If you have samba installed
    • sudo systemctl disable systemd-timesyncd
    • sudo systemctl disable wpa_supplicant
    • sudo systemctl disable rpi-eeprom-update
    • sudo systemctl disable networking
    • sudo systemctl disable dhcpcd
  • IMPORTANT: Make your filesystem read-only after the gauge cluster is working properly and finalized. This will prevent corruption due to hard shutdowns when your car powers off: http://comfilewiki.co.kr/en/doku.php?id=comfilepi:read-only_file_system_with_overlay

Now when you reboot the system should start the display and be up and running!

pi-dgc's People

Contributors

joshellissh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.