Commit Graph
12680 Commits
Author SHA1 Message Date
J. Nick Koston 2dd767ed3f [json] Bump heap fallback cap from 4096 to 5120
Aligns with the doubling sequence from 640: 1280 -> 2560 -> 5120.
2026-02-18 18:10:29 -06:00
J. Nick Koston d967f47f3e [json] Increase SerializationBuffer stack size from 512 to 640 bytes
The reduction from 768 to 512 was overly aggressive - the stack
overflow was caused by the 1400+ byte multipart parser, not the
serialization buffer. 640 bytes covers climate DETAIL_ALL payloads
(~520 bytes) on the stack without heap fallback.
2026-02-18 18:07:23 -06:00
J. Nick Koston bb6600985f [json] Make heap fallback max size constexpr 2026-02-18 17:53:29 -06:00
J. Nick Koston 1ba1ab7fe2 [json] Document heap fallback buffer sizing expectations
Payloads exceeding 1024 bytes are not known to exist in real
configurations. One doubling iteration covers all known entity types.
Cap at 4096 as a safety limit.
2026-02-18 17:53:12 -06:00
J. Nick Koston 90ed0db0d9 [json] Replace measureJson() with doubling strategy in heap fallback
Avoids instantiating DummyWriter templates (~736 bytes flash) by
doubling the heap buffer until the payload fits. The temporary
over-allocation (at most 2x) is acceptable since payloads exceeding
the 512-byte stack buffer are rare.
2026-02-18 17:51:20 -06:00
J. Nick Koston 6a7925b3ce [json] Fix SerializationBuffer truncation when payload exceeds stack buffer
ArduinoJson's serializeJson() with a bounded buffer returns the actual
bytes written (truncated count), NOT the would-be size like snprintf().
When the payload exceeded the 512-byte stack buffer, the return value
was used as the exact size for heap reallocation, but this was only the
truncated count. The heap buffer was allocated too small, the second
serialization was also truncated, and no NUL terminator was written.

This caused corrupted JSON in SSE streams for entities with payloads
exceeding 512 bytes (e.g., climate DETAIL_ALL with many features).

Fix: use measureJson() in the heap fallback path to get the exact
untruncated size before allocating. Also add the missing set_size_()
call after the second serialization to ensure proper NUL termination.
2026-02-18 17:36:56 -06:00
J. Nick Koston aa870483f1 Reduce SerializationBuffer stack size from 768 to 512 bytes
768 bytes on the httpd task stack contributes to stack overflow when
combined with other stack-allocated buffers (query string parsing, etc.).
512 bytes still covers all typical JSON payloads (sensors ~200B, lights
~170B, climate ~500-700B). Only extreme edge cases with 40+ options
trigger heap fallback.
2026-02-11 18:58:28 -06:00
J. Nick Koston 840ad30880 Merge branch 'dev' into json_web_server_stack 2026-01-29 14:48:48 -10:00
J. Nick Koston cfe121b38b private implementation details 2026-01-29 18:45:18 -06:00
J. Nick Koston 5fbd9d5b14 avoid misuse 2026-01-29 18:23:25 -06:00
J. Nick Koston 2b1783ce61 tweak 2026-01-29 18:19:29 -06:00
J. Nick Koston 904072ce79 make sure NRVO works 2026-01-29 18:17:34 -06:00
J. Nick Koston 0a4b98d74a fix double templates 2026-01-29 17:43:26 -06:00
David Woodhouseandpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> 823b5ac1ab [ch423] Add CH423 I/O expander component (#13079)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-01-29 18:16:15 -05:00
J. Nick Koston b8017de724 avoid regressing performance of mqtt 2026-01-29 16:55:20 -06:00
J. Nick Koston ca96604582 change all the cases 2026-01-29 16:49:28 -06:00
J. Nick Koston d18d378f06 missed a few 2026-01-29 16:27:28 -06:00
J. Nick Koston 83e3752544 missed a few 2026-01-29 16:26:50 -06:00
J. Nick Koston 0490b2d450 no dummy 2026-01-29 16:24:30 -06:00
J. Nick Koston 55ff740e4e no dummy 2026-01-29 16:23:41 -06:00
J. Nick Koston aba8a83cba ard as well 2026-01-29 16:02:32 -06:00
J. Nick Koston a23809d5db fixes 2026-01-29 15:41:29 -06:00
J. Nick Koston 32fc3ea6f5 config stack 2026-01-29 15:33:24 -06:00
J. Nick Koston deb8ffd348 json webserver stack 2026-01-29 15:26:37 -06:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 6de2049076 Bump actions/cache from 5.0.2 to 5.0.3 in /.github/actions/restore-python (#13622)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-29 14:35:52 -06:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> cd43f8474e Bump actions/cache from 5.0.2 to 5.0.3 (#13621)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-29 14:35:32 -06:00
J. Nick Koston ecc0b366b3 [esp32] Reduce compile time by excluding unused IDF components (#13610) 2026-01-29 13:21:12 -06:00
tomaszduda23 6a17db8857 [nrf52,zigbee] Support for number component (#13581) 2026-01-29 11:52:46 -05:00
Keith Burzinski 0843ec6ae8 [const] Move CONF_AUDIO_DAC (#13614) 2026-01-29 04:39:40 +00:00
J. Nick Koston 74c84c8747 [esp32] Add advanced sdkconfig options to reduce build time and binary size (#13611) 2026-01-28 18:20:39 -10:00
rwrozelle 3e9a6c582e [mdns] Do not broadcast registration when using openthread component (#13592) 2026-01-28 18:16:59 -10:00
Keith Burzinski 084113926c [es8156] Add bits_per_sample validation, comment code (#13612) 2026-01-28 22:03:50 -06:00
J. Nick Koston a5f60750c2 [tx20] Eliminate heap allocations in wind sensor (#13298) 2026-01-29 16:07:41 +13:00
Clyde Stubbs a382383d83 [workflows] Add deprecation check (#13584) 2026-01-29 12:08:45 +13:00
Clyde Stubbs 03cfd87b16 [waveshare_epaper] Add deprecation message (#13583) 2026-01-29 09:44:21 +13:00
Clyde Stubbs 6d8294c2d3 [workflows] Refactor auto-label-pr script into modular JS (#13582) 2026-01-29 09:42:55 +13:00
J. Nick Koston 6a3205f4db [globals] Convert restoring globals to PollingComponent to reduce CPU usage (#13345) 2026-01-28 20:35:26 +00:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 6f22509883 Bump docker/login-action from 3.6.0 to 3.7.0 in the docker-actions group (#13606)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-28 09:42:05 -10:00
J. Nick Koston 455ade0dca [http_request] Fix empty body for chunked transfer encoding responses (#13599) 2026-01-28 09:41:42 -10:00
J. Nick Koston 87fcfc9d76 [wifi] Fix ESP8266 yield panic when WiFi scan fails (#13603) 2026-01-28 09:40:00 -10:00
tomaszduda23 d86048cc2d [nrf52,zigbee] Address change (#13580) 2026-01-28 11:41:04 -05:00
J. Nick Koston e1355de4cb [runtime_stats] Eliminate heap churn by using stack-allocated buffer for sorting (#13586) 2026-01-28 16:06:33 +00:00
Cody Cutrer 7385c4cf3d [ld2450] preserve precision of angle (#13600) 2026-01-28 11:04:43 -05:00
tomaszduda23andJonathan Swoboda 3bd6ec4ec7 [nrf52,zigbee] Time synchronization (#12236)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-01-28 15:51:17 +00:00
J. Nick KostonandCopilot 051604f284 [wifi] Filter scan results to only store matching networks (#13409)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 05:37:05 -10:00
Dan Schafer 10dfd95ff2 [esp32] Add pin definitions for adafruit_feather_esp32s3_reversetft (#13273) 2026-01-28 09:50:19 -05:00
Hypothalamus 22e0a8ce2e [hub75] Add Huidu HD-WF1 board configuration (#13341) 2026-01-27 20:10:49 -10:00
J. Nick Koston b4f63fd992 [core] Add LOG_ENTITY_ICON/DEVICE_CLASS/UNIT_OF_MEASUREMENT macros (#13578) 2026-01-28 05:11:30 +00:00
tomaszduda23andJonathan Swoboda ded835ab63 [nrf52] Move toolchain to platform (#13498)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-01-28 04:51:18 +00:00
J. Nick Koston 73a249c075 [esp32] Default to CMN certificate bundle, saving ~51KB flash (#13574) 2026-01-28 04:02:01 +00:00