Automatically launch an FTC Live field timer display on a Raspberry Pi.
It may seem silly, but manually walking over and plugging in a keyboard/mouse to a Raspberry Pi in order to set up a field timer display is a hassle. We have better things to do during setup. So for the handful of people in the world that use a Raspberry Pi as their field timers for FIRST Tech Challenge competitions, here's a solution.
This repository comes with a few assumptions:
- You use a Raspberry Pi as a field timer
- You have a consistent IP address for your FTC Live scoring computer
- You know ahead of time which field (1 or 2) the Pi will be on
- Your Pi automatically logs in to a default user named
pi
Given all of this, you can run setup.sh to get all of the files arranged correctly.
(Change all mentions of the path /home/pi if your user is named differently.)
The setup script installs a program and two files:
xdotool, a program for emulating mouse clicks (to enable audio for the game sounds)/home/pi/ftc-scoring-display.py, the script that does the actual work. Note: There are required changes in this file!/home/pi/.config/autostart/ftc-scoring-display.desktop, the configuration that runs the script once the user logs in.
By their powers combined, Chromium will start automatically on login and show a field display for the currently-active event in FTC Live.
Be sure to change the SCORING_ADDRESS and FIELD_NUMBER constants at the top of the python script.
Happy hosting!
FIRST® and FIRST Tech Challenge (formerly also known as FTC®) are trademarks of For Inspiration and Recognition of Science and Technology (FIRST). This project is not affiliated with FIRST and FIRST provides no warranty or support.