Skip to content

Commit 2aa007f

Browse files
committed
improve esp8266 idle profile
1 parent 9d203f1 commit 2aa007f

5 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Added `ZeroNetProfileEsp8266`, a constrained MQTT-first preset for Wemos / ESP8266.
1212
- Added optional offline queue gating in `ZeroHttpPump` and `ZeroMqttPump` so constrained boards can refuse backlog when link or transport is down.
1313
- Reduced scheduler contention in the ESP8266 preset by staggering network task start offsets and lowering idle network task cadence.
14+
- Updated the ESP8266 preset to recommend `kIdleYield` instead of `kIdleSleep`, which materially reduces live timing jitter in the official Wemos validation node.
1415
- Added generic compare workloads for `EnvMonitor`, `TelemetryGateway`, and `IndustrialLoop`.
1516
- Added repeatable ESP32 compare runners plus a cross-target workload compile matrix.
1617
- Improved telemetry gateway tuning so module throughput rises without queue buildup.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Current target maturity:
117117
Recommended board-specific path:
118118

119119
- **ESP32:** use the default network module configs first, then validate against your real endpoint.
120-
- **ESP8266 / Wemos:** start with `ZeroNetProfileEsp8266`. It is a BETA, MQTT-first constrained preset that disables periodic HTTP dispatch by default, prevents offline queue buildup, and staggers slower network task cadence so constrained boards do not need heavy manual tuning just to stay responsive.
120+
- **ESP8266 / Wemos:** start with `ZeroNetProfileEsp8266`. It is a BETA, MQTT-first constrained preset that disables periodic HTTP dispatch by default, prevents offline queue buildup, staggers slower network task cadence, and recommends a lighter idle strategy so constrained boards do not need heavy manual tuning just to stay responsive.
121121

122122
Current best module tradeoff reference (ESP32, `LEAN_NET`, manual pattern vs module pattern):
123123

docs/wiki/Beta-Modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ They are already useful and validated on desktop plus ESP32 smoke tests, but the
1818

1919
Recommended default:
2020

21-
- For constrained ESP8266 boards, start with `ZeroNetProfileEsp8266`. It is a BETA, MQTT-first constrained preset that keeps HTTP degraded by default and rejects offline queueing so the board stays more predictable without hand-tuning every interval.
21+
- For constrained ESP8266 boards, start with `ZeroNetProfileEsp8266`. It is a BETA, MQTT-first constrained preset that keeps HTTP degraded by default, rejects offline queueing, and uses a lighter recommended idle strategy plus staggered network task starts so the board stays more predictable without hand-tuning every interval.
2222

2323
## What BETA Means Here
2424

examples/LiveNetworkNode/LiveNetworkNode.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,11 @@ void setup() {
401401
g_mqttTransport.setNoDelay(true);
402402

403403
ZeroKernel.begin(boardMillis);
404+
#if defined(ARDUINO_ARCH_ESP8266)
405+
ZeroKernel.setIdleStrategy(ZeroNetProfileEsp8266::kRecommendedIdleStrategy);
406+
#else
404407
ZeroKernel.setIdleStrategy(Kernel::kIdleSleep);
408+
#endif
405409
ZeroKernel.subscribeTypedFast(kWiFiStateTopic, onTypedState);
406410
ZeroKernel.subscribeTypedFast(kMqttStateTopic, onTypedState);
407411

src/modules/net/ZeroNetProfileEsp8266.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace net {
1212
// Recommended constrained-network preset for ESP8266-class boards.
1313
// This profile intentionally prefers MQTT cadence over aggressive HTTP churn.
1414
struct ZeroNetProfileEsp8266 {
15+
static const uint8_t kRecommendedIdleStrategy = Kernel::kIdleYield;
1516
static const unsigned long kSampleTaskIntervalMs = 100UL;
1617
static const unsigned long kWiFiTaskIntervalMs = 250UL;
1718
static const unsigned long kHttpTaskIntervalMs = 250UL;

0 commit comments

Comments
 (0)