RaceCapture on Raspberry Pi: Difference between revisions

 
(5 intermediate revisions by one other user not shown)
Line 33: Line 33:
=Hardware Selection=
=Hardware Selection=
===Raspberry Pi===
===Raspberry Pi===
The RaceCapture app is compatible with Raspberry Pi 5, 4 and 3.
We recommend the Raspberry Pi 4 2GB and higher for best performance and support.
We recommend the Raspberry Pi 4 2GB and higher for best performance and support.


Line 69: Line 70:


=Installation=
=Installation=
==Installing Rasbian OS==
==Installing Raspberry Pi OS==
At the moment we recommend Buster Lite - problems have been reported with later versions.  
We currently recommend Raspberry Pi OS Lite, Debian Version 12 (bookworm) and require a 64bit version for app versions 2.9.0 and newer.  


Download from [https://www.raspberrypi.org/downloads/raspbian/ download from the official site] and follow the instructions for burning to an SD card.  
Download from [https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit the official site] or use the [https://www.raspberrypi.com/software/ Raspberry Pi imager] and choose "Raspberry Pi OS (other)->Raspberry Pi OS Lite (64-bit)" for the operating system, following the instructions for burning to an SD card.  


Once you've created your image, boot up your Raspberry Pi and log in with the default username of 'pi' and password 'raspberry'.
Once you've created your image, boot up your Raspberry Pi and follow the prompts to set your keyboard language and create a username and password.


===Updating to latest packages===
You should now be able to login as that user and will be greeted with a command prompt like `user@raspberrypi:~ $`
It is always good form to update the latest packages after a fresh install. Enter this at the command line:
<pre>
sudo apt-get update
sudo apt-get dist-upgrade
</pre>
 
==Raspberry Pi support==
The RaceCapture app is compatible with Raspberry Pi 4 and 3.


===Wifi Setup===
Unless you are using a network cable you will need to setup Wifi before proceeding.  To do this you need to run the command `sudo raspi-config`,
this will bring up a window with several options.  To configure Wifi you will want to select `1 System Options` followed by `S1 Wireless LAN`.  It will ask you to select your Wifi country and set your network SSID and network password.


===Enable GPU driver===
===Timezone===
Enable Fake KMS under advanced boot options:
It is advisable to set the system's timezone before proceeding.  This is also accomplished by using raspi-config which is run with the command `sudo raspi-config`.  If you are also setting up Wifi you can configure your timezone at the same time you are configuring Wifi. 


<pre>
The timezone setting is configured in `5 Localization Options`->`L2 Timezone`.  This will allow you to set the timezone by first selecting your region and a major city in your timezone.  When done setting the timezone you can back out of raspi-config by hitting escape until you are back at the command prompt.
sudo raspi-config
</pre>


Go to Advanced Options -> GL Driver -> Select OpenGL desktop driver with fake KMS
===Checking your network===
 
At this point it is good to make sure your Raspberry Pi is connected to your network.  Without this none of the remaining steps will be successful.  
* Be sure to reboot after exiting raspi-config
 
==Installing dependencies==
===Activate ssh===
Ssh is used to store passwords used by the app. Steps to ensure it is running:


An easy way to check that you are connected to the network is to use the command `hostname -I`, this will print out the IP address of your
Raspberry Pi, or a blank line if you are not connected.
<pre>
<pre>
sudo raspi-config
user@raspberrypi:~ $ hostname -I
192.168.1.183 2601:601:d07f:c107:dfb6:823:b21d:6dff
</pre>
</pre>
Go under Interfacing Options or Advanced Options and start the ssh service.


Next, at the command prompt enter
===Updating to latest packages===
<pre>
It is always good form to update the latest packages after a fresh install. Enter this at the command line:
ssh-add
</pre>
to create at least one key.
 
===Install package dependencies===
<pre>
sudo apt-get install mesa-utils libgles2 libegl1-mesa libegl-mesa0
</pre>
===Change the default password===
For maximum security, change the password for the default user 'pi'
 
<pre>
> passwd
</pre>
 
and specify a new, secure password.
 
===Configure Raspberry Pi base settings===
====Enable Hardware rendering====
Enter the following line to enable hardware accelerated rendering.
<pre>
<pre>
> sudo adduser pi render
sudo apt update
sudo apt dist-upgrade
</pre>
</pre>
* '''Notes''':
** Without this setting, UI rendering will be extremely slow.
** Assumes RaceCapture is launched as pi. If not, replace pi with the user you are logging in as.
** If you're coming in to fix this after the fact, you'll need to reboot/re-login to take effect.


====Enable WiFi====
==RaceCapture App Installation==
If you want network capability in addition to the ethernet connection, [https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md enable and configure WiFi per the official documentation]
For those wanting an installation that automatically launches the dashboard upon login, we have developed
an installation script. The installation script allows for the selection of either running against the
framebuffer or X11, and helps in setting up standard Raspberry Pi configuration settings. As a bonus the installation
script also includes optional features such as Wifi auto reconnect, USB drive automounting and GPIO based shutdown
reboot support.


====(Optional) Enable SSH====
If you want a more custom installation, such as running in a full Desktop environment, manual instructions are also provided.
You can optionally enable SSH for remote management from the comfort of your main computer's keyboard and screen.  
===Via Installation Script===
From a command prompt simply run
<pre>sudo sh -c "curl -sL bit.ly/3yTbPyZ | bash"</pre>


[https://www.raspberrypi.org/documentation/remote-access/ssh/ Enable and configure ssh per the official documentation]
The installation script will setup the system configuration files so that screen blanking is disabled and GPU memory is set to 256MB.
 
It will then prompt with a series of questions and configuration options, allowing you to customize the installation.
====Install multi-touch tools====
====Configuration Options====
Install the packages that enable multi-touch interfaces.  Enter the following at the command line:
The installation script prompts for the following:
 
=====Auto Login=====
<pre>
* Whether to enable auto login upon startup, if not already enabled (Recommendation: Yes)
> sudo apt-get install mtdev-tools
** This allows the RPi to login as the current user and launch the RaceCapture App upon startup of your Raspberry Pi. Without this you will need to login every time your Raspberry Pi is powered up.
</pre>
=====RPi3 Official Display Support=====
* If running an RPi3, whether you are running an Official RPi display.
** Only select yes if you are using a RPi3 with an Official RPi display plugged into the LCD/MIPI connector on the board. Enabling this will disable HDMI support as the RPi3 doesn't appear to automatically detect LCD screens properly.
=====Installation Type=====
* Which type of installation you want, Framebuffer (traditional installation), or X11 which enables the option of VNC support
* If X11 was chosen:
** Whether to enable VNC and if so prompts for entering a VNC password
=====App Features=====
* Watchdog: Enables automatically restarting the RaceCapture App should it crash/exit unexpectedly
* Cursor: Enables a visual mouse pointer (Not recommended for touchscreens)
* Keyboard: Enables an onscreen virtual keyboard for touch screens
=====Extra Features=====
* Wifi Auto Reconnect: Enables a script that detects if your wifi connection is down and attempts to reconnect
* USB Automounting: Enables automatic mounting of USB thumbdrives under /media/usb#, useful for exporting session data or saving configs off the device
* GPIO Reboot/Shutdown: Enables the ability to add a button or switch between GPIO21 and a ground pin, with a short press causing a reboot and a long press causing a graceful shutdown


====Configure memory split====
====Post Configuration Steps====
You'll need to bump up the memory made available to the GPU. Increase the default value of 64 to '''256'''.
After you have selected your configuration options the installation script will proceed to download the latest RaceCapture App bundle from
[http://podium.live/software the Podium website], placing it in /opt. If the latest version is already present in /opt it will skip this step.


* '''Via raspi-config tool'''
Next it will unpack the App into /opt/racecapture, prompting you to overwrite and existing installation if one exists.
You can adjust the memory split by running the raspi-config tool. See the [https://www.raspberrypi.org/documentation/configuration/raspi-config.md official documentation]


* '''Editing /boot/config.txt'''
Finally, the script will modify some files, .bashrc and .xinitrc for X11 installations, so that the Race Capture app launches upon login.


You can adjust the value directly by editing the /boot/config.txt file.  
===Manual Installation===
If you choose to install the RaceCapture App manually it's assumed that you have an understanding of the different configuration and installation
options available for the Raspberry Pi.  Below is the minimal requirements to run the RaceCapture App via the Framebuffer.
If running in an X11/desktop environment the same instructions should be adequate for running the app in that environment also.


====Install package dependencies====
<pre>
<pre>
> sudo nano /boot/config.txt
sudo apt install mesa-utils libgles2 libegl1-mesa libegl-mesa0 mtdev-tools
</pre>
</pre>


Find the line containing gpu_mem=64 and change the number to 256
====User Permissions====
 
Ensure that the user is in the dialout, render, video and input groups.  It appears these are added by default but to be sure you should run:
<pre>
<pre>
gpu_mem=256
sudo adduser $USER render
sudo adduser $USER video
sudo adduser $USER input
sudo adduser $USER dialout
</pre>
</pre>


''Save the file by pressing '''ctrl-x''' then  press '''Y'''  to confirm.''
====Installing the RaceCapture app package====
 
==Installing the RaceCapture app package==


Download the latest [http://podium.live/software RaceCapture app package for Raspberry Pi] and place it in the /opt/ directory of the Raspberry Pi.
Download the latest [http://podium.live/software RaceCapture app package for Raspberry Pi] and place it in the /opt/ directory of the Raspberry Pi.
Line 186: Line 179:
</pre>
</pre>


===Extract the package===
=====Extract the package=====
Now extract the downloaded package :
Now extract the downloaded package :


Line 193: Line 186:
</pre>
</pre>


===Launch the app===
====Launch the app====
Launch the RaceCapture app by running the following command:
Launch the RaceCapture app by running the following command:


<pre>
<pre>
/opt/racecapture/run_racecapture.sh
/opt/racecapture/run_racecapture_rpi.sh
</pre>
</pre>


===Launching with Watchdog===
====Launching with Watchdog====
You can enable an automatic watchdog that re-launches the app in case a crash occurs.  
You can enable an automatic watchdog that re-launches the app in case a crash occurs.  


Line 215: Line 208:
</pre>
</pre>


===Enabling on screen keyboard===
====Enabling on screen keyboard====
If you don't have a wireless keyboard attached via usb, you can enable an on-screen keyboard.
If you don't have a wireless keyboard attached via usb, you can enable an on-screen keyboard.


Line 227: Line 220:
keyboard_mode = multi
keyboard_mode = multi


==Automatic start upon power up==
To get the full dedicated dashboard experience, you can enable automatic launch of the RaceCapture app upon power up.
To do this, edit the system's startup file:
<pre>
sudo nano /etc/rc.local
</pre>
and add the following line '''before the exit 0''' line.
<pre>
/opt/racecapture/boot_racecapture.sh pi
exit 0
</pre>
''Save the file by pressing '''ctrl-x''' then  press '''Y'''  to confirm.''


=Connecting to your RaceCapture system=
=Connecting to your RaceCapture system=
[[image:racecapture_raspberry_pi_connections.jpg|900px]]
[[image:racecapture_raspberry_pi_connections.jpg|900px]]
===Powering up===
===Powering up===
* Connect the power to your display and power up.
* Connect your RaceCapture/Pro or RaceCapture/Track to the Raspberry Pi using the USB cable.
* Connect your RaceCapture/Pro or RaceCapture/Track to the Raspberry Pi using the USB cable.   
* Connect the power to your display and power up.   


* Launch the RaceCapture app by running:
====Installed via Script====
 
If you installed via the setup script and enabled autologin, simply let it start upon power-up. 
<pre>
Without autologin you will need to first login as your default user.
/opt/racecapture/run_racecapture.sh
</pre>


If you have it set to launch automatically, simply let it start upon power-up.
====Manual Installation====
See [[#Launch_the_app]]


===Connection and usage===
===Connection and usage===

Latest revision as of 14:55, 21 February 2024

Introduction

We designed the RaceCapture app to run nearly anywhere - even a Raspberry Pi. And now, for about $100 you can create a hardwired, dedicated dash for your RaceCapture system.

Racecapture raspberry pi.jpg

Benefits

You get all of the benefits of a dedicated dash:

  • Automatically runs upon power up - you can configure the dash to automatically launch the RaceCapture App - just as you'd expect it to work.
  • Hard-wired data connection to RaceCapture - no wireless connections to configure, with the reliability of a direct wire.
  • Runs on the bare metal - The RaceCapture app runs without Android or iOS; there's no other apps competing for resources, or compromising system stability.
  • Overheating resistance - Your typical mobile device requires extra care in very hot weather to prevent damage to it's internal battery, and will shut down if overheated. With proper heat-sinking, the Raspberry Pi should handle the heat.

Compatibility

The RaceCapture app running on the Raspberry Pi is compatible with any hardware version of RaceCapture or PodiumConnect.

Racecapture raspberry pi backside.jpg

Experimental!

While the results are pretty great, these instructions are currently for those adventurous race car hackers who know their away around a command line, comfortable working with hardware and want to dig in. Think it's cool, but too much to tackle? Rope in your nearest computer/electronics geek - you need one on your race team, anyway. :) Or, just use the plug and play option and use an Android or iOS device via Bluetooth or WiFi.

Current status and future plans

Even though this is brand new and officially experimental in nature, we still made it as easy as reasonably possible: we wrapped up the RaceCapture App into as close to a self-running installer, that can run on a bone stock Raspberry Pi image - only a few changes are required to the default image, detailed below.

However, in the near future we will create a dedicated Raspberry Pi image that you can burn to an SD card and simply boot up, and move towards more official support as we iron out the issues.


Reporting issues and getting support

Chances are you'll encounter an issue you'll want to report. Before you do that, check the issue log to see if it's already known.

Otherwise - the best place for support, feedback and sharing success stories is on the forums . Drop us a note there so we can see the progress of your project!

Hardware Selection

Raspberry Pi

The RaceCapture app is compatible with Raspberry Pi 5, 4 and 3. We recommend the Raspberry Pi 4 2GB and higher for best performance and support.

Display

The RaceCapture app package is designed to recognize the following screens:


Other displays can work as well, and additional work may be needed to support the screen's touch controller. If unsure, just pick the Official Raspberry Pi display

Enclosure

A recommended enclosure is the Smart Pi Touch Case

You can 3D print a sun shade for this enclosure File:P001 Raspberry Pi Display Sun Shade.stl.zip (Courtesy of Michael Lee)

SmartPi touch case.jpg RaceCapture Sun shade 3dprinted preview.jpg

RaceCapture RaspberryPi sun shade dashboard.jpg

Installed on Dashboard

Power Supply

The Raspberry Pi dashboard requires its own power supply. You'll need a high quality 5v power supply with 2 amps minimum capacity; 3 amps is highly recommended, and ideally one with a low drop out voltage, so power is not cut to the Raspberry Pi when you're loading the main battery, such as when cranking the engine.

Suggested Power Supplies

Powering RaceCapture

After you have power to the Raspberry Pi dashboard, you may notice your RaceCapture device will be powered by the USB cable connected to the Pi, just as if you're powering RaceCapture from your laptop. You will still want to power your RaceCapture via 12v; see the respective installation guides for information on how to power your device.

Heat sinking

If you're running in hot weather, we recommend the standard Raspberry Pi heatsink kit to keep your system cool.

For Pi4 users, we recommend active fan cooling in addition to the heat sink.

Installation

Installing Raspberry Pi OS

We currently recommend Raspberry Pi OS Lite, Debian Version 12 (bookworm) and require a 64bit version for app versions 2.9.0 and newer.

Download from the official site or use the Raspberry Pi imager and choose "Raspberry Pi OS (other)->Raspberry Pi OS Lite (64-bit)" for the operating system, following the instructions for burning to an SD card.

Once you've created your image, boot up your Raspberry Pi and follow the prompts to set your keyboard language and create a username and password.

You should now be able to login as that user and will be greeted with a command prompt like `user@raspberrypi:~ $`

Wifi Setup

Unless you are using a network cable you will need to setup Wifi before proceeding. To do this you need to run the command `sudo raspi-config`, this will bring up a window with several options. To configure Wifi you will want to select `1 System Options` followed by `S1 Wireless LAN`. It will ask you to select your Wifi country and set your network SSID and network password.

Timezone

It is advisable to set the system's timezone before proceeding. This is also accomplished by using raspi-config which is run with the command `sudo raspi-config`. If you are also setting up Wifi you can configure your timezone at the same time you are configuring Wifi.

The timezone setting is configured in `5 Localization Options`->`L2 Timezone`. This will allow you to set the timezone by first selecting your region and a major city in your timezone. When done setting the timezone you can back out of raspi-config by hitting escape until you are back at the command prompt.

Checking your network

At this point it is good to make sure your Raspberry Pi is connected to your network. Without this none of the remaining steps will be successful.

An easy way to check that you are connected to the network is to use the command `hostname -I`, this will print out the IP address of your Raspberry Pi, or a blank line if you are not connected.

user@raspberrypi:~ $ hostname -I
192.168.1.183 2601:601:d07f:c107:dfb6:823:b21d:6dff

Updating to latest packages

It is always good form to update the latest packages after a fresh install. Enter this at the command line:

sudo apt update
sudo apt dist-upgrade

RaceCapture App Installation

For those wanting an installation that automatically launches the dashboard upon login, we have developed an installation script. The installation script allows for the selection of either running against the framebuffer or X11, and helps in setting up standard Raspberry Pi configuration settings. As a bonus the installation script also includes optional features such as Wifi auto reconnect, USB drive automounting and GPIO based shutdown reboot support.

If you want a more custom installation, such as running in a full Desktop environment, manual instructions are also provided.

Via Installation Script

From a command prompt simply run

sudo sh -c "curl -sL bit.ly/3yTbPyZ | bash"

The installation script will setup the system configuration files so that screen blanking is disabled and GPU memory is set to 256MB. It will then prompt with a series of questions and configuration options, allowing you to customize the installation.

Configuration Options

The installation script prompts for the following:

Auto Login
  • Whether to enable auto login upon startup, if not already enabled (Recommendation: Yes)
    • This allows the RPi to login as the current user and launch the RaceCapture App upon startup of your Raspberry Pi. Without this you will need to login every time your Raspberry Pi is powered up.
RPi3 Official Display Support
  • If running an RPi3, whether you are running an Official RPi display.
    • Only select yes if you are using a RPi3 with an Official RPi display plugged into the LCD/MIPI connector on the board. Enabling this will disable HDMI support as the RPi3 doesn't appear to automatically detect LCD screens properly.
Installation Type
  • Which type of installation you want, Framebuffer (traditional installation), or X11 which enables the option of VNC support
  • If X11 was chosen:
    • Whether to enable VNC and if so prompts for entering a VNC password
App Features
  • Watchdog: Enables automatically restarting the RaceCapture App should it crash/exit unexpectedly
  • Cursor: Enables a visual mouse pointer (Not recommended for touchscreens)
  • Keyboard: Enables an onscreen virtual keyboard for touch screens
Extra Features
  • Wifi Auto Reconnect: Enables a script that detects if your wifi connection is down and attempts to reconnect
  • USB Automounting: Enables automatic mounting of USB thumbdrives under /media/usb#, useful for exporting session data or saving configs off the device
  • GPIO Reboot/Shutdown: Enables the ability to add a button or switch between GPIO21 and a ground pin, with a short press causing a reboot and a long press causing a graceful shutdown

Post Configuration Steps

After you have selected your configuration options the installation script will proceed to download the latest RaceCapture App bundle from the Podium website, placing it in /opt. If the latest version is already present in /opt it will skip this step.

Next it will unpack the App into /opt/racecapture, prompting you to overwrite and existing installation if one exists.

Finally, the script will modify some files, .bashrc and .xinitrc for X11 installations, so that the Race Capture app launches upon login.

Manual Installation

If you choose to install the RaceCapture App manually it's assumed that you have an understanding of the different configuration and installation options available for the Raspberry Pi. Below is the minimal requirements to run the RaceCapture App via the Framebuffer. If running in an X11/desktop environment the same instructions should be adequate for running the app in that environment also.

Install package dependencies

sudo apt install mesa-utils libgles2 libegl1-mesa libegl-mesa0 mtdev-tools

User Permissions

Ensure that the user is in the dialout, render, video and input groups. It appears these are added by default but to be sure you should run:

sudo adduser $USER render
sudo adduser $USER video
sudo adduser $USER input
sudo adduser $USER dialout

Installing the RaceCapture app package

Download the latest RaceCapture app package for Raspberry Pi and place it in the /opt/ directory of the Raspberry Pi.

  • Directly downloading to the Raspberry Pi

You can download it directly by getting the URL of the package by right-clicking the download link and copying the URL to your clipboard. Then, use it in the command below:

cd /opt
sudo wget <package URL>
Extract the package

Now extract the downloaded package :

sudo tar -xjvf <downloaded file>

Launch the app

Launch the RaceCapture app by running the following command:

/opt/racecapture/run_racecapture_rpi.sh

Launching with Watchdog

You can enable an automatic watchdog that re-launches the app in case a crash occurs.

/opt/racecapture/run_racecapture.sh -w 1


  • Note: You can break out of the application by issuing Alt + PrntScn + k to the application.

You can further stop all racecapture processes by issuing the following command (e.g. via ssh)

killall -9 run_racecapture

Enabling on screen keyboard

If you don't have a wireless keyboard attached via usb, you can enable an on-screen keyboard.

Edit the kivy config.ini file with:

sudo nano ~/.kivy/config.ini

and update the keyboard_mode line with:

keyboard_mode = multi


Connecting to your RaceCapture system

Racecapture raspberry pi connections.jpg

Powering up

  • Connect your RaceCapture/Pro or RaceCapture/Track to the Raspberry Pi using the USB cable.
  • Connect the power to your display and power up.

Installed via Script

If you installed via the setup script and enabled autologin, simply let it start upon power-up. Without autologin you will need to first login as your default user.

Manual Installation

See #Launch_the_app

Connection and usage

Once the RaceCapture App is running, it will connect automatically over USB. You can use the app just as you would on Android or iOS.

Extra Features

Hardwire buttons

The RaceCapture app responds to keyboard commands for certain behaviors. You can use a USB keyboard - or a device that emulates keyboard commands - to control the RaceCapture App.

Currently there are keyboard commands for the following:

  • Navigating dashboard screens - Use the left and right arrow keys to switch between screens
  • Escaping from screens / menus - The Escape key can be used to exit out of screens and options, just like the 'back' button on Android.
  • Acknowledging alerts - Use the following keys to acknowledge alerts, including responding to pit-to-car alerts:
    • K : to indicate 'Yes' or 'OK'
    • N : to indicate 'No"


Additional Tips

See this link for additional tips on how to setup the Pi and speed up the boot times. This should be especially helpful for beginners.

https://wiki.autosportlabs.com/Raspberry_Pi_Tips

Logfiles for troubleshooting can be found at

/home/pi