Skip to content

Repository files navigation

LeTrack

LeTrack is a race tracking system that uses IR break beam sensors to detect lap events.

This project consist of 3 parts.

  • Dotnet Back end (api)
  • Svelte Front end (fe)
  • Hardware sensors (sensor)

UI Screenshots

home practice

Back End

Run Back End

# Start back end containers first
docker compose up -d
dotnet run

Front End

Run Front End

# Run back end first
pm dev

Assets

model

This consist of two parts. The front and the back. It has slots for all required components to go in.

3D Model Additional Parts

  • 6x M2 screws to fit the raspberry pi and the speaker.
  • 4x M3 Screws for the corners

Hardware / Sensor

This is a micropython project that needs the below components:

  • IR break beam sensors
  • Active Buzzer
  • Raspberry Pi Pico W

schematics

DEV Setup

  1. Install micropython on raspberry pi
  2. Setup virtual environment for python and install requirements
  3. Use rshell to do the rest
  4. Install packages using mip
  5. Create config.py based on example-config.py

Sensor

# Setup stubs
uv pip install micropython-rp2-rpi_pico_w-stubs --target ./typings

mpremote ls
mpremote version
# Insall mip module
mpremote mip install umqtt.simple

mpremote repl

# Copy single file
mpremote cp sensor/config.py :config.py

# Copy all files in sensor folder
mpremote cp -r sensor/. :

# Remove all files
mpremote rm -r :/

# run specific file in repl
exec(open('test.py').read())

Emulate Events From Bash

mqttui publish "event" '{ "Id": "'$(uuidgen)'", "TrackId": '$((RANDOM % 2 + 1))', "Timestamp": "'$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")'"}'

Post Race Todo

  • Do not split race between tracks. Make race all 4 tracks at the same time.
  • Fix the generate schedule to generate it that all players does track twice and in 25min intervals.
  • Make micro python delay for 3 seconds and limit the number of events.
  • Latest micro python
  • Additional micro python checks to prevent possible false triggers
  • Make cover around infrared light to try and limit false positives.
  • Do not display all the laps
  • Display the 4 players with their amount af laps and time with fastest time
  • After the race show summary of race like totals to all players
  • The valid and adjustment can remain but it should not be required
  • Get simpler and shorter intro sound
  • Make sure the race end sound always plays
  • Make sure to add the ip of main machine to cors settings by default so it can work from other laptops.
  • Update FE to latest shadcn
  • On races add filter on race status
  • Latest Orval

About

Lap times

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages