Raspberry Pi Tips: Difference between revisions
(41 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
=Tweak the Pi’s config to make it startup and run faster= | =Tweak the Pi’s config to make it startup and run faster= | ||
*Open the console based raspi-config application: | |||
<pre>sudo raspi-config</pre> | <pre>sudo raspi-config</pre> | ||
*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. | *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. | ||
Line 35: | Line 6: | ||
*Choose Desktop/CLI as Pi | *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 | **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 | *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 | **Choose I1 Change Locale | ||
**Uncheck en_GB.UTF-8 UTF-8 by hitting the spacebar | **Uncheck en_GB.UTF-8 UTF-8 by hitting the spacebar | ||
Line 52: | Line 23: | ||
*When the Pi reboots you should now be auto logged in as user "Pi" and have a blinking command line prompt | *When the Pi reboots you should now be auto logged in as user "Pi" and have a blinking command line prompt | ||
<pre>sudo nano /boot/cmdline.txt</pre> | <pre>sudo nano /boot/cmdline.txt</pre> | ||
*Inside this file, | *Inside this file, append the following to the end of the line: | ||
<pre>quiet splash loglevel=0 logo.nologo</pre> | <pre>quiet splash loglevel=0 logo.nologo</pre> | ||
*Save the file by pressing Ctrl + X, type Y, and hit enter | *Save the file by pressing Ctrl + X, type Y, and hit enter | ||
Line 75: | Line 45: | ||
=Change keyboard to US= | =Change keyboard to US= | ||
<pre>sudo nano /etc/default/keyboard</pre> | <pre>sudo nano /etc/default/keyboard</pre> | ||
Change XKBLAYOUT from “gb” to “us” | *Change XKBLAYOUT from “gb” to “us” | ||
Save the file by pressing Ctrl + X, type Y, and hit enter | *Save the file by pressing Ctrl + X, type Y, and hit enter | ||
=Installing the RaceCapture App= | =Installing the RaceCapture App= | ||
Change to the /opt directory to install the RaceCapture app | *Change to the /opt directory to install the RaceCapture app | ||
<pre>cd /opt</pre> | <pre>cd /opt</pre> | ||
Download the RaceCapture app. Update the URL below for the version that you want. This is the latest version as of 2019-07-08. | *Download the RaceCapture app. Update the URL below for the version that you want. This is the latest version as of 2019-07-08. | ||
<pre>sudo wget https://autosportlabs-software.s3-us-west-2.amazonaws.com/racecapture_linux_raspberrypi_1.16.0.tar.bz2</pre> | <pre>sudo wget https://autosportlabs-software.s3-us-west-2.amazonaws.com/racecapture_linux_raspberrypi_1.16.0.tar.bz2</pre> | ||
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. | *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. | ||
<pre>sudo tar -xjvf race...</pre> | <pre>sudo tar -xjvf race...</pre> | ||
Line 108: | Line 78: | ||
=Set up for DFRobot display= | =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: | *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: | ||
** | **[https://bit.ly/2YwRkrj DFRobot Instructions] | ||
<pre>sudo nano /boot/config.txt</pre> | <pre>sudo nano /boot/config.txt</pre> | ||
*Uncomment this line: | *Uncomment this line: | ||
Line 119: | Line 89: | ||
hdmi_mode=87 | hdmi_mode=87 | ||
</pre> | </pre> | ||
*Save the file by pressing Ctrl + X, type Y, and hit enter. | |||
<pre> | <pre> | ||
Cd /opt/racecapture/ | Cd /opt/racecapture/ | ||
Sudo nano run_racecapture.sh | Sudo nano run_racecapture.sh | ||
</pre> | </pre> | ||
*Comment out both checks for "check for ar1100 resistive touch" and "check for ft5406 capacitive touch" | *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: | *Change kivy settings: | ||
<pre>Sudo nano /home/pi/.kivy/config.ini</pre> | <pre>Sudo nano /home/pi/.kivy/config.ini</pre> | ||
Line 134: | Line 105: | ||
#%(name)s = probesysfs,provider=hidinput | #%(name)s = probesysfs,provider=hidinput | ||
</pre> | </pre> | ||
*Save the file by pressing Ctrl + X, type Y, and hit enter. | |||
=General Notes and Commands= | =General Notes and Commands= | ||
===Run Racecapture manually=== | ===Run Racecapture manually=== | ||
*If you don't set it up to run automatically, you'll have to use this command to run it manually. | |||
<pre>/opt/racecapture/run_racecapture.sh</pre> | <pre>/opt/racecapture/run_racecapture.sh</pre> | ||
===Make cursor visible=== | ===Make cursor visible=== | ||
This may cause lag in dashboard so not recommended except for setup | *This may cause lag in the dashboard so it's not recommended except for setup if you elect to use a mouse | ||
<pre>Sudo nano /home/pi/.kivy/config.ini</pre> | <pre>Sudo nano /home/pi/.kivy/config.ini</pre> | ||
*Add this to the modules ection | *Add this to the modules ection | ||
Line 149: | Line 122: | ||
*Depending on how you have this setup, it may be tricky. This method usually works best for when you have RaceCapture auto-boot. | *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 | **Alt + PrintScreen + K , followed by exiting the app via touch screen | ||
To kill the watchdog loop until the next restart, you can use the following command: | |||
<pre> killall -9 run_racecapture.sh</pre> | |||
===Manually shutdown pi=== | ===Manually shutdown pi=== | ||
<pre>Sudo Shutdown -h now</pre> | <pre>Sudo Shutdown -h now</pre> | ||
===Manually restart PI=== | |||
<pre> sudo reboot</pre> | |||
===Rotate screen 180*=== | ===Rotate screen 180*=== | ||
*This just rotates display, not touch | *This just rotates the display, but does not rotate the touch settings | ||
<pre>sudo nano /boot/config.txt</pre> | <pre>sudo nano /boot/config.txt</pre> | ||
*Add this line | *Add this line (if HDMI) | ||
<pre>display_rotate=2</pre> | <pre>display_rotate=2</pre> | ||
*Add this line (if Official LCD screen) | |||
<pre>lcd_rotate=2</pre> | |||
*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 | ||
<pre>Sudo nano /home/pi/.kivy/config.ini</pre> | <pre>Sudo nano /home/pi/.kivy/config.ini</pre> | ||
*Modify this line: | *Modify this line: | ||
<pre>mtdev_%(name)s = probesysfs,provider=mtdev,param=rotation=180</pre> | <pre>mtdev_%(name)s = probesysfs,provider=mtdev,param=rotation=180</pre> | ||
*Save the file by pressing Ctrl + X, type Y, and hit enter. | |||
===Transfer RaceCapture from Pi to another device (or vice versa)=== | ===Transfer RaceCapture from Pi to another device (or vice versa)=== | ||
*https://www.raspberrypi-spy.co.uk/2014/05/how-to-mount-a-usb-flash-disk-on-the-raspberry-pi/ | *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. | ||
**https://www.raspberrypi-spy.co.uk/2014/05/how-to-mount-a-usb-flash-disk-on-the-raspberry-pi/ |
Latest revision as of 04:34, 9 November 2021
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.
- Here is the link. Follow the instructions for Raspbian distributions (or just follow the instructions below).
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
To kill the watchdog loop until the next restart, you can use the following command:
killall -9 run_racecapture.sh
Manually shutdown pi
Sudo Shutdown -h now
Manually restart PI
sudo reboot
Rotate screen 180*
- This just rotates the display, but does not rotate the touch settings
sudo nano /boot/config.txt
- Add this line (if HDMI)
display_rotate=2
- Add this line (if Official LCD screen)
lcd_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.