Files
serverinfotest/README.md
DESKTOP-PUHFO60\dsx2016 f724796359 Add CYD host PC info panel with serial SI protocol and LVGL bars.
ESP32 shows CPU/GPU/RAM/disk from host/send_sysinfo.ps1 over USB; firmware packages for 2.8 and 3.5 included.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-27 20:13:09 +08:00

63 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CYD 本机 / 服务器信息面板
在 **2.8" / 3.5" CYD** 上显示当前电脑的 **CPU、GPU、内存、磁盘** 等主要信息。显示/触控骨架对齐 [tftest](../tftest) / [wifitest](../wifitest);板型差异按 [CYD_PROJECT_GUIDE.md](../CYD_PROJECT_GUIDE.md)。
| 板型 | env | 屏 / 触控 | 背光 |
|------|-----|-----------|------|
| **2.8" · 2432S028R** | `cyd`(默认) | ILI9341 + XPT2046 SoftSPI | GPIO**21** |
| **3.5" · 3248S035C** | `cyd_35r` | ST7796 + GT911 I2C | GPIO**27** |
本工程**无外设接线**(只吃 USB 供电 + 串口)。
## 原理
ESP32 无法直接读 PC 硬件。本机跑 [`host/send_sysinfo.ps1`](host/send_sysinfo.ps1),经 **USB 串口** 按行推送:
```
SI|host=DESKTOP|cpu=i7-13700K|cpu%=12.3|gpu=RTX 4070|gpu%=5|ram=18.2/31.8|disk=512/931
```
屏上 LVGL 面板解析后画进度条;超过约 5 秒无新包显示 **stale**。
GPU 占用:优先 `nvidia-smi`,否则尝试 Windows GPU Engine 计数器;都失败则显示 `n/a`(名称仍可读)。
## 刷写
| 板型 | 目录 |
|------|------|
| 2.8" | [`firmware/cyd/`](firmware/cyd/) |
| 3.5" | [`firmware/cyd_35r/`](firmware/cyd_35r/) |
```powershell
cd firmware\cyd # 或 firmware\cyd_35r
.\flash.ps1
# 或
.\flash.ps1 -Port COM3
```
源码烧录:`pio run -e cyd -t upload`(3.5:`-e cyd_35r`)
重新打包:`.\firmware\export_from_build.ps1`(3.5 加 `-Env cyd_35r`)
串口监视:`pio device monitor -b 460800`
## 推送本机信息
板子刷好并插上 USB 后,在 **PC** 上:
```powershell
cd host
.\send_sysinfo.ps1
# 或
.\send_sysinfo.ps1 -Port COM5 -IntervalMs 1000
```
注意:串口同时只能被一个程序占用;跑推送脚本时不要开 `pio device monitor`。
## 文件
```
include/pins.h, touch.h, host_info.h, ui.h, lv_conf.h
src/main.cpp, touch.cpp, host_info.cpp, ui.cpp
host/send_sysinfo.ps1
firmware/
```