https://github.com/skorbut/trackday
Small app to be deployed on a Raspberry Pi to display race information of a carrera digital slot car track
https://github.com/skorbut/trackday
carrera flask python
Last synced: 5 months ago
JSON representation
Small app to be deployed on a Raspberry Pi to display race information of a carrera digital slot car track
- Host: GitHub
- URL: https://github.com/skorbut/trackday
- Owner: skorbut
- Created: 2018-12-29T16:34:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-16T17:55:27.000Z (almost 4 years ago)
- Last Synced: 2023-05-19T16:05:17.065Z (about 3 years ago)
- Topics: carrera, flask, python
- Language: Python
- Homepage:
- Size: 8.87 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# trackday
A small race monitor for carrera digital.
## Setup
Trackday uses a SQLite database to store race and driver data. Initialize/reset the database via:
```sh
. ./venv/bin/activate
rm app.db
rm -rf migrations
flask db init
flask db migrate
flask db upgrade
flask seed
```
Run the server locally via virtualenv
```sh
. ./venv/bin/activate
flask run
```
Point your browser at http://127.0.0.1:5000 to access the app
### Localization
Wrap all strings to be localized in `_l()` calls. For templates use: `{{ _() }}`
Initialize babel via `pybabel extract -F babel.cfg -k _l -o messages.pot .`. Generate the german language catalog via `pybabel init -i messages.pot -d app/translations -l de`. Compile the language files via `pybabel compile -d app/translations`.
To update the translation do `pybabel extract -F babel.cfg -k _l -o messages.pot .` to collect new translation, update the language files via `pybabel update -i messages.pot -d app/translations`. After that you need to recompile using `pybabel compile -d app/translations`.
### USB Serial Connection on Mac
You can check via `ioreg -c IOSerialBSDClient | grep usb` where the serial connection is available.
### Update the raspberrypi
- connect to raspberrypi via the deploy user using `ssh deploy@raspberrypi`
- change to trackday directory and pull the latest changes from git
- restart the server via `sudo supervisorctl restart trackday`
## Changes
### 20210524
Small changes for season handling
### 20201111
Update to python 3.9, restructure the code handling track communication and race management.
Add result pages for race types.
### 20200209 - new driver cockpit
Get rid of the digit display for fuel levels - integrate gauge.js to display fuel levels
Calculate sleep time for cu request thread based on current track status
### 20190915 - denormalize Laps
In order to fetch racer and car based statistics the lap information must be denormalized:
```
flask shell
for r in Race.query.all():
r.denormalize_laps()
```