Close

Building the Backbone: Our Server & Network Infrastructure

A project log for MatAir - A Robotic Spherical Chessboard

A spherical chessboard where a robotic arm plays moves from an online game.

nasserNasser 02/26/2025 at 02:230 Comments

The goal is to let people across the country play against each other on separate boards. To make this work, we built a server-client infrastructure. The server relays requests between the clients, which include both the game and the ESP32.

We mapped out how the game, server, and ESP32 interact and made a diagram to show the communication flow:

Our system uses a server client architecture built on WebSockets. It has three main parts:

How It Works

Player Connection Players enter an ORB code to link to a specific board. If a game is already running, they can continue or end it. If not, they start a new one.

Move Execution

  1. A player makes a move.
  2. The game sends a request to the server.
  3. The server checks if the board is ready and validates the move.
  4. If valid, the server updates all players and sends the command to the physical board.

This infrastructure took over 4000 lines of code. Once finished, we had a working online game with real time data flowing between the web client, server, and ESP32.

Code of the game can be found here : Github link

Code of the server can be found here : Github link

Code of the esp32 can be found here : Github link

Discussions