updated old docs
This commit is contained in:
parent
9401a8de70
commit
ff83ae4e6e
4 changed files with 4 additions and 247 deletions
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
Realtime AI Speech powered by SoTA AI voice models on ESP32, with Secure WebSockets, and Deno Edge Functions for >15-minute uninterrupted conversations globally. We currently support OpenAI Realtime API, Gemini Live API, xAI Grok Voice Agents API, Eleven Labs Conversational AI Agents, and Hume AI EVI-4.
|
||||
|
||||
- [🚀 Quick start](https://www.elatoai.com/docs/quickstart)
|
||||
- [🚀 Quick Start](https://www.elatoai.com/docs/quickstart)
|
||||
- [Build with PlatformIO](https://www.elatoai.com/docs/platformio)
|
||||
- [Build on Arduino IDE](https://www.elatoai.com/docs/arduino)
|
||||
- [Deploy globally](https://www.elatoai.com/docs/blog/deploying-globally)
|
||||
|
|
|
|||
|
|
@ -1,110 +1,3 @@
|
|||
# ESP32 WebSocket Audio Client
|
||||
|
||||
This firmware turns your ESP32 device into a WebSocket audio client for Elato, enabling real-time conversations with AI characters.
|
||||
|
||||
## Hardware Setup
|
||||
|
||||
<img src="../assets/pcb-design.png" alt="Hardware Setup" width="100%">
|
||||
|
||||
### Components Needed
|
||||
- ESP32-S3 board
|
||||
- I2S MEMS microphone (INMP441 recommended)
|
||||
- I2S speaker with amplifier (MAX98357A recommended)
|
||||
- Microspeaker
|
||||
- Button/Touch sensor and RGB LED (optional but recommended)
|
||||
|
||||
### Pin Connections
|
||||
|
||||
| **Component** | **Standard ESP32** |
|
||||
|---------------|-------------------|
|
||||
| **Microphone** | |
|
||||
| SD (Data) | GPIO 14 |
|
||||
| WS (Word Select) | GPIO 4 |
|
||||
| SCK (Clock) | GPIO 1 |
|
||||
| **Speaker** | | |
|
||||
| WS | GPIO 5 |
|
||||
| BCK | GPIO 6 |
|
||||
| DATA | GPIO 7 |
|
||||
| SD (shutdown) | GPIO 10 |
|
||||
| **Control** | |
|
||||
| Button | GPIO 2 |
|
||||
| LED (Blue) | GPIO 13 |
|
||||
| LED (Red) | GPIO 9 |
|
||||
| LED (Green) | GPIO 8 |
|
||||
|
||||
## Software Setup
|
||||
|
||||
### Using PlatformIO
|
||||
|
||||
1. Install Visual Studio Code and the PlatformIO extension
|
||||
2. Clone this repository
|
||||
3. Open the project folder in PlatformIO. `Open > Open Project > firmware-arduino`
|
||||
4. Edit `src/Config.cpp` with your server details:
|
||||
- If using locally: Set your computer's IP address in `ws_server` and `backend_server`
|
||||
- If using production: Ensure proper certificates are set
|
||||
5. Build and upload to your ESP32
|
||||
|
||||
|
||||
### To use locally:
|
||||
1. **Find your local IP address**:
|
||||
- View your Wifi IP when you click on Wifi Settings > Your Wifi Network > Details, OR
|
||||
- On macOS/Linux: Open Terminal and run `ifconfig`
|
||||
- On Windows: Open Command Prompt and run `ipconfig`
|
||||
- Look for your active network interface (WiFi: `en0` on Mac, `wlan0` on Linux, `Wireless LAN adapter Wi-Fi` on Windows)
|
||||
- Note the IP address (e.g., `192.168.1.100`)
|
||||
|
||||
2. **Update firmware configuration**:
|
||||
- In the firmware project, set `DEV_MODE` in Config.cpp
|
||||
- Update the WebSocket server IP to your local IP address
|
||||
|
||||
## NVS Storage
|
||||
|
||||
We store the following data in Non-Volatile Storage (NVS) on the ESP32:
|
||||
1. **Auth token**: The supabase auth token that is used to authenticate the device with the backend server.
|
||||
2. **Factory reset**: Whether the device has been factory reset.
|
||||
3. **Wifi credentials**: The wifi credentials of the device.
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
1. Power on your ESP32
|
||||
2. Connect to the "Elato device" WiFi network from your phone/computer
|
||||
3. A configuration portal will open (or navigate to 192.168.4.1)
|
||||
4. Enter your home WiFi credentials
|
||||
5. The device will restart and connect to your WiFi
|
||||
|
||||
## Usage
|
||||
|
||||
1. Power on the device
|
||||
2. The LED indicates status:
|
||||
- Green 🟢: Setup mode and websocket/wifi is not connected
|
||||
- Blue 🔵: Device is speaking
|
||||
- Yellow 🟡: Device is listening to user
|
||||
- Red 🔴: Processing user request
|
||||
- Cyan 🩵: OTA in progress
|
||||
- Magenta 🩷: Soft AP mode
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If connection fails, check your WiFi signal and server details
|
||||
- Monitor serial output at 115200 baud for detailed logs
|
||||
|
||||
## Deploying and Advanced Config
|
||||
|
||||
1. Add your Deno and Vercel server Root CA to `config.cpp`. You can find the Root CA of vercel by running the following command and picking the Root certificate in the chain:
|
||||
|
||||
```bash
|
||||
# vercel server root ca
|
||||
openssl s_client -showcerts -connect <your-vercel-deomain>.vercel.app:443 </dev/null
|
||||
|
||||
# deno server root ca
|
||||
openssl s_client -showcerts -connect <your-deno-domain>.deno.dev:443 </dev/null
|
||||
```
|
||||
|
||||
2. Edit `Config.cpp` to customize:
|
||||
- Server addresses and ports
|
||||
- Audio sample rate (default 24kHz)
|
||||
- Pin assignments for different boards
|
||||
|
||||
3. For development, uncomment `#define DEV_MODE` in Config.h to use local servers without SSL. To deploy to production, comment out `#define DEV_MODE` and set the proper server addresses and ports.
|
||||
|
||||
4. To use the button functions, uncomment `#define TOUCH_MODE` in Config.h
|
||||
For more details, visit the [Elato Firmware Docs](https://www.elatoai.com/docs/blog/firmware).
|
||||
|
|
|
|||
|
|
@ -1,63 +1,3 @@
|
|||
# Elato AI WebSocket Server (Deno)
|
||||
|
||||
This directory contains the WebSocket server implementation for Elato AI, built with Deno.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Deno](https://deno.land/) installed on your system
|
||||
- Network access (for both local development and deployment)
|
||||
|
||||
## Running the Server
|
||||
|
||||
### Local Development
|
||||
|
||||
1. **Start the server**:
|
||||
```bash
|
||||
# Navigate to the server-deno directory
|
||||
cd server-deno
|
||||
|
||||
# Run the server (replace server.ts with your main file if different)
|
||||
deno run -A --env-file=.env main.ts
|
||||
```
|
||||
|
||||
2. **Verify the server**:
|
||||
- The server should be running on port 8000 (default)
|
||||
- You should see a message confirming the server is listening
|
||||
|
||||
### Production Deployment
|
||||
|
||||
1. **Deploy to Deno Deploy**:
|
||||
- Create an account on [Deno Dash Deploy](https://dash.deno.com/account/overview)
|
||||
- **Note**: Deno Dash is the legacy version of Deno Deploy. Elato is currently using Deno Dash. You can use Deno Deploy if you prefer but Deno deploy routes websockets via AWS which flips your websocket's RSV bits and can result in unknown opcodes for your ESP32.
|
||||
- Create a new project
|
||||
- Connect your GitHub repository or upload your server code
|
||||
- Deploy to a custom domain (e.g., `your-app.deno.dev`)
|
||||
|
||||
2. **Update firmware configuration**:
|
||||
- In the firmware project, make sure `DEV_MODE` is NOT defined in Config.cpp
|
||||
- The WebSocket server will be set to your Deno Deploy URL
|
||||
|
||||
3. **Get the Root CA Certificate using terminal**:
|
||||
- To get the full certificate chain with the root CA:
|
||||
```bash
|
||||
openssl s_client -showcerts -connect your-app.deno.dev:443 </dev/null
|
||||
```
|
||||
- Copy the last certificate in the chain (the root CA certificate) including the BEGIN and END lines
|
||||
- Paste this into the `CA_cert` variable in Config.cpp
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Connection Issues
|
||||
- Ensure your ESP32 device and development computer are on the same network
|
||||
- Check if any firewalls are blocking port 8000
|
||||
- Verify your local IP address hasn't changed (dynamic IPs can change after reconnecting)
|
||||
|
||||
### Server Errors
|
||||
- Check the server logs for error messages
|
||||
- Ensure Deno has proper permissions to access network resources
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Deno Documentation](https://docs.deno.com/runtime/)
|
||||
- [Deno Deploy Documentation](https://docs.deno.com/deploy/manual/)
|
||||
- [WebSocket API Reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
|
||||
For more details, visit the [Elato Deno Server Docs](https://www.elatoai.com/docs/blog/edge-server).
|
||||
|
|
@ -1,79 +1,3 @@
|
|||
# Supabase Setup and Usage Guide
|
||||
|
||||
## Prerequisites for running Supabase:
|
||||
- Docker Desktop (or Docker Engine + Docker Compose on Linux)
|
||||
- Supabase CLI
|
||||
|
||||
## Installation
|
||||
|
||||
1. **Install Supabase CLI**
|
||||
```bash
|
||||
# Using NPM
|
||||
npm install -g supabase
|
||||
|
||||
# Using Homebrew (macOS)
|
||||
brew install supabase/tap/supabase
|
||||
```
|
||||
|
||||
2. **Start Supabase locally**
|
||||
```bash
|
||||
# Navigate to your project
|
||||
cd ElatoAI
|
||||
|
||||
# Start Supabase local development
|
||||
supabase start
|
||||
```
|
||||
|
||||
3. **Verify installation**
|
||||
The output should show local endpoints including:
|
||||
- API URL: http://127.0.0.1:54321
|
||||
- Studio URL: http://127.0.0.1:54323
|
||||
- JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
|
||||
|
||||
## Configuration
|
||||
|
||||
1. **Environment variables**
|
||||
Add these to your `.env.local` and `.env` file in `frontend-nextjs` and `server-deno` respectively:
|
||||
```
|
||||
SUPABASE_URL=http://127.0.0.1:54321
|
||||
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
JWT_SECRET_KEY=super-secret-jwt-token-with-at-least-32-characters-long
|
||||
```
|
||||
|
||||
## Tables chart
|
||||
View a live chart of the tables and their relationships [here](http://localhost:54323/project/default/database/schemas)
|
||||
|
||||
<img src="tables.png" alt="Supabase Tables Chart" width="100%">
|
||||
|
||||
|
||||
## Tables
|
||||
1. `users` - user details are stored here
|
||||
2. `devices` - device details (mac address, device name, etc) are stored here
|
||||
3. `conversations` - conversation details (start time, end time, etc) are stored here
|
||||
4. `messages` - all conversations and transcripts are stored here
|
||||
5. `api_keys` - api keys are stored here (not used for local development)
|
||||
6. `languages` - all supported languages are stored here
|
||||
|
||||
|
||||
## Development Workflow
|
||||
|
||||
1. Make schema changes in Supabase Studio (http://127.0.0.1:54323)
|
||||
2. Generate migrations: `supabase db diff -f <migration_name>`
|
||||
3. Apply to local database: `supabase migration up`
|
||||
4. Push changes to production when ready
|
||||
|
||||
## Deploying to your own supabase instance
|
||||
|
||||
1. Create a new supabase project on supabase.com
|
||||
2. Copy the supabase url and anon key
|
||||
3. Paste them in the `.env` and `.env.local` file in the root of the project
|
||||
4. Link the project to the new supabase instance: `supabase link --project-ref <project_ref>`
|
||||
5. Run `supabase db push --include-seed` to push the changes to the local database and seed the database with the data in `supabase/seed.sql`
|
||||
|
||||
## Stopping Supabase
|
||||
|
||||
```bash
|
||||
supabase stop
|
||||
```
|
||||
|
||||
For more details, visit the [Supabase documentation](https://supabase.com/docs).
|
||||
For more details, visit the [Elato Supabase Docs](https://www.elatoai.com/docs/blog/database).
|
||||
Loading…
Reference in a new issue