# Performance Monitor - MicroPython
**Repository Path**: walkline/performance-monitor-micropython
## Basic Information
- **Project Name**: Performance Monitor - MicroPython
- **Description**: PC 性能监视器客户端,使用 MicroPython 驱动 TFT 屏幕实时显示硬件性能
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 5
- **Forks**: 2
- **Created**: 2022-01-31
- **Last Updated**: 2025-07-17
## Categories & Tags
**Categories**: hardware
**Tags**: None
## README
Performance Monitor - MicroPython

### 项目介绍
使用 TFT 屏幕显示从 [Performance Monitor - CSharp](https://gitee.com/walkline/performance-monitor-csharp) 服务端接收到的硬件使用率信息
| 设计效果 | 实际效果 |
| :-: | :-: |
|  |  |
### 使用方法
1. 烧录固件
```bash
$ ab --flash
```
2. 上传程序文件
```bash
$ ab
```
3. 重启开发板
4. PC 运行 [HardwareMonitor.exe](https://gitee.com/walkline/performance-monitor-csharp/releases) 并点击`Start`
5. 观察屏幕变化
### 乱入内容
项目增加`game_of_life.py`文件,运行后可以模拟生命游戏演化进程
### 附录:生成包含字库文件的固件
新建一个文件夹`demo`,后续操作将在这个文件夹中进行
```bash
$ mkdir demo
```
#### 克隆相关项目
1. 克隆`FontMaker Client`项目,并切换到`binary`分支
```bash
$ cd demo
$ git clone https://gitee.com/walkline/fontmaker-client.git
$ cd fontmaker-client/
$ git checkout binary
```
2. 克隆`资源管理器`项目,并准备临时目录`workshop`
```bash
$ cd ..
$ git clone https://gitee.com/walkline/micropython-resource-manager.git
$ cd micropython-resource-manager
$ mkdir workshop/firmware
$ mkdir workshop/fonts/fonts
```
> 资源管理器需要在编译的固件中增加`资源分区`,设置方法参考 [修改分区表文件](https://gitee.com/walkline/micropython-resource-manager#%E4%BF%AE%E6%94%B9%E5%88%86%E5%8C%BA%E8%A1%A8%E6%96%87%E4%BB%B6) 章节中的说明
#### 生成字库文件
1. 准备一个包含任意`ASCII`字符的文本文件
```bash
$ cd ../fontmaker-client/
$ echo 1 >> ascii.txt
```
2. 生成字库文件
> 目标字体务必使用英文等宽字体并提前安装,如 JetBrains Mono
```bash
$ FontMaker_Cli.exe -f "JetBrains Mono" -b -s 20 -w 10 --input ascii.txt -sh -o font_20.bin
$ FontMaker_Cli.exe -f "JetBrains Mono" -b -s 28 -w 14 --input ascii.txt -sh -o font_28.bin
$ FontMaker_Cli.exe -f "JetBrains Mono" -b -s 50 -w 25 --input ascii.txt -sh -o font_50.bin
```
#### 生成新的固件
1. 移动刚刚生成的字库文件
```bash
$ cd ../micropython-resource-manager/
$ mv ../fontmaker-client/font_*.bin workshop/fonts/fonts/
```
2. 将包含`资源分区`的固件复制到`/workshop/firmware/`
3. 生成新的固件
```bash
$ python combine_files.py workshop/firmware/firmware.bin workshop/fonts/
57344
/fonts/font_20.bin
/fonts/font_28.bin
/fonts/font_50.bin
```
> `57344`代表:以上三个文件在`资源分区`中实际占用的空间,该值**必须小于**固件中`资源分区`的大小(示例中为`458752 (448KiB)`),否则可能会导致无法预知的问题
至此,包含字库文件的固件生成完毕,文件位于`/workshop/firmware/firmware_output.bin`
### 合作交流
* 联系邮箱:
* QQ 交流群:
* 走线物联:[163271910](https://jq.qq.com/?_wv=1027&k=xtPoHgwL)
* 扇贝物联:[31324057](https://jq.qq.com/?_wv=1027&k=yp4FrpWh)

