Researched the exact modules the user is building with and fixed three
concrete issues the earlier speculative firmware got wrong:
1. WiFi: confirmed the target board (Waveshare ESP32-P4-Module-DEV-KIT,
chip ESP32-P4NRW32) bridges WiFi through an onboard ESP32-C6
co-processor over a fixed 7-pin SDIO link (CLK18/CMD19/D0-14/D1-15/
D2-16/D3-17/RESET54, cross-confirmed against Espressif's own
esp-hosted-mcu docs). wifi_manager.c's esp_wifi_init()/esp_wifi_start()
calls don't need to change — esp_wifi_remote/esp_hosted provide a
drop-in-compatible API — but the component manifest (new
main/idf_component.yml) and sdkconfig.defaults were missing entirely.
2. Real pin conflict: the presence sensor's original UART pins (17/18)
directly collided with the SDIO CLK/D3 pins above — wiring it there
would have broken WiFi, the sensor, or both. Moved to GPIO4/5.
3. Swapped placeholder parts for the user's actual hardware:
- BME280 -> BMP280 (GY-BMP280 module): temp+pressure only, no humidity.
Rewrote the driver rather than just renaming it — the old code would
have read nonexistent humidity registers and reported garbage
forever. 3.3V-only wiring note added (the BME280 assumption of
5V-tolerant logic doesn't hold for this specific breakout).
- LD2410 -> RD-03E (Ai-Thinker, not Hi-Link — a different manufacturer
with a different, incompatible UART protocol). Rewrote the frame
parser against the RD-03E's actual (if less-documented) 5-byte
simple-report format. Reports numeric distance instead of a boolean,
which better fits both the hardware's actual output and the backend's
statistical anomaly detector.
README, CMakeLists.txt, and all cross-references updated to match.
50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
# Default sdkconfig overrides for the Quantumancy sensor node.
|
|
#
|
|
# These are seed values applied when `idf.py set-target esp32p4` generates the
|
|
# real `sdkconfig` (which is machine/toolchain-specific and NOT committed —
|
|
# see .gitignore). UNVERIFIED: nobody has run `idf.py build` against a real
|
|
# ESP-IDF install for this project, so treat these as reasonable, standard
|
|
# starting points rather than confirmed-working values.
|
|
|
|
CONFIG_IDF_TARGET="esp32p4"
|
|
|
|
# --- Wi-Fi via the onboard ESP32-C6 co-processor (esp_wifi_remote/esp_hosted) ---
|
|
# The ESP32-P4 has no integrated Wi-Fi radio. On the target hardware
|
|
# (Waveshare ESP32-P4-Module-DEV-KIT), an ESP32-C6 co-processor is wired to
|
|
# it over SDIO — 7 fixed pins: CLK=18, CMD=19, D0=14, D1=15, D2=16, D3=17,
|
|
# RESET=54 — and esp_hosted/esp_wifi_remote handle those transparently once
|
|
# configured; wifi_manager.c's esp_wifi_init()/esp_wifi_start() calls need
|
|
# no changes. These CONFIG values match Espressif's own reference
|
|
# ESP32-P4-Function-EV-Board, whose SDIO pin assignment is identical to
|
|
# Waveshare's board (verified against two independent sources) — still,
|
|
# this is the single most important thing to confirm against the physical
|
|
# board before flashing, since it was never run against real hardware.
|
|
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
|
|
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
|
|
CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y
|
|
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16
|
|
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64
|
|
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64
|
|
CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
|
|
CONFIG_WIFI_RMT_TX_BA_WIN=32
|
|
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
|
|
CONFIG_WIFI_RMT_RX_BA_WIN=32
|
|
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
|
|
CONFIG_LWIP_TCP_WND_DEFAULT=65534
|
|
|
|
# The backend is served over HTTPS in production (see deploy/), so the HTTP
|
|
# client needs mbedTLS's bundled CA store to verify the TLS cert.
|
|
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
|
|
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
|
|
|
|
# Headroom for the main task: JSON body construction (cJSON) plus
|
|
# esp_http_client happen on it via the telemetry task.
|
|
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
|
|
|
|
# A handful of sockets is plenty for one outbound HTTP client + Wi-Fi/LWIP
|
|
# housekeeping; keeps RAM use predictable on a sensor node.
|
|
CONFIG_LWIP_MAX_SOCKETS=16
|
|
|
|
# Reasonably quiet serial log output by default (bump to DEBUG for bring-up).
|
|
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|