Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/api/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ def build_firmware_manifest(version: str, download_url: str, chip_family: str =

def chip_family_from_asset_name(asset_name: str) -> str:
name = (asset_name or "").lower()
if "_s3" in name or "esp32s3" in name or "esp32-s3" in name:
return "ESP32-S3"
if "wroom32e" in name or "_esp32" in name:
return "ESP32"
if "_c3" in name or "esp32c3" in name:
Expand Down
9 changes: 8 additions & 1 deletion backend/tests/test_firmware_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,23 @@ def test_expand_release_assets_returns_multiple_bin_entries():
"size": 1140784,
"browser_download_url": "https://example.com/epd_42_wroom32e.bin",
},
{
"name": "epd_42_yd_s3_n16r8.bin",
"size": 1150000,
"browser_download_url": "https://example.com/epd_42_yd_s3_n16r8.bin",
},
],
}

items = shared_api.expand_firmware_release_assets(release)

assert len(items) == 2
assert len(items) == 3
assert items[0]["asset_name"] == "epd_42_c3.bin"
assert items[0]["chip_family"] == "ESP32-C3"
assert items[1]["asset_name"] == "epd_42_wroom32e.bin"
assert items[1]["chip_family"] == "ESP32"
assert items[2]["asset_name"] == "epd_42_yd_s3_n16r8.bin"
assert items[2]["chip_family"] == "ESP32-S3"


def test_render_api_key_invalid_image_uses_project_font_loader(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion firmware/merge_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def merge_bin(source, target, env):
firmware = str(target[0])
board = env.BoardConfig()
mcu = board.get("build.mcu", "esp32")
flash_mode = "dio"
flash_mode = env.GetProjectOption("board_build.flash_mode", "dio")
flash_freq = board.get("build.f_flash", "40000000L").replace("L", "")
flash_freq_m = str(int(int(flash_freq) / 1000000)) + "m"
flash_size = board.get("upload.flash_size", "4MB")
Expand Down
6 changes: 6 additions & 0 deletions firmware/partitions/inksight_16mb_ota.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000,
app0, app, ota_0, 0x10000, 0x500000,
app1, app, ota_1, 0x510000, 0x500000,
spiffs, data, spiffs, 0xa10000, 0x5f0000,
21 changes: 21 additions & 0 deletions firmware/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ build_flags =
-DEPD_PANEL_42_SSD1683_BW
-DALLOW_INSECURE_FALLBACK=0

[env:epd_42_wsv2_ssd1683_yd_s3_n16r8]
extends = common
board = esp32-s3-devkitc-1
upload_speed = 460800
board_build.flash_mode = qio
board_build.f_flash = 80000000L
board_build.arduino.memory_type = qio_opi
board_build.psram_type = opi
board_build.partitions = partitions/inksight_16mb_ota.csv
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
build_flags =
-DBOARD_PROFILE_YD_ESP32_S3_N16R8
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=0
-DARDUINO_USB_CDC_ON_BOOT=0
-DEPD_WIDTH=400
-DEPD_HEIGHT=300
-DEPD_PANEL_42_SSD1683_BW
-DALLOW_INSECURE_FALLBACK=0

# ── ESP32-WROOM32E + AI Chat (语音对话) ──────────────────────
[env:epd_42_wroom32e_ai_chat]
extends = common
Expand Down
19 changes: 19 additions & 0 deletions firmware/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,26 @@
#endif
#define PIN_LED 5
#define PIN_AI_CHAT_SW -1
#elif defined(BOARD_PROFILE_YD_ESP32_S3_N16R8)
#define PIN_EPD_MOSI 11
#define PIN_EPD_SCK 12
#define PIN_EPD_CS 10
#define PIN_EPD_DC 9
#define PIN_EPD_RST 8
#define PIN_EPD_BUSY 7
#define PIN_BAT_ADC 4
#define PIN_CFG_BTN 0
#define PIN_LED -1
#define PIN_RGB_LED 48
#define PIN_AI_CHAT_SW -1
#else
#error "Unsupported board profile"
#endif

#ifndef PIN_RGB_LED
#define PIN_RGB_LED -1
#endif

// ── Display constants ────────────────────────────────────────
// Default for 4.2" E-Paper (400x300, 1-bit).
// Override via build flags: -D EPD_WIDTH=800 -D EPD_HEIGHT=480
Expand Down Expand Up @@ -118,6 +134,9 @@ static const int VOCAB_EXIT_HOLD_MS = 5000; // Long press duration to exit voc
static const int SHORT_PRESS_MIN_MS = 50; // Minimum short press duration (debounce)
static const int LIVE_POLL_MS = 5000; // Poll interval for pending remote actions
static const int LIVE_WIFI_RETRY_MS = 5000; // Retry interval when WiFi is disconnected
static const unsigned long TEMP_ONLINE_WINDOW_MS = 10UL * 60UL * 1000UL;
static const unsigned long PORTAL_AUTO_TIMEOUT_MS = 3UL * 60UL * 1000UL;
static const unsigned long PORTAL_MANUAL_TIMEOUT_MS = 10UL * 60UL * 1000UL;
static const unsigned long HEARTBEAT_INTERVAL_MS = 10UL * 60UL * 1000UL;
static const int MAX_RETRY_COUNT = 5; // Max retries before deep sleep
// WiFi -> captive portal fallback: when ALL saved networks fail to connect,
Expand Down
Loading
Loading