Skip to content

Latest commit

 

History

History
137 lines (92 loc) · 4.55 KB

File metadata and controls

137 lines (92 loc) · 4.55 KB

Table Manager STF

Requires:

Hardware:

  • Raspberry Pi
  • Camera (You can use every camera compatible with Raspberry Pi)
  • Gate sensor (It can be every sensor that can be recognized as a input)
  • Wires

Optional

Software:

Getting Started

Prepare hardware

Connect and setup camera

Firstly connect your camera with USB or through native camera module.

Then execute the following instructions on the command line to download and install the latest kernel, GPU firmware, and applications. You'll need an internet connection for this to work correctly.

sudo apt update
sudo apt full-upgrade

Now you need to enable camera support using the raspi-config program you will have used when you first set up your Raspberry Pi.

sudo raspi-config

Use the cursor keys to select and open Interfacing Options, and then select Camera and follow the prompt to enable the camera.

Upon exiting raspi-config, it will ask to reboot. The enable option will ensure that on reboot the correct GPU firmware will be running with the camera driver and tuning, and the GPU memory split is sufficient to allow the camera to acquire enough memory to run correctly.

To test that the system is installed and working, try the following command:

raspistill -v -o test.jpg

It should take the photo and save in your home directory under test.jpg

Connect LED lights and gate sensors

Note: GPIO for Raspberry Pi 4. It may differ on other devices.

Name GPIO Direction Required Recommended LED color
TABLE_MANAGER_LIGHT 23 out
GATE_A_LIGHT 21 out 🔴
GATE_B_LIGHT 25 out 🔴
MATCH_LIGHT 15 out 🟡
TABLE_LIGHT 13 out 🟢
GATE_A_SENSOR 2 in ❗️ -
GATE_B_SENSOR 14 in ❗ ️ -

*Custom GPIO

For custom pins go to Table manager GPIO configuration and Table GPIO configuration and set manually all GPIO.

Yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install --no-install-recommends yarn
yarn -v

NVM

To install nvm run the following curl command which will download and run the nvm installation script:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Close and reopen your terminal to start using nvm or run the following to use it now

$ export NVM_DIR="$HOME/.nvm"
 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
 [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

To ensure that nvm is properly installed type:

$ nvm -v

Install required node version

$ nvm install 12

Runs Table Manger on Raspberry Boot with crontab

In raspberry console type crontab with -e flag to edit crontab configuration file

crontab -e

On the end of the file (after comments), add this line:

If you want your command to be run in the background while the Raspberry Pi continues starting up, add a space and & at the end of the line

@reboot cd /home/pi/smart-table-football/packages/table-manager && yarn start &

After previous step table manager will be launched in background on every raspberry reboot.