Add CYD web radio: WiFi provision + HTTP MP3 to DAC26.
Supports 2.8/3.5 boards with on-screen station list; ships flashable firmware packages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
15
firmware/cyd/VERSION.txt
Normal file
15
firmware/cyd/VERSION.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
name: CYD webradiotest (cyd)
|
||||
git: unknown
|
||||
date: 2026-10-28
|
||||
board: ESP32-2432S028R (ILI9341)
|
||||
flash_size: 4MB
|
||||
offsets:
|
||||
0x1000 bootloader.bin
|
||||
0x8000 partitions.bin
|
||||
0xe000 boot_app0.bin
|
||||
0x10000 firmware.bin
|
||||
sha256:
|
||||
bootloader.bin 3D234A7471F67B013686DABD4DEE7C1FA915C9928463616A94BC9297ACF1ABF8
|
||||
boot_app0.bin F94C5D786A7A8FAB06AC5D10E33BF37711A6697636DC037559EA19CC410A17F0
|
||||
firmware.bin 40C938AA38897BF31AAA472CDF3A942B6EA1D3EF3397591DC5D9DEC61B60E1E2
|
||||
partitions.bin 0A8B5720E7B77FF11F1462458C3A509DEE79224E5279898F26D6A2E3AE0517B7
|
||||
BIN
firmware/cyd/boot_app0.bin
Normal file
BIN
firmware/cyd/boot_app0.bin
Normal file
Binary file not shown.
BIN
firmware/cyd/bootloader.bin
Normal file
BIN
firmware/cyd/bootloader.bin
Normal file
Binary file not shown.
BIN
firmware/cyd/firmware.bin
Normal file
BIN
firmware/cyd/firmware.bin
Normal file
Binary file not shown.
5
firmware/cyd/flash.bat
Normal file
5
firmware/cyd/flash.bat
Normal file
@@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0flash.ps1" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
98
firmware/cyd/flash.ps1
Normal file
98
firmware/cyd/flash.ps1
Normal file
@@ -0,0 +1,98 @@
|
||||
# Flash archived CYD Web Radio firmware (no rebuild needed)
|
||||
# Usage:
|
||||
# .\flash.ps1
|
||||
# .\flash.ps1 -Port COM5
|
||||
# .\flash.ps1 -Port COM5 -Baud 460800
|
||||
|
||||
param(
|
||||
[string]$Port = "",
|
||||
[int]$Baud = 921600
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
Set-Location $here
|
||||
|
||||
function Find-Esptool {
|
||||
$pio = Get-Command pio -ErrorAction SilentlyContinue
|
||||
if (-not $pio) {
|
||||
$pioPath = Join-Path $env:USERPROFILE "AppData\Local\Programs\Python\Python312\Scripts\pio.exe"
|
||||
if (Test-Path $pioPath) {
|
||||
$env:Path = "$(Split-Path $pioPath);$env:Path"
|
||||
$pio = Get-Command pio -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
if ($pio) {
|
||||
$pkg = Join-Path $env:USERPROFILE ".platformio\packages\tool-esptoolpy\esptool.py"
|
||||
if (Test-Path $pkg) { return @{ Kind = "py"; Path = $pkg } }
|
||||
}
|
||||
$py = Get-Command python -ErrorAction SilentlyContinue
|
||||
if ($py) {
|
||||
try {
|
||||
& python -c "import esptool" 2>$null
|
||||
if ($LASTEXITCODE -eq 0) { return @{ Kind = "mod"; Path = "esptool" } }
|
||||
} catch {}
|
||||
}
|
||||
$esp = Get-Command esptool.py -ErrorAction SilentlyContinue
|
||||
if ($esp) { return @{ Kind = "py"; Path = $esp.Source } }
|
||||
return $null
|
||||
}
|
||||
|
||||
if (-not $Port) {
|
||||
$ports = @()
|
||||
try {
|
||||
Add-Type -AssemblyName System.IO.Ports -ErrorAction SilentlyContinue | Out-Null
|
||||
$ports = [System.IO.Ports.SerialPort]::GetPortNames() | Sort-Object
|
||||
} catch {}
|
||||
if (-not $ports -or $ports.Count -eq 0) {
|
||||
$ports = Get-CimInstance Win32_SerialPort -ErrorAction SilentlyContinue |
|
||||
Select-Object -ExpandProperty DeviceID | Sort-Object
|
||||
}
|
||||
if (-not $ports -or $ports.Count -eq 0) {
|
||||
Write-Error "No serial ports found. Plug in the CYD USB cable, then retry with -Port COMx"
|
||||
}
|
||||
if ($ports.Count -eq 1) {
|
||||
$Port = $ports[0]
|
||||
} else {
|
||||
Write-Host "Available ports: $($ports -join ', ')"
|
||||
$Port = $ports[-1]
|
||||
Write-Host "Using last port: $Port (override with -Port)"
|
||||
}
|
||||
}
|
||||
|
||||
$tool = Find-Esptool
|
||||
if (-not $tool) {
|
||||
Write-Error "esptool not found. Install PlatformIO (`pio`) or: pip install esptool"
|
||||
}
|
||||
|
||||
$needed = @("bootloader.bin", "partitions.bin", "boot_app0.bin", "firmware.bin")
|
||||
foreach ($f in $needed) {
|
||||
if (-not (Test-Path (Join-Path $here $f))) {
|
||||
Write-Error "Missing $f — run ..\export_from_build.ps1 from repo root first"
|
||||
}
|
||||
}
|
||||
|
||||
$argsCommon = @(
|
||||
"--chip", "esp32",
|
||||
"--port", $Port,
|
||||
"--baud", "$Baud",
|
||||
"--before", "default_reset",
|
||||
"--after", "hard_reset",
|
||||
"write_flash", "-z",
|
||||
"--flash_mode", "dio",
|
||||
"--flash_freq", "40m",
|
||||
"--flash_size", "4MB",
|
||||
"0x1000", "bootloader.bin",
|
||||
"0x8000", "partitions.bin",
|
||||
"0xe000", "boot_app0.bin",
|
||||
"0x10000", "firmware.bin"
|
||||
)
|
||||
|
||||
Write-Host "Flashing $here -> $Port @ $Baud"
|
||||
if ($tool.Kind -eq "mod") {
|
||||
& python -m esptool @argsCommon
|
||||
} else {
|
||||
& python $tool.Path @argsCommon
|
||||
}
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
Write-Host "Done. Open serial monitor at 460800 if needed."
|
||||
50
firmware/cyd/media/preview.html
Normal file
50
firmware/cyd/media/preview.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Web Radio</title>
|
||||
<style>
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
html,body{width:320px;height:240px;overflow:hidden;background:#000;margin:0}
|
||||
.bezel{width:320px;height:240px;background:#1a1408}
|
||||
.screen{width:320px;height:240px;background:#0A1016;color:#EAF0F6;font:12px/1.2 system-ui,sans-serif;position:relative;overflow:hidden}
|
||||
.muted{color:#7A8B9C}.ok{color:#3DDC97}.acc{color:#4FC3F7}
|
||||
.btn{border:0;border-radius:8px;background:#243140;color:#EAF0F6;font-weight:600;height:38px}
|
||||
.btn.acc{background:#1A4A6E}.btn.warn{background:#6B3A1E}
|
||||
.title{position:absolute;left:10px;top:6px;font-size:16px;font-weight:700;color:#4FC3F7}
|
||||
.wifi{position:absolute;right:10px;top:8px;font-size:11px;color:#7A8B9C}
|
||||
.st{position:absolute;left:10px;right:10px;top:30px;font-size:14px;white-space:nowrap;overflow:hidden}
|
||||
.stat{position:absolute;left:10px;top:52px;font-size:12px;color:#3DDC97}
|
||||
.vol{position:absolute;right:10px;top:52px;font-size:12px;color:#7A8B9C}
|
||||
.bar{position:absolute;left:8px;right:8px;top:72px;display:flex;gap:6px;justify-content:space-between}
|
||||
.bar .btn{flex:1;font-size:11px}
|
||||
.list{position:absolute;left:8px;right:8px;top:118px;bottom:42px;background:#1C2A38;border-radius:8px;padding:4px;overflow:hidden}
|
||||
.row{height:28px;margin-bottom:4px;border-radius:6px;background:#1A4A6E;display:flex;align-items:center;padding:0 8px;font-size:12px}
|
||||
.row.dim{background:#243140}
|
||||
.foot{position:absolute;left:8px;bottom:6px}
|
||||
.foot .btn{width:120px;height:34px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="bezel"><div class="screen">
|
||||
<div class="title">Web Radio</div>
|
||||
<div class="wifi">HomeWiFi -52dBm</div>
|
||||
<div class="st">SomaFM Groove Salad</div>
|
||||
<div class="stat">Playing</div>
|
||||
<div class="vol">Vol 60%</div>
|
||||
<div class="bar">
|
||||
<button class="btn" type="button">Prev</button>
|
||||
<button class="btn acc" type="button">Stop</button>
|
||||
<button class="btn" type="button">Next</button>
|
||||
<button class="btn" type="button">Vol-</button>
|
||||
<button class="btn" type="button">Vol+</button>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="row">SomaFM Groove Salad</div>
|
||||
<div class="row dim">SomaFM Drone Zone</div>
|
||||
<div class="row dim">SomaFM Indie Pop</div>
|
||||
</div>
|
||||
<div class="foot"><button class="btn warn" type="button">WiFi Setup</button></div>
|
||||
</div></div>
|
||||
</body>
|
||||
</html>
|
||||
16
firmware/cyd/meta.json
Normal file
16
firmware/cyd/meta.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"boardId": "esp32-2432s028",
|
||||
"name": "CYD Web Radio",
|
||||
"summary": "Internet MP3 radio with on-screen WiFi setup; speaker on GPIO26",
|
||||
"description": "LVGL WiFi provisioning then station list. Streams HTTP MP3 via ESP8266Audio to internal DAC2 (GPIO26 only — never GPIO25). Credentials in NVS.",
|
||||
"tags": [
|
||||
"wifi",
|
||||
"radio",
|
||||
"audio",
|
||||
"mp3",
|
||||
"touch"
|
||||
],
|
||||
"media": {
|
||||
"preview": "media/preview.html"
|
||||
}
|
||||
}
|
||||
BIN
firmware/cyd/partitions.bin
Normal file
BIN
firmware/cyd/partitions.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user