This is a guide for running the car's dashboard on the Raspberry Pi. It's written so anyone on the team can do it, even if you've never used a Pi or written any code. If I'm not around and something breaks, this should cover most of what you need.
The dashboard is what shows up on the car's screen. It displays:
- Speed, throttle, and brake pressure
- Battery voltage, current, and temperature
- Tire temperatures and tire pressure
- Pit mode, charging, and balancing status
The Pi reads live data coming in from the car's electronics over a wire (UART) and updates the screen roughly a thousand times a second. It's a Python program built with a library called PySide6.
The Pi is configured to start the dashboard automatically when it boots. Most of the time this is all you have to do:
- Plug the Pi into power.
- Wait about 30 seconds.
- The dashboard should come up fullscreen.
If numbers are moving on the screen, you're good.
If the dashboard didn't come up on its own, you'll need to start it yourself.
If the dashboard is frozen or stuck on a black screen, press Ctrl + Q to close it first. Then click the terminal icon at the top of the screen (the one that looks like >_). If you're already looking at a text screen, you're in a terminal, just keep going.
cd /home/mcgillformulaelectric/Raspberry-Pi-Dashboardsource venv/bin/activateYou should see (venv) appear at the start of the line. That means it worked.
Important: the dashboard has to be started with main.py. Don't try to run any other Python file in this project, it won't work.
python main.pyThe screen should come up fullscreen within a few seconds.
All three steps above are bundled into a script. If you just want the thing to run:
bash /home/mcgillformulaelectric/Raspberry-Pi-Dashboard/config_scripts/run_app.shWhen I push new code to GitHub, you'll need to pull it down onto the Pi. For whatever reason, the Pi almost always complains about merge conflicts or local changes when you try to pull normally. Don't worry about it. Just throw away whatever is on the Pi and take what's on GitHub.
Same as before. Close the dashboard with Ctrl + Q if it's running.
Copy each line, paste it in, hit Enter. Just trust it.
cd /home/mcgillformulaelectric/Raspberry-Pi-Dashboardgit fetch origingit reset --hard origin/maingit clean -fdWhat those do, in plain English:
cdgoes to the project folder.git fetch origingrabs the latest code from GitHub but doesn't change anything yet.git reset --hard origin/mainwipes out any local changes on the Pi and overwrites everything with the GitHub version. This is the "accept all incoming changes" button.git clean -fddeletes any extra files lying around that aren't supposed to be there.
Either run it again:
bash /home/mcgillformulaelectric/Raspberry-Pi-Dashboard/config_scripts/run_app.shOr just reboot and let it auto-start:
sudo rebootUse the credentials I gave you. If you don't have any, call me, I'll need to log you in once and then it'll remember.
Here's the same four commands chained into one line. Paste it and it'll reset everything no matter what state the Pi is in:
cd /home/mcgillformulaelectric/Raspberry-Pi-Dashboard && git fetch origin && git reset --hard origin/main && git clean -fdThese work while the dashboard is running:
| Keys | What it does |
|---|---|
Ctrl + K |
Next page |
Ctrl + J |
Previous page |
Ctrl + F |
Toggle fullscreen |
Ctrl + M |
Minimize window |
Ctrl + Q |
Quit the dashboard |
The mouse cursor is hidden on purpose, that's not a bug.
- Give it 30 to 60 seconds, it sometimes takes a moment.
- Check that the Pi is actually on (red light on the Pi board).
- Make sure the screen cable is seated properly at both ends.
- Unplug the Pi, wait 10 seconds, plug it back in.
The virtual environment isn't active. Go back to step 3 in the manual run section:
cd /home/mcgillformulaelectric/Raspberry-Pi-Dashboard
source venv/bin/activate
python main.pyThe dashboard is running fine, it's just not getting any data from the car. Usually one of:
- The car's electronics aren't powered on.
- The UART wire between the Pi and the car popped off.
- The yellow and orange wires going into the Pi's GPIO pins aren't seated properly.
- The car's main power switch is off.
If the wires all look fine and the car is on, try the UART setup step below.
The Pi's serial port needs to be set up. Run this once:
sudo bash /home/mcgillformulaelectric/Raspberry-Pi-Dashboard/config_scripts/pi_config.shThen reboot:
sudo rebootAfter it comes back up the dashboard should start on its own. If not, run it manually.
- Press
Ctrl + Qto quit. If it doesn't respond, unplug the Pi, wait 10 seconds, plug it back in. - Once you're back at a terminal, run it manually.
- If it keeps crashing in the same spot, take a photo of the error on screen and send it to me.
Put sudo in front of the command:
sudo python main.pyProbably a loose wire or unplugged sensor on the car side. The dashboard itself is fine, go check the car.
If nothing above worked, try these in order:
- Reboot the Pi. Unplug, wait 10 seconds, plug back in.
- Run
main.pymanually using the steps above. - Re-run the setup script and reboot:
sudo bash /home/mcgillformulaelectric/Raspberry-Pi-Dashboard/config_scripts/pi_config.sh sudo reboot
- Call me. Take a photo of any error text on the screen before calling, it saves a lot of time.
You don't need to touch any of this, but if you're curious:
main.pyis the file you run. Always start here.dashboard/is the brain of the dashboard (screen logic and UART reading).widgets/has individual screen elements like blinking lights.untitled/mainwindow.uiis the visual design of the screen.config_scripts/has the Pi setup scripts (pi_config.sh,run_app.sh).images/holds logos and static pictures.test/is for me, safe to ignore.
Always start the program with main.py. Not any other file. If you only remember one thing from this, remember that.