### Development Server Command
Source: https://github.com/jniebuhr/gaggimate/blob/master/web/README.md
Starts a local development server for real-time updates. The server typically runs at http://localhost:5173/.
```bash
npm run dev
```
--------------------------------
### Preview Production Build Command
Source: https://github.com/jniebuhr/gaggimate/blob/master/web/README.md
Starts a local server to test the production build before deployment. The preview server usually runs at http://localhost:4173/.
```bash
npm run preview
```
--------------------------------
### Build and Deploy GaggiMate Firmware and Web UI
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Commands to install dependencies, build the project, and deploy firmware or the web UI to the device.
```bash
npm install
```
```bash
platformio run -e display -e controller
```
```bash
scripts/build_spiffs.sh
```
```bash
platformio run -e display -t upload -t monitor
```
```bash
platformio run -e controller -t upload -t monitor
```
```bash
scripts/build_spiffs.sh
platformio run -e display -t uploadfs -t monitor
```
--------------------------------
### Get Single Shot History Response
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Example response for the 'req:history:get' request, illustrating the inclusion of notes with individual shot history data.
```json
{
"tp": "res:history:get",
"rid": "unique-request-id",
"history": "1,Profile Name,1692123456\n0,85.0,84.5,9.0,8.7,2.1,2.0,1.8,0.0,0.0,0.0\n...",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
```
--------------------------------
### Get Shot History List Response
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Example response for the 'req:history:list' request, showing how shot history data is augmented with notes.
```json
{
"tp": "res:history:list",
"rid": "unique-request-id",
"history": [
{
"id": "000001",
"history": "1,Profile Name,1692123456\n0,85.0,84.5,9.0,8.7,2.1,2.0,1.8,0.0,0.0,0.0\n...",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
]
}
```
--------------------------------
### Export Data Structure with Notes
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Example of the JSON structure for an exported shot, including both historical data and associated notes.
```json
{
"id": "000001",
"version": "1",
"profile": "Profile Name",
"timestamp": 1692123456,
"duration": 30000,
"volume": 37.2,
"samples": [...],
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
```
--------------------------------
### Get Shot Notes Request and Response
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Demonstrates the request payload for fetching shot notes using 'req:history:notes:get' and its corresponding response structure.
```json
{
"tp": "req:history:notes:get",
"id": "000001",
"rid": "unique-request-id"
}
```
```json
{
"tp": "res:history:notes:get",
"rid": "unique-request-id",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
```
--------------------------------
### Get Shot Notes
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Retrieves the detailed notes for a specific shot using its ID.
```APIDOC
## Get Shot Notes
### Description
Retrieves the detailed notes for a specific shot using its ID.
### Request Type
`req:history:notes:get`
### Parameters
#### Request Body
- **tp** (string) - Required - Request type identifier.
- **id** (string) - Required - The ID of the shot for which to retrieve notes.
- **rid** (string) - Required - Unique request ID.
### Request Example
```json
{
"tp": "req:history:notes:get",
"id": "000001",
"rid": "unique-request-id"
}
```
### Response
#### Success Response
- **tp** (string) - Response type identifier.
- **rid** (string) - Unique request ID.
- **notes** (object) - Contains detailed notes for the shot.
- **id** (string) - The ID of the notes.
- **rating** (integer) - Star rating from 1 to 5.
- **doseIn** (float) - Input dose in grams.
- **doseOut** (float) - Output dose in grams.
- **ratio** (float) - Calculated ratio (doseOut/doseIn).
- **grindSetting** (string) - Description of the grind setting.
- **balanceTaste** (string) - Taste balance ('bitter', 'balanced', 'sour').
- **notes** (string) - Free-form text notes.
- **timestamp** (integer) - Timestamp of when the notes were last updated.
### Response Example
```json
{
"tp": "res:history:notes:get",
"rid": "unique-request-id",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
```
```
--------------------------------
### Get Single Shot History with Notes
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Retrieves the history for a single shot, including its associated notes data if available.
```APIDOC
## Get Single Shot History
### Description
Retrieves the history for a single shot, including its associated notes data if available.
### Request Type
`req:history:get`
### Response
#### Success Response
- **tp** (string) - Response type identifier.
- **rid** (string) - Unique request ID.
- **history** (string) - The historical shot data.
- **notes** (object) - Contains detailed notes for the shot, if available.
- **id** (string) - The ID of the notes.
- **rating** (integer) - Star rating from 1 to 5.
- **doseIn** (float) - Input dose in grams.
- **doseOut** (float) - Output dose in grams.
- **ratio** (float) - Calculated ratio (doseOut/doseIn).
- **grindSetting** (string) - Description of the grind setting.
- **balanceTaste** (string) - Taste balance ('bitter', 'balanced', 'sour').
- **notes** (string) - Free-form text notes.
- **timestamp** (integer) - Timestamp of when the notes were last updated.
### Response Example
```json
{
"tp": "res:history:get",
"rid": "unique-request-id",
"history": "1,Profile Name,1692123456\n0,85.0,84.5,9.0,8.7,2.1,2.0,1.8,0.0,0.0,0.0\n...",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
```
```
--------------------------------
### Get Shot History List with Notes
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Retrieves a list of shot histories, with notes data automatically included if available for each shot.
```APIDOC
## Get Shot History List
### Description
Retrieves a list of shot histories, with notes data automatically included if available for each shot.
### Request Type
`req:history:list`
### Response
#### Success Response
- **tp** (string) - Response type identifier.
- **rid** (string) - Unique request ID.
- **history** (array) - An array of shot history objects, each potentially containing a nested 'notes' object.
- **id** (string) - The ID of the shot.
- **history** (string) - The historical shot data.
- **notes** (object) - Contains detailed notes for the shot, if available.
- **id** (string) - The ID of the notes.
- **rating** (integer) - Star rating from 1 to 5.
- **doseIn** (float) - Input dose in grams.
- **doseOut** (float) - Output dose in grams.
- **ratio** (float) - Calculated ratio (doseOut/doseIn).
- **grindSetting** (string) - Description of the grind setting.
- **balanceTaste** (string) - Taste balance ('bitter', 'balanced', 'sour').
- **notes** (string) - Free-form text notes.
- **timestamp** (integer) - Timestamp of when the notes were last updated.
### Response Example
```json
{
"tp": "res:history:list",
"rid": "unique-request-id",
"history": [
{
"id": "000001",
"history": "1,Profile Name,1692123456\n0,85.0,84.5,9.0,8.7,2.1,2.0,1.8,0.0,0.0,0.0\n...",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor",
"timestamp": 1692123456
}
}
]
}
```
```
--------------------------------
### Web Interface Development Server Commands
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Commands to manage the development server and build the Preact-based web interface for GaggiMate.
```bash
npm run dev
```
```bash
npm run build
```
```bash
npm run preview
```
--------------------------------
### Static Analysis Command
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Command to run static analysis on the display and controller firmware using PlatformIO.
```bash
platformio check -e display
```
```bash
platformio check -e controller
```
--------------------------------
### Production Build Command
Source: https://github.com/jniebuhr/gaggimate/blob/master/web/README.md
Generates an optimized production build of the application, outputting files to the 'dist/' directory.
```bash
npm run build
```
--------------------------------
### Repository Structure Overview
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Provides a hierarchical view of the GaggiMate project's directories and key configuration files.
```shell
.
├── boards/ # Custom PlatformIO board definitions
├── docs/ # Documentation assets and diagrams
├── icons/ # Source icons and conversion scripts
├── lib/ # PlatformIO libraries such as GaggiMateController
├── scripts/ # Helper scripts for builds and formatting
├── src/
│ ├── controller/ # Firmware for the controller board
│ └── display/ # Firmware for the display unit (LVGL UI, plugins)
├── ui/ # SquareLine Studio project for the LVGL UI
├── web/ # Preact-based web interface
└── platformio.ini # PlatformIO configuration
```
--------------------------------
### PlatformIO Environments for GaggiMate
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Defines the two primary PlatformIO environments for building the display and controller firmware, specifying board types and source file filters.
```ini
[env:display]
board = LilyGo-T-RGB
build_src_filter = -<*> +
```
```ini
[env:controller]
board = Gaggimate-Controller
build_src_filter = -<*> +
```
--------------------------------
### Use Node.js Version with NVM
Source: https://github.com/jniebuhr/gaggimate/blob/master/web/README.md
Ensure you are using the correct Node.js version (22) for the project. This command is useful when managing multiple Node.js versions with a version manager like NVM or FNM.
```bash
nvm use # or fnm use
```
--------------------------------
### Analyze ESP32 Core Dump with Shell Wrapper
Source: https://github.com/jniebuhr/gaggimate/blob/master/scripts/README.md
A simpler shell wrapper for the core dump analysis script. It automates the extraction and analysis process.
```bash
./scripts/analyze_coredump.sh [environment]
```
```bash
./scripts/analyze_coredump.sh ~/Downloads/coredump.bin
```
```bash
./scripts/analyze_coredump.sh ~/Downloads/coredump.bin controller
```
--------------------------------
### Code Formatting Commands
Source: https://github.com/jniebuhr/gaggimate/blob/master/CONTRIBUTING.md
Commands for formatting C/C++ sources, web code, and markdown files according to project standards.
```bash
scripts/format.sh
```
```bash
npm run format
```
```bash
npx prettier -w .md
```
--------------------------------
### Analyze ESP32 Core Dump with Python Script
Source: https://github.com/jniebuhr/gaggimate/blob/master/scripts/README.md
Use this Python script to automatically extract and analyze ESP32 core dumps. It requires ESP-IDF tools and a PlatformIO project.
```bash
python3 scripts/analyze_coredump.py [environment]
```
```bash
python3 scripts/analyze_coredump.py ~/Downloads/coredump.bin
```
```bash
python3 scripts/analyze_coredump.py ~/Downloads/coredump.bin display
```
```bash
python3 scripts/analyze_coredump.py ~/Downloads/coredump.bin controller
```
```bash
python3 scripts/analyze_coredump.py ~/Downloads/coredump.bin display-headless
```
--------------------------------
### Interactive GDB Debugging with Extracted Core Dump
Source: https://github.com/jniebuhr/gaggimate/blob/master/scripts/README.md
Use the extracted ELF core dump file with GDB for interactive debugging. This allows for detailed inspection of the crash state.
```bash
xtensa-esp32s3-elf-gdb .pio/build/display/firmware.elf
(gdb) core-file /tmp/extracted_coredump.elf
(gdb) bt
(gdb) list
(gdb) info locals
(gdb) print variable_name
```
--------------------------------
### Save Shot Notes Request and Response
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Shows the request format for saving shot notes via 'req:history:notes:save' and the expected success response.
```json
{
"tp": "req:history:notes:save",
"id": "000001",
"rid": "unique-request-id",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor"
}
}
```
```json
{
"tp": "res:history:save",
"rid": "unique-request-id",
"msg": "Ok"
}
```
--------------------------------
### Save Shot Notes
Source: https://github.com/jniebuhr/gaggimate/blob/master/docs/shot-notes-api.md
Saves or updates the notes for a specific shot using its ID.
```APIDOC
## Save Shot Notes
### Description
Saves or updates the notes for a specific shot using its ID.
### Request Type
`req:history:notes:save`
### Parameters
#### Request Body
- **tp** (string) - Required - Request type identifier.
- **id** (string) - Required - The ID of the shot to save notes for.
- **rid** (string) - Required - Unique request ID.
- **notes** (object) - Required - The notes data to save.
- **id** (string) - Required - The ID of the notes (should match shot ID).
- **rating** (integer) - Optional - Star rating from 1 to 5.
- **doseIn** (float) - Optional - Input dose in grams.
- **doseOut** (float) - Optional - Output dose in grams.
- **ratio** (float) - Optional - Calculated ratio (doseOut/doseIn).
- **grindSetting** (string) - Optional - Description of the grind setting.
- **balanceTaste** (string) - Optional - Taste balance ('bitter', 'balanced', 'sour').
- **notes** (string) - Optional - Free-form text notes.
### Request Example
```json
{
"tp": "req:history:notes:save",
"id": "000001",
"rid": "unique-request-id",
"notes": {
"id": "000001",
"rating": 4,
"doseIn": 18.5,
"doseOut": 37.2,
"ratio": 2.01,
"grindSetting": "2.5",
"balanceTaste": "balanced",
"notes": "Great shot with nice crema and balanced flavor"
}
}
```
### Response
#### Success Response
- **tp** (string) - Response type identifier.
- **rid** (string) - Unique request ID.
- **msg** (string) - Confirmation message, e.g., "Ok".
### Response Example
```json
{
"tp": "res:history:notes:save",
"rid": "unique-request-id",
"msg": "Ok"
}
```
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.