π΅π± Polish version
ποΈ Project period: 2024β2025
π₯ Live demo: for the project presentation the system was deployed to Azure App Service and fully working β an authenticated dashboard with live depth-map streaming from the robot (it is no longer hosted). See it running with the physical robot in the demo video.
SmartBotAPI is a full-stack robotics platform that connects an ESP32-C3βbased mobile robot to a real-time web dashboard. The robot streams live telemetry β an 8Γ8 time-of-flight depth map, 6-axis IMU data, and temperature β over a secure WebSocket/SignalR channel, while operators drive it remotely with an on-screen joystick or keyboard. Measurements are persisted to SQL Server and visualized as live heatmaps, interpolated depth matrices, and historical charts.
- System Overview
- Screenshots
- Demo
- Features
- Tech Stack
- Repository Structure
- Quick Start
- Documentation
- Deployment
- Contributing & Security
- License
- Authors
flowchart LR
subgraph Robot["π€ SmartBot (ESP32-C3)"]
SENS["VL53L5CX 8Γ8 ToF<br/>MPU6050 IMU"] -->|"I2C"| MCU["ESP32-C3"]
MCU -->|"PWM"| MOT["TB6612FNG<br/>motors"]
end
subgraph Server["βοΈ ASP.NET Core 8"]
HUB["SignalR Hub<br/>/signalhub"]
HUB --> VIEW["Heatmap + 32Γ32 matrix"]
HUB --> DATA["Telemetry service"] --> DB[("SQL Server")]
end
UI["π₯οΈ Authenticated Blazor dashboard<br/>control β’ depth β’ history"]
MCU <-->|"WSS / SignalR"| HUB
HUB <-->|"live data + control"| UI
Data flow in one sentence: the robot samples its sensors at 15 Hz, pushes ReceiveRobotData invocations to the hub, which stores the measurements, renders the raw 8Γ8 depth frame into a heatmap and a 32Γ32 interpolated matrix, and broadcasts everything to connected dashboards β while movement commands travel the opposite way as ReceiveRobotCommand with PWM values for both motors.
The depth visualizations in both live-view screenshots are based on a ToF frame captured during a real system test; Live View Matrix presents the frame in the application's 32Γ32 grid. During operation, both views are updated with live SignalR data from the robot.
The physical tracked robot used during development and corridor driving tests:
The robot uses a custom carrier PCB for the controller, motor-driver module, sensor connectors, power switch, and battery connection. A PDF export of the KiCad circuit schematic is available as docs/schemat.pdf.
A short local driving-test montage and a recorded live presentation of the complete system (Department of Computer Science, Akademia Tarnowska):
- βΆ Watch the driving-test montage (78 s, with music)
- βΆ Watch the full presentation on Facebook
Music: βNew Directionβ β Kevin MacLeod, CC BY 4.0. See THIRD_PARTY_NOTICES.md for source and modification details.
- Real-time remote control β virtual joystick (pointer events) and keyboard (arrow keys) input, mapped to dual-motor PWM commands in the
-255β¦+255range, with dual speedometer gauges for feedback. - Live depth vision β the 8Γ8 VL53L5CX depth frame is rendered server-side into a color heatmap (PNG, base64) and a bilinearly interpolated 32Γ32 grid, streamed to the browser as it arrives.
- Telemetry dashboard β historical line charts (temperature, average distance, 3-axis acceleration, 3-axis rotation) with a date-range picker, backed by SQL Server.
- Safety built into firmware β automatic motor stop after 700 ms without a command, minimum-distance guard (400 mm), and automatic WebSocket reconnection every 5 s.
- Multi-network firmware β the robot tries up to three configured Wi-Fi networks and supports TLS/WSS when connecting to the server address configured in
config.h. - Authenticated control plane β dashboard pages and browser hub connections require ASP.NET Core Identity; the robot authenticates to the same hub with a separate API key.
- Cloud-ready β a Dockerfile and .NET container metadata (
kamilr616/smartbotblazorapp), plus a GitHub Actions pipeline that builds, tests, and publishes a deployable artifact.
One proportional joystick combines throttle and steering, allowing straight driving, smooth arcs, and rotation around the robot's own axis. Arrow keys provide an alternative control method, while two speedometer gauges show the motor PWM commands. See the motion-control documentation for the mixing equations, dead zones, timing, key mapping, and safety behavior.
| Layer | Technology |
|---|---|
| Web framework | ASP.NET Core 8.0, Blazor (Interactive Server + WebAssembly hybrid) |
| UI components | MudBlazor 7, Bootstrap 5 |
| Real-time transport | SignalR (JSON protocol) over WebSocket/TLS |
| Data | Entity Framework Core 9, SQL Server (LocalDB in development) |
| Image processing | SixLabors.ImageSharp (heatmap rendering, bilinear interpolation) |
| Identity | ASP.NET Core Identity |
| Firmware | Arduino framework on ESP32-C3 (Arduino IDE 2.x) |
| Firmware libraries | ArduinoJson, SparkFun VL53L5CX, Adafruit MPU6050, WebSockets (Markus Sattler) |
| Hardware | ESP32-C3 DevKitM-1, VL53L5CX ToF sensor, MPU6050 IMU, TB6612FNG motor driver, NeoPixel status LED |
| DevOps | Docker, GitHub Actions, Azure App Service (presentation deployment) |
SmartBotAPI/
βββ src/
β βββ server/
β β βββ SmartBotBlazorApp/ # ASP.NET Core host: SignalR hub, EF Core, Identity, server pages
β β β βββ Hubs/SignalHub.cs # Real-time hub (/signalhub)
β β β βββ ImageProcessor.cs # Heatmap generation & matrix interpolation
β β β βββ Data/ # DbContext, Measurement entity, MeasurementService, migrations
β β β βββ Components/Pages/ # Heatmap, matrix, charts, weather pages
β β βββ SmartBotBlazorApp.Client/ # Blazor WebAssembly client
β β βββ Pages/Chat.razor # SignalR text diagnostics page
β βββ arduino/
β βββ sketch_robot_signalr/ # ESP32-C3 firmware (main sketch + config.h)
βββ docs/ # Project documentation, schematic, and hardware references
βββ other/ # Media and archived project material
β βββ media/ # README screenshots, photos, and demo video
β βββ ... # Legacy sketches, PlatformIO project, Azure templates
βββ LICENSE # GNU GPL v3.0
βββ SECURITY.md # Vulnerability reporting policy
βββ THIRD_PARTY_NOTICES.md # Separately licensed third-party material
Prerequisites: .NET SDK 10.0 (the application targets .NET 8), SQL Server LocalDB on Windows (installed with Visual Studio) or any reachable SQL Server instance.
cd src/server/SmartBotBlazorApp
$env:RobotApiKey = "replace-with-a-url-safe-random-key-of-at-least-32-characters"
dotnet restore
dotnet run --launch-profile httpsThe app applies EF Core migrations automatically on startup and listens on:
https://localhost:7297http://localhost:5221
The https launch profile uses the Development environment, where account registration and the local self-confirmation link are enabled. Create a dashboard account at https://localhost:7297/Account/Register, then sign in. Both options are disabled by default outside Development; configure AccountAccess explicitly and use a real email sender for a public deployment.
To run the automated tests from the repository root:
dotnet test src/server/SmartBotBlazorApp.slnTo use a different database, set the SmartBotDBConnectionString environment variable β it takes precedence over ConnectionStrings:DefaultConnection in appsettings.json.
Docker:
docker build -t smartbotblazorapp -f src/server/SmartBotBlazorApp/Dockerfile .
docker run -p 8080:8080 \
-e SmartBotDBConnectionString="<your-connection-string>" \
-e RobotApiKey="<same-long-random-key-as-the-firmware>" \
smartbotblazorappThe container serves plain HTTP on port 8080 unless you explicitly mount and configure an HTTPS certificate. Registration remains disabled in the default production configuration.
Prerequisites: Arduino IDE 2.x with the ESP32 board package; an ESP32-C3 DevKitM-1 wired per the schematic in docs/schemat.pdf.
-
Copy
arduino_secrets.example.htoarduino_secrets.hand set the robot API key plus Wi-Fi credentials:#define SECRET_API_KEY "same-url-safe-random-key-as-the-server" #define SECRET_SSID "your-wifi" #define SECRET_PASS "your-password" #define SECRET_SSID2 "fallback-wifi" #define SECRET_PASS2 "fallback-password" #define SECRET_SSID3 "third-wifi" #define SECRET_PASS3 "third-password"
-
Point the firmware at your server in
config.h(SERVER_IP,SERVER_PORT). -
Install the libraries listed in Tech Stack via the Library Manager, select the ESP32-C3 DevKitM-1 board, set Tools β Partition Scheme β Huge APP (3MB No OTA/1MB SPIFFS), and upload
sketch_robot_signalr.ino.
Once connected, the robot appears on the Live View Image page of the authenticated dashboard and starts streaming telemetry.
| Document | Contents |
|---|---|
| Architecture & Communication | System design, SignalR message contracts, data flow |
| Getting Started | Detailed setup for server, database, and firmware |
| Server Application | Pages, services, hub API, data model, configuration reference |
| Firmware & Hardware | Pinout, sensor configuration, control loop, safety behavior |
The firmware and hardware reference links to the manufacturers' current datasheets. The project circuit schematic is stored in docs/.
Pushing to main or opening a pull request against it triggers the GitHub Actions workflow (.github/workflows/smartbotweb.yml), which performs a locked restore, verifies formatting, audits NuGet packages, builds and tests with coverage, builds the container image, and publishes a deployable web-app artifact. It does not deploy to an external environment automatically.
For the project presentation, the application was deployed to the smartbotweb Azure App Service and the firmware targeted smartbotweb.azurewebsites.net:443. That service is no longer hosted; the current firmware configuration uses an explicit placeholder that must be replaced with the address of the current server before use.
Issues and pull requests are welcome. To report a security vulnerability, please follow the process described in SECURITY.md instead of opening a public issue.
This project is licensed under the GNU General Public License v3.0 β Β© 2024 Kamil Rataj. Separately licensed third-party material is listed in THIRD_PARTY_NOTICES.md.







