| .. | ||
| .env.example | ||
| .gitignore | ||
| deno.json | ||
| deno.lock | ||
| Dockerfile | ||
| main.ts | ||
| README.md | ||
| supabase.ts | ||
| types.d.ts | ||
| utils.ts | ||
Elato AI WebSocket Server (Deno)
This directory contains the WebSocket server implementation for Elato AI, built with Deno.
Prerequisites
- Deno installed on your system
- Network access (for both local development and deployment)
Running the Server
Local Development
-
Start the server:
# 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 -
Verify the server:
- The server should be running on port 8000 (default)
- You should see a message confirming the server is listening
Production Deployment
-
Deploy to Deno Deploy:
- Create an account on Deno Deploy
- Create a new project
- Connect your GitHub repository or upload your server code
- Deploy to a custom domain (e.g.,
your-app.deno.dev)
-
Update firmware configuration:
- In the firmware project, make sure
DEV_MODEis NOT defined in Config.cpp - The WebSocket server will be set to your Deno Deploy URL
- In the firmware project, make sure
-
Get the Root CA Certificate using terminal:
- To get the full certificate chain with the root CA:
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_certvariable 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