Skip to content

ProjectKitchen/WuzzlerFinal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wuzzler for FHTW Mensa

The Smart Wuzzler is an augmented Tabletop-Soccer Game for the student restaurant of the University of Applied Sciences Technikum Wien. It features automatic goal counts, game session management via smart phone user login, audio-visual feedback of game progress and a high score list. Users can register and login via smartphone - the game logic runs on a RaspberryPi4 which also provides a WiFi Hotspot.

Credits

This project is based upon the work by Alexander Peters who had the initial idea and made the first implementation in 2017, and Ferdinand Unger who ported the project to a recent version of node.js and Angular.js.

Architecture and tools

The Tabletop-Soccer game implementation consists of 3 parts, which are built using node.js (Version 12.13.1). The backend (server) connects to a Postgres database to store user and game session data. The graphical frontends (client and display) use and Angular CLI version 8.2.2.

  • The Backend: connects to the database and to the low level hardware (via Cylon/Firmata, expects an Arduino with Firmata firmware running at port /dev/ttyACM0). The GPIO pin connections for goal detection and pushbuttons can be found in file "robot.js". The backend detects goals and user interaction and updates the game state for client and display accordingly. It also generates soccer arena sounds to indicate game events (game start, goal, revoked goal, game won).
  • The Client: offers a responsive user interface in the web browser in order to create a new user, login, as well as challenge your friends into a 1 vs. 1 at tabletop soccer. The available players are displayed and can be challenged.
  • The Display: shows the progress of ongoing games and the high score list on a TV that is mounted behind the soccer table.

Useful scripts (start chromium in kiosk mode, activate/deactivate hotspot, iptables for routing traffic) can be found in subfolder scripts

Installation and build procedure

  1. Clone the git repository

  2. Navigate to "client" folder and run "npm install" in terminal

  3. Navigate to "display" folder and run "npm install" in terminal

  4. Navigate to "backend" folder and run "npm install" in terminal

  5. Create the database

  • Download and install the newest version of PostgreSQL.

  • Run following commands to create the database user and the wuzzler_db database, using the postgres tool:

    sudo su postgres  
    createuser pi -P -s  (then input and confirm password 'raspberry')  
    createdb wuzzler_db  
    psql wuzzler_db -f wuzzler_db_9.1.sql  
    
  • exit the postgres tool

  • Optional: you can use the pgAdmin tool to graphically manage the database (see e.g. [here] (https://www.guru99.com/postgresql-create-database.html) for details)

  1. Open the file "db.js" with a text editor. In line 8: Verify if user account/password match the credentials you chose in step 5.

  2. Navigate to "client" folder and run "npm run dev" in terminal to start the server. All three apps will start automatically. Client and display should open in a webbrowser and the backend should connect to Arduino and database. (Alternatively: start the backend via node app.js)

IP, ports and connections

The client content is served from http://localhost:4200/, multiple clients can connect to this port in order to show the user frontend. The display is served from http://localhost:4220/, it is shown in fullscreen (kiosk) mode by the RaspberryPi which also runs the backend. The backend listens on port 4444, where a websocket is used for communication to clients and display.

HDMI-CEC to control TV via HDMI

sudo apt install cec-utils

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 44.7%
  • JavaScript 34.1%
  • HTML 10.9%
  • SCSS 6.7%
  • Shell 3.0%
  • CSS 0.6%