VoiceNotes is an Arduino sketch for the Waveshare ESP32-C6-LCD-0.85 that records meetings and voice memos to microSD and turns them into notes: - Records 16 kHz mono WAV (up to 4 h) from the ES7210 dual mics, with a boosted preamp and soft-limited digital gain - Transcribes via an OpenAI-compatible speech-to-text API in ~10 min parts cut at quiet points, with retries and resume after failures - Summarizes the transcript with Claude into meeting notes (decisions, action items, topics with timestamps), streamed to and from the card - Copies the notes to Nextcloud over WebDAV - Shows recording/processing state on the 0.85" LCD and the LED ring - Works around the board's SD card failing multi-sector reads Credentials live in VoiceNotes/secrets.h, which is git-ignored; see secrets.example.h. Also adds the Microsoft CDM customer service SQL implementation (DDL, sample data, reporting queries and docs). Its README is renamed to CDM_README.md so the repository README stays at the top level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
74 lines
3.1 KiB
C
74 lines
3.1 KiB
C
// Board pinout and app settings for the Waveshare ESP32-C6-LCD-0.85.
|
|
// Pins come from Waveshare's schematic and demo code:
|
|
// https://github.com/waveshareteam/ESP32-C6-LCD-0.85
|
|
#pragma once
|
|
|
|
// ---------- Buttons (active LOW, external pull-ups on the board) ----------
|
|
// The board has only two GPIO buttons. The PWR key drives the power switch IC
|
|
// and is not readable from firmware.
|
|
#define PIN_BTN_PLUS 18 // "PLUS" key -> Button 1: start recording
|
|
#define PIN_BTN_BOOT 9 // "BOOT" key -> Button 2: stop recording
|
|
// Button 3 (transcribe + summarize) defaults to a long-press of PLUS.
|
|
// If you wire an external push button (to GND), set its GPIO here and it
|
|
// will also act as Button 3 on a single click. -1 = not fitted.
|
|
#define PIN_BTN_EXTRA -1
|
|
#define BTN3_LONG_PRESS_MS 1000
|
|
|
|
// ---------- LCD: ST7735, 128x128, shares the SPI bus with the microSD ----------
|
|
#define PIN_SPI_SCK 1
|
|
#define PIN_SPI_MOSI 2
|
|
#define PIN_SPI_MISO 16
|
|
#define PIN_LCD_DC 3
|
|
#define PIN_LCD_CS 5
|
|
#define PIN_LCD_RST 4
|
|
#define PIN_LCD_BL 6
|
|
#define LCD_COL_OFFSET 2
|
|
#define LCD_ROW_OFFSET 3
|
|
|
|
// ---------- microSD ----------
|
|
#define PIN_SD_CS 17
|
|
#define SD_SPI_HZ 20000000
|
|
|
|
// ---------- LED ring: 8 x WS2812B ----------
|
|
#define PIN_LEDS 14
|
|
#define NUM_LEDS 8
|
|
#define LED_BRIGHTNESS 60 // 0-255; the ring is bright at close range
|
|
#define LED_COLOR_ORDER RGB // per Waveshare's demo; use GRB if red and green look swapped
|
|
|
|
// ---------- Audio: ES7210 mic ADC on I2C + I2S ----------
|
|
#define PIN_I2C_SDA 8
|
|
#define PIN_I2C_SCL 7
|
|
#define PIN_I2S_MCLK 19
|
|
#define PIN_I2S_BCLK 20
|
|
#define PIN_I2S_WS 22
|
|
#define PIN_I2S_DIN 21 // ES7210 SDOUT1 -> ESP32
|
|
#define PIN_PA_CTRL 15 // NS4150 speaker amp enable (kept off)
|
|
#define ES7210_ADDR 0x40
|
|
#define MIC_GAIN_STEP 14 // ES7210 PGA: 0..10 = 0..30 dB in 3 dB steps, 11..14 = 33/34.5/36/37.5 dB (max)
|
|
#define DIGITAL_GAIN_DB 6 // extra software gain after the preamp, with a soft limiter (0 = off)
|
|
|
|
#define SAMPLE_RATE 16000 // 16 kHz mono 16-bit = 32 KB/s, ideal for speech-to-text
|
|
|
|
// Longest recording (also limited by free space on the card). 4 h = ~460 MB.
|
|
#define MAX_RECORD_SECONDS (4 * 3600)
|
|
|
|
// Transcription APIs reject files over 25 MB (~13 min), so long recordings are
|
|
// sent in parts of about STT_SEGMENT_SECONDS each. Every cut is moved to the
|
|
// quietest moment in the CUT_SEARCH_SECONDS before it, so words aren't split.
|
|
#define MAX_UPLOAD_BYTES (25UL * 1024 * 1024)
|
|
#define STT_SEGMENT_SECONDS 600
|
|
#define CUT_SEARCH_SECONDS 15
|
|
#define STT_MAX_ATTEMPTS 3 // per part, before giving up (progress is kept for a later resume)
|
|
|
|
// ---------- Network ----------
|
|
// DNS servers used instead of the ones the router hands out ("" = keep the router's).
|
|
// Pinned because the board was once seen using 8.8.8.9, which doesn't answer DNS and
|
|
// added ~8 s to every connection.
|
|
#define DNS_PRIMARY "8.8.8.8"
|
|
#define DNS_SECONDARY "1.1.1.1"
|
|
|
|
// ---------- Storage layout ----------
|
|
#define DIR_RECORDINGS "/recordings"
|
|
#define DIR_NOTES "/notes"
|
|
#define LAST_REC_FILE "/recordings/last.txt"
|