Continuing the web networking work (WiFi/ESP-NOW/MQTT), this PR adds missing runtime control actions that were available over serial but not exposed as dedicated web endpoints/actions.
What changed
Backend routes
In WebServerManager:
Added POST /api/network/wifi/reconnect -> WIFI_RECONNECT
Added POST /api/network/espnow/on -> ESPNOW_ON
Added POST /api/network/espnow/off -> ESPNOW_OFF
Web UI controls
In data/webui/:
Added WiFi reconnect button.
Added MQTT publish form (topic + payload).
Switched ESP-NOW ON/OFF buttons to use dedicated network endpoints (instead of generic control route).
Why
Improve operator workflow from the web UI for live bench tests.
Keep web controls aligned with existing firmware command capabilities.
Reduce friction when testing ESP-NOW/WiFi paths from browser only.
Validation
platformio run -e esp32dev -> SUCCESS
bash scripts/test_terminal.sh -> PASS
Notes
No protocol break introduced.
This PR only touches:
src/web/WebServerManager.cpp
data/webui/index.html
data/webui/script.js
## Context
Continuing the web networking work (WiFi/ESP-NOW/MQTT), this PR adds missing runtime control actions that were available over serial but not exposed as dedicated web endpoints/actions.
## What changed
### Backend routes
In `WebServerManager`:
- Added `POST /api/network/wifi/reconnect` -> `WIFI_RECONNECT`
- Added `POST /api/network/espnow/on` -> `ESPNOW_ON`
- Added `POST /api/network/espnow/off` -> `ESPNOW_OFF`
### Web UI controls
In `data/webui/`:
- Added WiFi reconnect button.
- Added MQTT publish form (topic + payload).
- Switched ESP-NOW ON/OFF buttons to use dedicated network endpoints (instead of generic control route).
## Why
- Improve operator workflow from the web UI for live bench tests.
- Keep web controls aligned with existing firmware command capabilities.
- Reduce friction when testing ESP-NOW/WiFi paths from browser only.
## Validation
- `platformio run -e esp32dev` -> SUCCESS
- `bash scripts/test_terminal.sh` -> PASS
## Notes
- No protocol break introduced.
- This PR only touches:
- `src/web/WebServerManager.cpp`
- `data/webui/index.html`
- `data/webui/script.js`
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### 💡 Codex Review
Here are some automated review suggestions for this pull request.
**Reviewed commit:** `0f71cf24b2`
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
When the payload starts with { or [, parsePayloadValue turns it into an object/array, but the server-side /api/network/mqtt/publish handler reads doc["payload"] into a String (const String payload = doc["payload"] | ""), which falls back to an empty string for non-string JSON values. In practice, submitting JSON payloads (including the default {"ping":true} shown in the new form) publishes an empty payload instead of the intended message.
Useful? React with 👍 / 👎.
**<sub><sub></sub></sub> Keep MQTT publish payload as raw text**
When the payload starts with `{` or `[`, `parsePayloadValue` turns it into an object/array, but the server-side `/api/network/mqtt/publish` handler reads `doc["payload"]` into a `String` (`const String payload = doc["payload"] | ""`), which falls back to an empty string for non-string JSON values. In practice, submitting JSON payloads (including the default `{"ping":true}` shown in the new form) publishes an empty payload instead of the intended message.
Useful? React with 👍 / 👎.
Coordination firmware ok: la PR Zacus https://github.com/electron-rare/le-mystere-professeur-zacus/pull/92 expose maintenant les endpoints /api/network/* + /api/control alignés avec ce que vous poussez ici. Contrat ESP-NOW status/payload inchangé côté interop.
Codex code review (latest head):
Findings:
- One blocking issue was found and fixed in this PR branch:
- MQTT publish UI previously sent parsed JSON object payloads, while firmware `/api/network/mqtt/publish` reads `payload` as string.
- Fix pushed in commit `4f857b4`: publish payload is now sent as raw string.
Validation rerun after fix:
- `platformio run -e esp32dev` -> SUCCESS
- `bash scripts/test_terminal.sh` -> PASS
Current review verdict:
- No remaining blocking findings for PR #8.
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review: Didn't find any major issues. More of your lovely PRs please.
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
electron-rare
(Migrated from github.com)
reviewed 2026-02-20 23:11:44 +00:00
electron-rare
(Migrated from github.com)
left a comment
Copy Link
Copy Source
Codex review rapide du diff RTC #8: pas de régression bloquante détectée. Les endpoints ajoutés sont cohérents avec le WebServerManager et le script WebUI. Point de vigilance mineur: pas de checks CI attachés sur cette branche, donc validation à compléter par build/test RTC avant merge.
Codex review rapide du diff RTC #8: pas de régression bloquante détectée. Les endpoints ajoutés sont cohérents avec le WebServerManager et le script WebUI. Point de vigilance mineur: pas de checks CI attachés sur cette branche, donc validation à compléter par build/test RTC avant merge.
Sync binôme: la PR firmware Zacus #95 couvre maintenant les endpoints web réseau manquants côté Freenove (wifi/reconnect, espnow/on, espnow/off) pour rester en phase avec cette PR RTC.
Sync binôme: la PR firmware Zacus #95 couvre maintenant les endpoints web réseau manquants côté Freenove (`wifi/reconnect`, `espnow/on`, `espnow/off`) pour rester en phase avec cette PR RTC.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
Continuing the web networking work (WiFi/ESP-NOW/MQTT), this PR adds missing runtime control actions that were available over serial but not exposed as dedicated web endpoints/actions.
What changed
Backend routes
In
WebServerManager:POST /api/network/wifi/reconnect->WIFI_RECONNECTPOST /api/network/espnow/on->ESPNOW_ONPOST /api/network/espnow/off->ESPNOW_OFFWeb UI controls
In
data/webui/:Why
Validation
platformio run -e esp32dev-> SUCCESSbash scripts/test_terminal.sh-> PASSNotes
src/web/WebServerManager.cppdata/webui/index.htmldata/webui/script.jsCross-repo context:\n- Zacus coordination issue: https://github.com/electron-rare/le-mystere-professeur-zacus/issues/90\n- Zacus related PR: https://github.com/electron-rare/le-mystere-professeur-zacus/pull/92\n- Kill_LIFE route-parity gate proposal: https://github.com/electron-rare/Kill_LIFE/issues/1\n\nThis PR extends browser-side WiFi/ESP-NOW/MQTT operability without changing the existing interop contract.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
0f71cf24b2ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@@ -211,9 +225,32 @@ function bindEvents() {}When the payload starts with
{or[,parsePayloadValueturns it into an object/array, but the server-side/api/network/mqtt/publishhandler readsdoc["payload"]into aString(const String payload = doc["payload"] | ""), which falls back to an empty string for non-string JSON values. In practice, submitting JSON payloads (including the default{"ping":true}shown in the new form) publishes an empty payload instead of the intended message.Useful? React with 👍 / 👎.
Coordination firmware ok: la PR Zacus https://github.com/electron-rare/le-mystere-professeur-zacus/pull/92 expose maintenant les endpoints /api/network/* + /api/control alignés avec ce que vous poussez ici. Contrat ESP-NOW status/payload inchangé côté interop.
Codex code review (latest head):
Findings:
/api/network/mqtt/publishreadspayloadas string.4f857b4: publish payload is now sent as raw string.Validation rerun after fix:
platformio run -e esp32dev-> SUCCESSbash scripts/test_terminal.sh-> PASSCurrent review verdict:
@codex review
Codex Review: Didn't find any major issues. More of your lovely PRs please.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review rapide du diff RTC #8: pas de régression bloquante détectée. Les endpoints ajoutés sont cohérents avec le WebServerManager et le script WebUI. Point de vigilance mineur: pas de checks CI attachés sur cette branche, donc validation à compléter par build/test RTC avant merge.
Sync binôme: la PR firmware Zacus #95 couvre maintenant les endpoints web réseau manquants côté Freenove (
wifi/reconnect,espnow/on,espnow/off) pour rester en phase avec cette PR RTC.