CONFIG_IDF_TARGET="esp32p4" # Flash (Waveshare ESP32-P4-ETH-POE ships with 16 MB QSPI flash) CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y CONFIG_ESPTOOLPY_FLASHSIZE="16MB" # Partition table CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" # PSRAM (required for 800x480 framebuffer + JPEG decode + local screens). # 200 MHz speed is gated behind IDF_EXPERIMENTAL_FEATURES on ESP32-P4 — # at the default 20 MHz the DPI bridge underruns continuously trying to # feed the panel from PSRAM. 200 MHz gives ~10x more bandwidth and the # DPI runs clean. CONFIG_IDF_EXPERIMENTAL_FEATURES=y CONFIG_SPIRAM=y CONFIG_SPIRAM_MODE_HEX=y CONFIG_SPIRAM_SPEED_200M=y CONFIG_SPIRAM_USE_MALLOC=y CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 # Ethernet (Waveshare ESP32-P4-ETH-POE: internal EMAC + external PHY) CONFIG_ETH_ENABLED=y CONFIG_ETH_USE_ESP32_EMAC=y # LWIP / mDNS CONFIG_LWIP_IPV4=y CONFIG_LWIP_IPV6=y CONFIG_MDNS_MAX_INTERFACES=1 # TCP receive-window kept at IDF defaults (4 × MSS = 5760). An # attempt to raise WND to 65535 regressed g2g from ~100ms to 17s # growing unbounded — the bigger window let Scrypted bury the ESP32 # in queued bytes faster than the single recv→decode→paint task # can drain them, with no way to skip-oldest on the kernel queue. # The real bottleneck is task serialization, not window size; raise # this only once the recv path is on its own FreeRTOS task with a # 1-deep latest-frame slot to the decode/paint task. CONFIG_LWIP_TCP_WND_DEFAULT=5760 CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_SACK_OUT=y # HTTP server CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 CONFIG_HTTPD_MAX_URI_LEN=512 # Main task stack — JPEG decode is hungry CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 # Log level CONFIG_LOG_DEFAULT_LEVEL_INFO=y # OTA: dual-partition layout in partitions.csv. Rollback marks new # images as PENDING_VERIFY at first boot; ota_arm_healthy_timer flips # them to VALID after 30 s of healthy uptime, otherwise the bootloader # reverts to the previous slot on the next reset. CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y