Skip to content

Commit 10bd1a3

Browse files
committed
Merge remote-tracking branch 'origin/main' into sri/config-assistant
2 parents bf0e86d + e043e47 commit 10bd1a3

File tree

6 files changed

+175
-204
lines changed

6 files changed

+175
-204
lines changed

README.md

Lines changed: 166 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,171 @@
1-
# vapicon-2025-hardware-workshop
1+
# VapiCon 2025 Hardware Workshop
22

3-
## Platform/Device Support
3+
[Demo Video](https://www.youtube.com/watch?v=gPuNpaL9ig8)
44

5-
* [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R)
6-
* [Atomic Echo Base](https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base)
5+
## Prerequisites
76

8-
## Configuration
9-
Run `idf.py menuconfig` and navigate to `VapiCon 2025 Hardware Workshop Configuration`.
7+
1. **ESP-IDF**: Install ESP-IDF v5.5.1 or later
108

11-
Inside this you need to set your Wifi Name/Wifi Password and Bearer Token.
9+
### Quick Installation Steps
1210

13-
## Flashing
14-
`idf.py flash monitor`, this installs your code and shows you the logs on the device. Useful for debugging/understanding what is happening.
11+
#### macOS/Linux
12+
13+
```bash
14+
# Install prerequisites (macOS)
15+
brew install cmake ninja dfu-util
16+
17+
# Install prerequisites (Ubuntu/Debian)
18+
# sudo apt-get install git wget flex bison gperf python3 python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
19+
20+
# Clone ESP-IDF repository
21+
mkdir -p ~/esp
22+
cd ~/esp
23+
git clone -b v5.5.1 --recursive https://github.com/espressif/esp-idf.git
24+
25+
# Install ESP-IDF tools
26+
cd ~/esp/esp-idf
27+
./install.sh esp32s3
28+
29+
# Set up environment (run this each time you open a new terminal)
30+
source ~/esp/esp-idf/export.sh
31+
```
32+
33+
#### Windows
34+
35+
```powershell
36+
# Download and run the ESP-IDF installer from:
37+
# https://dl.espressif.com/dl/esp-idf/
38+
39+
# Or use the ESP-IDF command prompt installed by the installer
40+
# Then run:
41+
export.bat
42+
```
43+
44+
### Verify Installation
45+
46+
```bash
47+
idf.py --version
48+
# Should output something like: ESP-IDF v5.5.1
49+
```
50+
51+
### Setting up Environment (Required for each terminal session)
52+
53+
```bash
54+
# Add this to your ~/.zshrc to avoid running it manually:
55+
alias get_idf='. ~/esp/esp-idf/export.sh'
56+
57+
# Open a new terminal to apply the changes
58+
59+
# Then you can simply run:
60+
get_idf
61+
```
62+
63+
**Full Documentation**: [Official ESP-IDF Installation Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html)
64+
65+
2. **Hardware**:
66+
- [AtomS3R](https://docs.m5stack.com/en/core/AtomS3R) or
67+
- [Atomic Echo Base](https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base)
68+
- [Atomic Battery Base](https://shop.m5stack.com/products/atomic-battery-base-200mah?srsltid=AfmBOoqrr_zX2RVCksgfggWRR2F-8hTZ4asWs7_DuLn3MWEXH9JYPSqN)
69+
70+
## Project Setup
71+
72+
### 1. Clone the Repository
73+
74+
```bash
75+
git clone --recurse-submodules https://github.com/VapiAI/vapicon-2025-hardware-workshop.git
76+
cd vapicon-2025-hardware-workshop
77+
```
78+
79+
### 2. Configuration
80+
81+
Run the configuration menu to set up your WiFi credentials and Bearer Token:
82+
83+
```bash
84+
idf.py menuconfig
85+
```
86+
87+
Navigate to:
88+
89+
- `VapiCon 2025 Hardware Workshop Configuration`
90+
- Set your **WiFi Name** and **WiFi Password**
91+
- Set your **Bearer Token** to `b3db41dc-f62e-4ca8-89dc-550eab564212` and press enter
92+
- Press `S` and enter to save
93+
- Press `Q` to quit.
94+
95+
### Config values
96+
97+
- `BEARER_TOKEN` - `b3db41dc-f62e-4ca8-89dc-550eab564212`
98+
99+
## Building the Project
100+
101+
### Build the firmware
102+
103+
```bash
104+
idf.py build
105+
```
106+
107+
## Flashing to Device
108+
109+
### Flash and monitor
110+
111+
```bash
112+
idf.py flash monitor
113+
```
114+
115+
This command will:
116+
117+
1. Flash the firmware to your connected ESP32-S3 device
118+
2. Open the serial monitor to view debug output
119+
120+
To exit the monitor, press `Ctrl+]`.
121+
122+
## Troubleshooting
123+
124+
### Build Errors
125+
126+
If you encounter compiler warnings treated as errors:
127+
128+
1. **String truncation errors**: These may appear with GCC 13+ due to stricter checks
129+
130+
2. **Missing enum cases**: This typically happens when using a different ESP-IDF version
131+
- **Solution**: Ensure you're using ESP-IDF v5.5.1 as specified in the prerequisites
132+
- Check your current version: `idf.py --version`
133+
- If incorrect, reinstall ESP-IDF v5.5.1 following the installation steps above
134+
135+
### Missing Dependencies
136+
137+
If the build fails with missing `libpeer` files:
138+
139+
- Ensure submodules are properly initialized: `git submodule update --init --recursive`
140+
- Check that `deps/libpeer/src/` directory contains source files
141+
142+
### Device Connection
143+
144+
If flashing fails:
145+
146+
- Check the USB connection
147+
- Try different USB ports or cables
148+
- Ensure the correct port is detected (it should auto-detect, or specify with `-p PORT`)
149+
150+
## Project Structure
151+
152+
```
153+
vapicon-2025-hardware-workshop/
154+
├── main/ # Main application source
155+
│ ├── http.h # HTTP client for Vapi API
156+
│ ├── webrtc.h # WebRTC implementation
157+
│ ├── wifi.h # WiFi connection management
158+
│ └── m5-atom-s3.h # Hardware abstraction
159+
├── deps/
160+
│ └── libpeer/ # WebRTC library (git submodule)
161+
├── components/
162+
│ └── peer/ # Peer connection component
163+
├── sdkconfig.defaults # Default configuration values
164+
└── partitions.csv # Flash partition table
165+
```
166+
167+
## Additional Resources
168+
169+
- [ESP-IDF Documentation](https://docs.espressif.com/projects/esp-idf/en/latest/)
170+
- [M5Stack AtomS3R Documentation](https://docs.m5stack.com/en/core/AtomS3R)
171+
- [Vapi Documentation](https://docs.vapi.ai/)

SETUP.md

Lines changed: 0 additions & 176 deletions
This file was deleted.

components/peer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ idf_component_register(
88
)
99

1010
add_definitions("-DESP32 -DCONFIG_USE_LWIP=1 -DCONFIG_DATA_BUFFER_SIZE=102400 -D__BYTE_ORDER=__LITTLE_ENDIAN")
11-
add_definitions("-DHTTP_DO_NOT_USE_CUSTOM_CONFIG -DMQTT_DO_NOT_USE_CUSTOM_CONFIG -DCONFIG_USE_USRSCTP=0 -DDISABLE_PEER_SIGNALING=0 -DCONFIG_KEEPALIVE_TIMEOUT=0")
11+
add_definitions("-DHTTP_DO_NOT_USE_CUSTOM_CONFIG -DMQTT_DO_NOT_USE_CUSTOM_CONFIG -DCONFIG_USE_USRSCTP=0 -DDISABLE_PEER_SIGNALING=0")

main/http.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ void do_http_request(const char *offer, char *answer) {
130130
if (err != ESP_OK || esp_http_client_get_status_code(client) != 200) {
131131
ESP_LOGE(LOG_TAG_HTTP, "Error perform http request %s",
132132
esp_err_to_name(err));
133+
esp_restart();
133134
}
134135

135136
free(body);

main/vapicon-2025-hardware-workshop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ extern "C" void app_main(void) {
1717
ESP_ERROR_CHECK(esp_event_loop_create_default());
1818
wifi_connect();
1919

20-
board->ShowLogs("Creating PeerConnection");
20+
board->ShowLogs("WebRTC Create");
2121
webrtc_create(board);
2222
}

0 commit comments

Comments
 (0)