Skip to content

Kambolo/RoboShot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

RoboShot

An IoT-powered automated liquid dispenser controlled via a web interface. A Spring Boot server communicates in real-time with an ESP32 microcontroller over WebSocket - select your volume, hit Pour, and RoboShot does the rest.


Preview

image

🏗️ Architecture

Browser  ──HTTP──▶  Spring Boot Server (MVC + Thymeleaf)
                          │
                       WebSocket
                          │
                       ESP32 (PlatformIO)
                          │
                        Pump
  • The server serves a Thymeleaf web page and manages the WebSocket connection with the ESP32.
  • The ESP32 connects to the server over WebSocket, listens for pour commands, and controls the pump.

✨ Features

  • 🟢 Live ESP32 connection status indicator
  • 🧪 Adjustable pour volume (ml)
  • 🚰 One-click pour via WebSocket command
  • 📡 Real-time bidirectional communication (no polling)

🗂️ Project Structure

RoboShot/
├── RoboShot-server/                  # Spring Boot application
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/
│   │   │   │   └── ...      # Controllers, WebSocket config
│   │   │   └── resources/
│   │   │       └── templates/
│   │   │           └── index.html   # Thymeleaf template
│   └── pom.xml
│
└── RoboShot-esp/                     # ESP32 firmware (PlatformIO)
    ├── src/
    │   └── main.cpp
    ├── include/
    │   ├── secrets.h        # WiFi credentials (not committed)
    │   └── secrets.example.h
    └── platformio.ini

🖥️ Server

Built with Java + Spring Boot using the MVC pattern. Serves the frontend via Thymeleaf templates and manages a WebSocket endpoint that the ESP32 connects to.

Requirements

  • Java 17+
  • Maven

Run

cd RoboShot-server
mvn clean install
mvn spring-boot:run

The server will be available at http://localhost:8080.


🔌 ESP32 Firmware

Written in C++ using the PlatformIO environment. The ESP32 connects to your WiFi network, establishes a WebSocket connection to the server, and waits for pour commands.

Requirements

  • PlatformIO (VS Code extension or CLI)
  • ESP32 board

WiFi Configuration

Copy secrets.example.h to secrets.h and fill in your credentials:

cp RoboShot-esp/include/secrets.example.h RoboShot-esp/include/secrets.h
// secrets.h
const char* ssid     = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

⚠️ secrets.h is listed in .gitignore and will never be committed.

Flash

cd RoboShot-esp
pio run --target upload

📡 WebSocket Communication

Once the ESP32 connects, the server marks it as online and the pour button becomes available.

When the user selects a volume and clicks Pour, the server sends a WebSocket message to the ESP32:

{ "command": "pour", "volume": 50 }

The ESP32 runs the pump for the calculated duration and optionally sends a confirmation back.


🚀 Getting Started

  1. Clone the repository:
git clone https://github.com/Kambolo/RoboShot.git
cd RoboShot
  1. Set up WiFi credentials in RoboShot-esp/include/secrets.h

  2. Start the server:

cd RoboShot-server && mvn spring-boot:run
  1. Flash the ESP32:
cd RoboShot-esp && pio run --target upload
  1. Open http://localhost:8080 in your browser — if the ESP32 is online, you're ready to pour 🥃

👤 Author

Kamil Bołoz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors