Jump to: navigation, search

Raspberry Pi Tips

Introduction

I started out my Raspberry Pi project as a beginner to all things Pi. There was lots of useful information in the forums, but I still had to learn a lot along the way. Although I don't spell out every detail, this page should help beginners along. All of the "boxes" are text that you will type in or see on the screen. Unless otherwise instructed, press the "Enter" key after typing the text.

I started with a writeup by PS14 on the forums, then added my own notes and additional sections. Huge thanks to PS14 for their awesome notes!

You can pick and choose which sections in these Tips may be appropriate for you. Depending on your setup, not all of them will be.

Install Raspbian Stretch Lite on MicroSD card

Start Pi and Update OS

  • Place the MicroSD card in the Pi, connect a LAN cable to the Pi's Cat5 connection for internet access, connect a keyboard, monitor, (and mouse if you wish), then power up.
  • You will be asked to login to the device:
    • Login: pi
    • Password: raspberry
  • Once you have a blinking command line prompt, update to the latest packages:
sudo apt-get update
sudo apt-get dist-upgrade
  • You will be asked if you would like to continue, press "Y" and press enter
  • Once the upgrade is done, clean the upgrade junk
sudo apt-get clean

Tweak the Pi’s config to make it startup and run faster

  • Open the console based raspi-config application:
sudo raspi-config
  • Use the up and down arrow keys to move the highlighted selection between the options available. Pressing the right arrow key will jump out of the Options menu and take you to the <Select> and <Finish> buttons. Pressing left will take you back to the options. Alternatively, you can use the Tab key to switch between these.
  • Highlight #3 Boot Options, hit the right arrow key, and press enter.
  • Choose Desktop/CLI as Pi
    • Choose B2 Console Autologin (with this you will no longer need to enter the password every time the Pi boots up) and press enter
  • Highlight #4 Localisation Options and hit enter. I live in the Eastern Timezone of the US - customize these selections to your location.
    • Choose I1 Change Locale
    • Uncheck en_GB.UTF-8 UTF-8 by hitting the spacebar
    • Check en_US.UTF-8 UTF-8 by hitting the spacebar
    • Hit tab so OK is highlighted and hit enter
    • Choose en_US.UTF-8, hit tab to highlight Ok, and hit enter
    • Choose I2 Change Timezone and hit enter
    • Choose US, hit tab to highlight Ok, and hit enter
    • Choose Eastern, hit tab to highlight Ok, and hit enter
    • Choose I4 Change Wi-Fi Country and hit enter
    • Scroll down to US United States, hit tab to highlight Ok, and hit enter
    • Hit enter
  • Highlight #7 Advanced Options
  • Choose A3 Memory split and change 64 to 256 and press enter
  • Exit out of menu and hit enter with “Yes” selected to reboot
  • When the Pi reboots you should now be auto logged in as user "Pi" and have a blinking command line prompt
sudo nano /boot/cmdline.txt
  • Inside this file, append the following to the end of the line:
quiet splash loglevel=0 logo.nologo
  • Save the file by pressing Ctrl + X, type Y, and hit enter
sudo nano /boot/config.txt
  • Add the following line to the bottom of the file:
disable_splash=1
  • Save the file by pressing Ctrl + X, type Y, and hit enter
  • If you are not using the Pi’s internet,wifi or bluetooth during racing, you can turn these services off to boot up faster. They are easily turned back on when you need to do updates.
sudo systemctl stop dhcpcd.service
sudo systemctl disable dhcpcd.service
sudo systemctl stop hciuart.service
sudo systemctl disable hciuart.service
  • When you need to use the internet to update Pi or RaceCapture, simply enable and start the same services.
sudo systemctl enable dhcpcd.service
sudo systemctl start dhcpcd.service

Change keyboard to US

sudo nano /etc/default/keyboard
  • Change XKBLAYOUT from “gb” to “us”
  • Save the file by pressing Ctrl + X, type Y, and hit enter

Installing the RaceCapture App

  • Change to the /opt directory to install the RaceCapture app
cd /opt
  • Download the RaceCapture app. Update the URL below for the version that you want. This is the latest version as of 2019-07-08.
sudo wget https://autosportlabs-software.s3-us-west-2.amazonaws.com/racecapture_linux_raspberrypi_1.16.0.tar.bz2
  • Extract the downloaded package. Hit the tab key after typing "race" and it should autofill the name for you so you don't have to type it all out.
sudo tar -xjvf race...

Setup for Mausberry circuit

The Mausberry circuit is a great way to power the Pi on/off with the ignition and (hopefully) prevent the MicroSD card from becoming corrupt.

wget http://files.mausberrycircuits.com/carsetup.sh
sudo bash carsetup.sh
sudo reboot
  • If you want, you can change the minute multiplier in the carsetup.sh file to “60” to change it to seconds. I set my delay to 1 and minutes multiplier to 5, so my delay is 5 seconds.

Make the RaceCapture app Auto-start

  • I recommend waiting until you have everything configured the way you want before making the app auto-start.
sudo nano /etc/rc.local
  • Add the following line before the exit 0 line:
/opt/racecapture/boot_racecapture.sh pi
  • Save the file by pressing Ctrl + X, type Y, and hit enter.
  • Reboot to take effect.
sudo reboot

Set up for DFRobot display

  • If you use the official Pi display, there's not much setup to do. If you choose another display, you may need to configure it. I chose to use a 7" DFRobot display:
sudo nano /boot/config.txt
  • Uncomment this line:
disable_overscan=1
  • Add this line:
hdmi_cvt 1024 600 60 6 0 0 0
  • Uncomment and modify these two lines:
hdmi_group=2 
hdmi_mode=87
  • Save the file by pressing Ctrl + X, type Y, and hit enter.
Cd /opt/racecapture/
Sudo nano run_racecapture.sh
  • Comment out both checks for "check for ar1100 resistive touch" and "check for ft5406 capacitive touch" by putting a # symbol at the front of the line
  • Change kivy settings:
Sudo nano /home/pi/.kivy/config.ini
  • Add these lines to the input section of the file:
[input] 
mouse = mouse 
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
#%(name)s = probesysfs,provider=hidinput
  • Save the file by pressing Ctrl + X, type Y, and hit enter.

General Notes and Commands

Run Racecapture manually

  • If you don't set it up to run automatically, you'll have to use this command to run it manually.
/opt/racecapture/run_racecapture.sh

Make cursor visible

  • This may cause lag in the dashboard so it's not recommended except for setup if you elect to use a mouse
Sudo nano /home/pi/.kivy/config.ini
  • Add this to the modules ection
cursor = 1
  • Save the file by pressing Ctrl + X, type Y, and hit enter

Exit RaceCapture

  • Depending on how you have this setup, it may be tricky. This method usually works best for when you have RaceCapture auto-boot.
    • Alt + PrintScreen + K , followed by exiting the app via touch screen

Manually shutdown pi

Sudo Shutdown -h now

Rotate screen 180*

  • This just rotates the display, but does not rotate the touch settings
sudo nano /boot/config.txt
  • Add this line:
display_rotate=2
  • Save the file by pressing Ctrl + X, type Y, and hit enter.


  • If you have a touch screen, you will need to rotate the touch settings for RaceCapture
Sudo nano /home/pi/.kivy/config.ini
  • Modify this line:
mtdev_%(name)s = probesysfs,provider=mtdev,param=rotation=180
  • Save the file by pressing Ctrl + X, type Y, and hit enter.

Transfer RaceCapture from Pi to another device (or vice versa)

  • I like to keep the dashboard settings similar between my phone, laptop, and in-dash screen. Once you follow the directions in the link, you can save the config file from RaceCapture to the thumb drive and transfer it between devices. In my experience, this was not a foolproof and reliable solution and required a bit of playing around with it, but it's the easiest solution I found.