Skip to content

Commit 0bcd288

Browse files
Copilotsofthack007
andcommitted
Switch to ethernet build to avoid WiFi crashes in QEMU
WiFi hardware is not emulated in QEMU and causes firmware crashes during AP mode initialization. Switched to ethernet build variant. Changes: - Use esp32_4MB_M_eth build instead of esp32dev - This build has WLED_USE_ETHERNET flag enabled - Disables ESP-NOW with WLED_DISABLE_ESPNOW (requires WiFi) - Network functionality works via emulated ethernet (open_eth model) - HTTP server accessible without WiFi hardware Updated workflow: - Build firmware with pio run -e esp32_4MB_M_eth - Updated all artifact paths to use esp32_4MB_M_eth - Updated PlatformIO cache key Updated documentation: - docs/QEMU-ISSUES.md: Added build configuration section explaining why - e2e-tests/README.md: Updated commands to use ethernet build This resolves the WiFi initialization crashes reported in CI logs. Co-authored-by: softhack007 <[email protected]>
1 parent e3f25f6 commit 0bcd288

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.github/workflows/qemu-e2e-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
uses: actions/cache@v4
2828
with:
2929
path: ~/.platformio
30-
key: ${{ runner.os }}-pio-esp32dev-${{ hashFiles('**/platformio.ini') }}
30+
key: ${{ runner.os }}-pio-esp32_4MB_M_eth-${{ hashFiles('**/platformio.ini') }}
3131
restore-keys: |
32-
${{ runner.os }}-pio-esp32dev-
32+
${{ runner.os }}-pio-esp32_4MB_M_eth-
3333
3434
- name: Set up Python
3535
uses: actions/setup-python@v5
@@ -52,13 +52,13 @@ jobs:
5252
run: npm run build
5353

5454
- name: Build ESP32 firmware
55-
run: pio run -e esp32dev
55+
run: pio run -e esp32_4MB_M_eth
5656

5757
- name: Upload firmware artifacts
5858
uses: actions/upload-artifact@v4
5959
with:
6060
name: esp32-firmware
61-
path: .pio/build/esp32dev/
61+
path: .pio/build/esp32_4MB_M_eth/
6262
retention-days: 1
6363

6464
# Job 2: Test with QEMU ESP32
@@ -85,7 +85,7 @@ jobs:
8585
uses: actions/download-artifact@v4
8686
with:
8787
name: esp32-firmware
88-
path: .pio/build/esp32dev/
88+
path: .pio/build/esp32_4MB_M_eth/
8989

9090
- name: Install Node.js dependencies
9191
run: npm ci
@@ -116,7 +116,7 @@ jobs:
116116
- name: Start QEMU with WLED firmware in background
117117
run: |
118118
chmod +x .github/scripts/run-qemu.sh
119-
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 8080 > qemu-output.log 2>&1 &
119+
bash .github/scripts/run-qemu.sh .pio/build/esp32_4MB_M_eth qemu-esp32 8080 > qemu-output.log 2>&1 &
120120
echo "Waiting for QEMU to start and WLED to boot..."
121121
sleep 45
122122

docs/QEMU-ISSUES.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
# QEMU ESP32 Testing - Known Issues and Limitations
22

3+
## Build Configuration
4+
5+
**Important**: QEMU testing uses the **ethernet build** (`esp32_4MB_M_eth`) instead of the default WiFi build.
6+
7+
### Why Ethernet Build?
8+
- WiFi hardware is not emulated in QEMU
9+
- WiFi initialization causes crashes in QEMU
10+
- Ethernet build uses `WLED_USE_ETHERNET` flag
11+
- Disables ESP-NOW with `WLED_DISABLE_ESPNOW` (requires WiFi)
12+
- Allows network functionality without WiFi hardware
13+
- HTTP server works via emulated ethernet (open_eth model)
14+
315
## QEMU Limitations
416

517
ESP32 QEMU emulation is not perfect and has several known limitations:
618

719
### Hardware Emulation
8-
- **WiFi**: Not fully emulated - WiFi operations may fail or behave differently
20+
- **WiFi**: Not emulated - **causes crashes if enabled**
921
- **Bluetooth**: Not emulated
1022
- **I2C/SPI**: Limited emulation - some peripherals may not work
1123
- **GPIO**: Partial emulation - LED outputs and some inputs work, but not all
1224
- **ADC**: Not emulated
1325
- **Touch sensors**: Not emulated
1426
- **RTC**: Limited emulation
27+
- **Ethernet**: Emulated via open_eth model (used for testing)
1528

1629
### Common Crash Patterns
1730

1831
#### 1. WiFi-Related Crashes
1932
**Symptom**: Crashes when trying to initialize WiFi or connect to networks
2033
**Cause**: WiFi hardware is not fully emulated in QEMU
2134
**Analysis**: Check if crash occurs during WiFi initialization
22-
**Solution**: These are expected in QEMU and don't indicate real firmware bugs
35+
**Solution**: Use ethernet build (`esp32_4MB_M_eth`) which disables WiFi
2336

2437
#### 2. Peripheral Access Crashes
2538
**Symptom**: Crashes when accessing I2C, SPI, or other peripherals

e2e-tests/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ pip install -r requirements.txt
3131

3232
Test the actual firmware running in QEMU ESP32 emulator:
3333

34+
**Important**: Use the ethernet build for QEMU testing, as WiFi is not emulated and causes crashes.
35+
3436
1. **Build the firmware**:
3537
```bash
3638
npm run build # Build web UI
37-
pio run -e esp32dev # Build firmware (takes 15+ minutes first time)
39+
pio run -e esp32_4MB_M_eth # Build ethernet firmware (WiFi disabled, 15+ min first time)
3840
```
3941

4042
2. **Setup QEMU** (first time only):
@@ -44,7 +46,7 @@ Test the actual firmware running in QEMU ESP32 emulator:
4446

4547
3. **Run firmware in QEMU** (in a separate terminal):
4648
```bash
47-
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 8080
49+
bash .github/scripts/run-qemu.sh .pio/build/esp32_4MB_M_eth qemu-esp32 8080
4850
```
4951

5052
Wait ~30-45 seconds for ESP32 to boot and start the web server.

0 commit comments

Comments
 (0)