Add AP+STA WiFi manager and stabilize balancing

- Replace wifi.cpp/wifi.h with wifi_manager.cpp/wifi_manager.h: AP and STA
  run together, external WiFi credentials are stored in NVS and editable at
  /wifi, with optional static IP, 15s auto-reconnect, disconnect reason
  reporting, and build/version diagnostics
- Fix MPU6050 I2C port to I2C0 to match the board wiring
- Initialize distance_zeropoint at startup and on Robot Go! rising edge
- Clamp angle_zeropoint to +/-10 degrees to prevent balance-point drift
- Add DEBUG_DISABLE_YAW switch and periodic balance debug output
- Update WiFi setup instructions in README.md and README_CN.md
This commit is contained in:
deepseek Bot committed 2026-10-25 19:15:17 +08:00
1 parent 324d114386
commit 5d9e5f73b0
7 files changed
+700 -88

No files matched your search

+4 -1
View File
@@ -280,6 +280,9 @@ const char basic_web[] PROGMEM = R"=====(
<!-- onload 事件在页面载入完成后立即触发 -->
<body onload="javascript:socket_init()">
<h2>WL-PRO WiFi遥控模式</h2>
<div style="text-align:center;margin:-4px 0 10px;">
<a href="/wifi" style="color:#6495ed;font-size:15px;">WiFi 设置 / WiFi Settings</a>
</div>
<div class="view2">
<input type="checkbox" id="stable" class="switch" onclick="is_stable()" style="vertical-align:middle">Robot Go!</input>
</div>
@@ -334,7 +337,7 @@ const char basic_web[] PROGMEM = R"=====(
function socket_init() {
// 初始化websocket客户端
//socket = new WebSocket('ws://' + '192.168.4.1' + ':81/'); // AP模式
socket = new WebSocket('ws://' + window.location.hostname + ':81/'); // sta模式
socket = new WebSocket('ws://' + window.location.hostname + ':81/'); // AP/STA通用
}
function setroll() {