Repository navigation
Expand file tree
/
Copy pathsdkconfig.defaults
More file actions
112 lines (96 loc) · 6.72 KB
/
Copy pathsdkconfig.defaults
File metadata and controls
112 lines (96 loc) · 6.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Tick rate. Originally raised for Arduino-as-IDF-component; kept because the existing
# timing code assumes a 1 ms tick.
CONFIG_FREERTOS_HZ=1000
# Index 1 is OpenShock's own (TaskUtils::kNotifyIndex), so its wakes and ESP-IDF's index-0 waits can't interfere
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
# Keep the main task large enough for the init chain.
CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384
# WiFi/IP event handlers (WiFiManager, GatewayConnectionManager) now run directly
# on the default event loop task instead of Arduino's separate 4096-byte event
# task. They do flatbuffer serialization + websocket broadcast, so restore that
# headroom here (default is 2304).
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
# Let application use exceptions-free C++ (matches build_flags -fno-exceptions)
CONFIG_COMPILER_CXX_EXCEPTIONS=n
# Captive portal serves HTTP + WebSocket from a single esp_http_server. WebSocket
# support is compiled out of esp_http_server by default; enable it or the httpd_ws_*
# symbols don't exist.
CONFIG_HTTPD_WS_SUPPORT=y
# The URI handler is not called for the handshake itself, so greeting a new client (the Ready message with the config
# and valid GPIO pins) needs the post-handshake callback.
CONFIG_HTTPD_WS_POST_HANDSHAKE_CB_SUPPORT=y
# Lets /ws refuse a handshake addressed to another host before httpd answers it (WebSocketEndpoint::wsPreHandshake).
CONFIG_HTTPD_WS_PRE_HANDSHAKE_CB_SUPPORT=y
# Nothing subscribes to ESP_HTTP_SERVER_EVENT; posting them only adds traffic to the default event loop's queue,
# which the WiFi, IP and OpenShock events depend on.
CONFIG_HTTPD_ENABLE_EVENTS=n
# Keep the RMT TX ISR running while the flash cache is off (OTA erase, config writes). Otherwise it is masked for the
# whole flash operation and a frame longer than the channel's 64-symbol memory block runs dry mid-transmission: a
# corrupted RF frame or LED colour. Costs some IRAM; frame buffers must be in internal RAM (they are: heap and stack).
CONFIG_RMT_TX_ISR_CACHE_SAFE=y
# TLS server-cert verification uses the mbedTLS certificate bundle. We compile in
# our own curated trust store (certificates/cacert-merged.pem) instead of IDF's built-in
# Mozilla list, so DEFAULT_NONE + a custom bundle. esp_http_client and
# esp_websocket_client attach it via config.crt_bundle_attach = esp_crt_bundle_attach.
#
# cacert-merged.pem is generated by certificates/cert_bundle.py: the verbatim curl/Mozilla
# base (certificates/cacert-curl.pem, checksum-verified on download) followed by
# certificates/pinned_certs/*.pem. Pinned roots cover anchors the Mozilla base has retired
# but our infra still chains through (e.g. GlobalSign Root CA R1, which cross-signs GTS
# Root R4). `cert_bundle.py audit` (the pinned-cert-audit CI workflow) monitors their
# expiry and relevance.
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE=y
CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE=y
CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="certificates/cacert-merged.pem"
# Partition table: every board uses the same 4 MB OTA layout (app0/app1 1.6 MB each plus
# cfg/www/coredump). Set it here so a build without a board fragment (e.g. the
# VS Code ESP-IDF extension) does not fall back to IDF's 1 MB single-app table, which
# the app overflows and which has no www partition for the captive-portal assets.
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/ota_4mb.csv"
# The config lives in the dedicated `cfg` NVS partition (components/config); the shared `nvs` at 0x9000 is
# ESP-IDF's own (PHY calibration cache) and may be erased at any time. The WiFi driver's NVS store
# (nvs.net80211: one STA profile, one AP profile) cannot express the credential list the config keeps,
# and WiFiManager already runs the driver with WIFI_STORAGE_RAM; compiling the store out drops the
# module from the image and an NVS read at startup.
CONFIG_ESP_WIFI_NVS_ENABLED=n
# The CONFIG_ARDUINO_SELECTIVE_* block that used to live here is gone. Arduino is no
# longer a component of this project - it is in neither dependencies.lock nor any
# idf_component.yml - so kconfgen reported every one of those symbols as unknown and
# discarded it. They were fourteen lines that did nothing.
# Boot a freshly flashed OTA image as PENDING_VERIFY so otaSetup() validates it and a
# broken image rolls back to the previous slot instead of boot-looping. Needs the
# bootloader built with this option; devices that only receive OTA app updates keep
# their old bootloader and boot new images without the verify step.
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
# Parse JSON as RFC 8259 only. In lenient mode jsmn accepts input like {a:1} or {"x":{"a"},"b":1} and the
# navigation code can then return the wrong value for a key.
CONFIG_JSMN_STRICT=y
# Keep crash dumps in the (otherwise unused) coredump partition so field crashes can be read back over serial.
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
# Captive portal httpd uses max_open_sockets (8) + 3 internal sockets, plus DNS server, HTTP client and gateway
# websocket sockets; the default of 10 would make httpd_start fail.
CONFIG_LWIP_MAX_SOCKETS=16
# The receive window caps a download at one window per round trip, and while an OTA erases a 64 KB flash block the
# sender stalls once the window is full (the download and the flash writes share one task). The 5760-byte default
# allows ~190 KB/s at 30 ms RTT; 16 KB lets the network keep going through an erase. A window is a promise, not an
# allocation: only data actually queued and unread uses heap, but that peak now applies to every TCP socket. The
# recvmbox holds received pbufs, so it is raised to cover a full window of segments. Measure OTA time and heap on a
# device (PartitionUtils logs the breakdown) before keeping this.
CONFIG_LWIP_TCP_WND_DEFAULT=16384
CONFIG_LWIP_TCP_RECVMBOX_SIZE=16
# The same for sending: lwIP stops accepting writes once this much is unacknowledged, so at the 5760-byte default a
# portal asset or a websocket burst goes out one round trip per 5.7 KB. Like the window it bounds queued data, it is
# not allocated up front.
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=16384
# Resume TLS sessions: a reconnect then skips certificate chain verification and the key exchange, about a second
# of CPU each. GatewayClient and HTTP::Client keep the session of their last connection and only offer it to the host
# that issued it.
CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS=y
# The gateway websocket and the kept-alive HTTP client each hold a TLS session. With static
# buffers every session keeps a 16 KB input + 4 KB output record buffer for its whole life;
# dynamic buffers allocate them per record and shrink while idle, lowering the heap peak
# (e.g. while the captive portal links an account). Verify heap and throughput on a device.
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y