工作记录(星期一)
摆脱一份幻觉比发现一个真理更能使人明智
当你在凝视深渊的时候,深渊也在凝视你
弱小和无知并不是生存的障碍,傲慢才是


这样设置才能使用,不然就等那个项目更新,没有其他的办法
❯ 帮我读取rkllm_chat这个目录,这是我写的一个qt项目实现了rkllm图形化界面还有一些快捷指令可以控制硬件,并且实现了web访问,我现在想要的是对它进行包装,你看我还有哪些地方可以优化呢
Searched for 3 patterns, read 9 files (ctrl+o to expand)
● 我仔细看了整个项目,功能很全(Qt GUI、RKLLM 推理、Web 端、语音 ASR/TTS、硬件控制、状态监控)。以下是按优先级排序的优化建议:
🔴 高优先级
- handleSend() 和 handleWebRequest() 意图匹配逻辑大量重复(~150 行重复代码)
两个函数里有一模一样的关键字匹配逻辑,维护时要改两处。建议提取为公共函数:
// 在 chat_window.h 中新增 struct IntentResult { bool isLocal = false; QString response; };
IntentResult parseIntent(const QString &command);
然后两个 handle 函数都调用它。
- Whisper 语音识别阻塞主线程(UI 卡顿)
onVoiceBtnReleased() 第 537 行: whisperProcess.waitForFinished(8000); // 阻塞 UI 8 秒!
用户在点击”按住说话”松开后,界面会卡死 8 秒。应该把 ASR 放到 LLMWorker 线程或者用 QThreadPool 异步执行。
- 对话历史无限增长,最终会内存溢出
conversationHistory 和 fullMarkdownLog 只追加不清理。长时间运行后:
- 每次推理都要发送越来越长的 prompt → NPU 负载越来越高、响应越来越慢
- setMarkdown() 渲染越来越大的文档 → UI 越来越卡
建议加轮数限制: const int MAX_HISTORY_ROUNDS = 10; // 超过时裁剪,保留系统设定 + 最近 N 轮
- 模型路径多处硬编码
以下路径分散在多个文件,建议集中到配置文件或 config.h:
- chat_window.cpp:132: /rkllm/model/qwen3-vl-4b-instruct_w8a8_rk3588.rkllm
- llm_worker.cpp:38: /rkllm/model/qwen3-vl-4b-instruct_w8a8_rk3588.rkllm
- chat_window.cpp:532: /rkllm/model/ggml-base.bin
🟡 中优先级
- fullMarkdownLog 每次 setMarkdown() 全量重渲染
长对话时越来越卡。可以改用 QTextCursor 增量插入: QTextCursor cursor(chatDisplay->document()); cursor.movePosition(QTextCursor::End); cursor.insertMarkdown(text); // Qt 6.4+ 支持
- TTS killall -9 edge-tts mpg123 过于暴力
每次打断都用 killall -9 强制杀进程,可能导致音频子系统状态异常。建议用更优雅的方式: // 维护一个 QProcess* ttsProcess 指针 if (ttsProcess && ttsProcess->state() == QProcess::Running) { ttsProcess->terminate(); ttsProcess->waitForFinished(500); }
- getAllNpuUsage() 读取 /sys/kernel/debug/ 需要 root
普通用户运行时会静默失败返回 0。可以加权限检查或提示: if (!file.exists()) { qDebug() << “NPU load 需要 root 权限访问 /sys/kernel/debug”; }
- Web 服务器没有访问控制
任何能访问该设备 IP
的人都可以控制硬件。建议至少加一个简单的 Token 校验或本地回环限制(只允许 127.0.0.1 和局域网 IP)。- smart_control.sh 中 echo 0/1 直接写 GPIO 路径
不同板子的 GPIO 编号可能不同,脚本目前是写死的。如果换一块 RK3588 开发板可能需要改脚本。
🟢 低优先级 / 代码风格
- CMakeLists.txt 链接了 -lpthread
Qt 自己的线程库已经够用了,且 QThread 内部已经处理了线程支持。这个不是必须的(但无害)。
- chat_window.cpp 中 QRegExp 已废弃
Qt5 开始 QRegExp 被标记为废弃,建议用 QRegularExpression 替代: // 旧 QRegExp rx(”(\d+)”); // 新 QRegularExpression rx(”(\d+)”);
- main.cpp 中 setrlimit(RLIMIT_NOFILE, 2048, 4096) 不够大
你同时在 autorun.sh 的 apply_ulimit() 里设置了 102400。两者取较小值生效,建议统一配置。
最推荐先做的 3 件事
- main.cpp 中 setrlimit(RLIMIT_NOFILE, 2048, 4096) 不够大
你同时在 autorun.sh 的 apply_ulimit() 里设置了 102400。两者取较小值生效,建议统一配置。
最推荐先做的 3 件事
┌────────┬─────────────────────────────────┬────────────────────┐ │ 优先级 │ 优化项 │ 影响 │ ├────────┼─────────────────────────────────┼────────────────────┤ │ 1 │ 提取 parseIntent() 消除重复代码 │ 维护性,减少 bug │ ├────────┼─────────────────────────────────┼────────────────────┤ │ 2 │ Whisper ASR 异步化 │ 用户体验,不卡顿 │ ├────────┼─────────────────────────────────┼────────────────────┤ │ 3 │ 对话历史限制 + 增量渲染 │ 长期稳定性,不泄漏 │ └────────┴─────────────────────────────────┴────────────────────┘
要我直接帮你改其中某个吗?比如先把意图匹配提取出来??
✻ Worked for 1m 43s
主机连接要用host.docker.internal
工作记录(星期二)
摆脱一份幻觉比发现一个真理更能使人明智
当你在凝视深渊的时候,深渊也在凝视你
弱小和无知并不是生存的障碍,傲慢才是
//风扇
fan: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
pwms = <&pwm12 0 10000000 0>;
cooling-levels = <150 170 190 210 230 255>;
rockchip,temp-trips = <
35000 1 // 45度以上切换到 1档 (170)
50000 2 // 55度以上切换到 2档 (190)
60000 3 // 65度以上切换到 3档 (210)
70000 4 // 75度以上切换到 4档 (230)
80000 5 // 85度遇到高温时才满速 (255)
>;
};
DDR c82c943893 cym 26/03/13-14
.26,fwver: v1.23 ch0 ttot10 ch1 ttot10 ch2 ttot10 ch3 ttot10 ch0 ttot14 LPDDR4X, 1596MHz channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB ch1 ttot14 channel[1] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB ch2 ttot14 channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB ch3 ttot14 channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB Manufacturer ID DQS rds,l0 CH0 RX Vref.5%, TX Vref.8%,22.8% DQ rds h6 h2 h2 h2 l0 h1 h3, h1 h4 h5 h6 h5 h2 h2 h3DQS rds
,l0 CH1 RX Vref.7%, TX Vref.8%,24.8% DQ rds h5 h6 h2 h6 h2 h1 h4, h5 h7 h5 h2 h1 h2 h7 h2DQS rds
,h1 CH2 RX Vref.7%, TX Vref.8%,21.8% DQ rds h1 h4 h2 h6 h7 h7 l0, h2 h4 h6 h2 h2 h4 h1 h2DQS rds
,h1 CH3 RX Vref.4%, TX Vref.8%,23.8% DQ rds h3 h1 h6 h6 h1 h5 h3, h7 h6 h4 h4 h3 h5 h3 h2stride=0x2, ddr_config=0x4 hash ch_mask0-1 0x20 0x40, bank_mask0-3 0xa00 0x1400 0x2800 0x0, rank_mask0 0x401000 change to F1: 528MHz ch0 ttot10 ch1 ttot10 ch2 ttot10 ch3 ttot10 change to F2: 1068MHz ch0 ttot12 ch1 ttot12 ch2 ttot12 ch3 ttot12 change to F3: 1560MHz ch0 ttot14 ch1 ttot14 ch2 ttot14 ch3 ttot14 change to F0: 1596MHz ch0 ttot14 ch1 ttot14 ch2 ttot14 ch3 ttot14 out U-Boot SPL board init U-Boot SPL 2017.09-ge4e124926e-230922 #lxh (Sep 25 2023 - 10:58
), fwver: v1.13 unknown raw ID 0 0 0 unrecognized JEDEC id bytes: 00, 00, 00 Trying to boot from MMC2 MMC: no card present mmc_init: -123, time 2 spl: mmc init failed with error: -123 Trying to boot from MMC1 SPL: A/B-slot: _a, successful: 0, tries-remain: 7 Trying fit image at 0x4000 sectorVerified-boot: 0
Checking atf-1 0x00060000 … sha256(f99c6f8fb6…) + OK
Checking uboot 0x00200000 … sha256(2275c4f797…) + OK
Checking fdt 0x00342508 … sha256(8ecccd16d2…) + OK
Checking atf-2 0xff100000 … sha256(74bbc58e20…) + OK
Checking atf-3 0x000f0000 … sha256(13b94d9d5a…) + OK
Checking optee 0x08400000 … sha256(76eeb0b48d…) + OK
Jumping to U-Boot(0x00200000) via ARM Trusted Firmware(0x00060000) Total: 145.896/350.243 ms
INFO: Preloader serial: 2 NOTICE: BL31: v2.3()
.3-964-g8319968f5.huang, fwver: v1.54 NOTICE: BL31: Built : 17:20, Dec 26 2025 INFO: spec: 0x1 INFO: code: 0x88 INFO: customer demand: 0x0 INFO: ext 32k is not valid INFO: ddr: stride-en 4CH INFO: GICv3 without legacy support detected. INFO: ARM GICv3 driver initialized in EL3 INFO: valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0 INFO: l3 cache partition cfg-0 INFO: system boots from cpu-hwid-0 INFO: bypass memory repair INFO: idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001 INFO: dfs DDR fsp_params[0].freq_mhz= 1596MHz INFO: dfs DDR fsp_params[1].freq_mhz= 528MHz INFO: dfs DDR fsp_params[2].freq_mhz= 1068MHz INFO: dfs DDR fsp_params[3].freq_mhz= 1560MHz INFO: BL31: Initialising Exception Handling Framework INFO: BL31: Initializing runtime services INFO: BL31: Initializing BL32 I/TC: I/TC: OP-TEE version: 3.13.0-999-g1e844e4ca #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #2 Fri May 9 00:41 UTC 2025 aarch64, fwver: v1.20 I/TC: OP-TEE memory size: TEEOS 0x200000 TA 0xc00000 SHM 0x200000 I/TC: Primary CPU initializing I/TC: Primary CPU switching to normal world boot INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x200000 INFO: SPSR = 0x3c9U-Boot 2017.09 (Apr 02 2026 - 15:16
+0800)Model: Rockchip RK3588 Evaluation Board MPIDR: 0x81000000 PreSerial: 2, raw, 0xfeb50000 DRAM: 8 GiB Sysmem: init Relocation Offset: eda1b000 Relocation fdt: eb9fa1e0 - eb9fecd8 CR: M/C/I DM: v2 mmc@fe2c0000: 1, mmc@fe2e0000: 0 Bootdev(atags): mmc 0 MMC0: HS400 Enhanced Strobe, 200Mhz PartType: EFI boot mode: None RESC: ‘boot’, blk@0x0001b0f6 resource: sha256+ FIT: no signed, no conf required DTB: rk-kernel.dtb HASH(c): OK I2c0 speed: 100000Hz vsel-gpios- not found! en-gpios- not found! vdd_cpu_big0_s0 800000 uV vsel-gpios- not found! en-gpios- not found! vdd_cpu_big1_s0 800000 uV I2c1 speed: 100000Hz vsel-gpios- not found! en-gpios- not found! vdd_npu_s0 800000 uV spi2: RK806: 2 ON=0x00, OFF=0x00 vdd_gpu_s0 750000 uV vdd_cpu_lit_s0 750000 uV vdd_log_s0 750000 uV vdd_vdenc_s0 init 750000 uV vdd_ddr_s0 850000 uV *** Warning - bad CRC, using default environment
Warn: can’t find connect driver Warn: can’t get connect driver get vp0 plane mask
, primary id, cursor_plane:-1, from dts get vp1 plane mask, primary id, cursor_plane:-1, from dts get vp2 plane mask, primary id, cursor_plane:-1, from dts get vp3 plane mask, primary id, cursor_plane:-1, from dts Could not find baseparameter partition Model: TOPEET RK3588 LP4 LP5 Board MPIDR: 0x81000000 Rockchip UBOOT DRM driver version: v1.0.1 vp0 have layer nrBooting FIT Image at 0xe91da5c0 with size 0x0261ec00
Fdt Ramdisk skip relocation
Loading kernel from FIT Image at e91da5c0 …
Using ‘conf’ configuration
Verified-boot: 0
Trying ‘kernel’ kernel subimage Description: unavailable Type: Kernel Image Compression: uncompressed Data Start: 0xe921d7c0 Data Size: 39696896 Bytes = 37.9 MiB Architecture: AArch64 OS: Linux Load Address: 0x00400000 Entry Point: 0x00400000 Hash algo: sha256 Hash value: c58168a4d925876a611a109ca7dda93b788649f419dc4ad46bef56988c9fd54f Verifying Hash Integrity … sha256+ OK
Loading fdt from FIT Image at e91da5c0 …
Using ‘conf’ configuration Trying ‘fdt’ fdt subimage Description: unavailable Type: Flat Device Tree Compression: uncompressed Data Start: 0xe91dadc0 Data Size: 272788 Bytes = 266.4 KiB Architecture: AArch64 Load Address: 0x08300000 Hash algo: sha256 Hash value: 2f0517f525e3b9097cb6b7f077b9d6a38c0ef6ad2de8096a2cb2e8a9d0d19485 Verifying Hash Integrity … sha256+ OK Loading fdt from 0x08300000 to 0x08300000 Booting using the fdt blob at 0x08300000 Loading Kernel Image from 0xe921d7c0 to 0x00400000 … OK kernel loaded at 0x00400000, end = 0x029dba00 Using Device Tree in place at 0000000008300000, end 0000000008345993 WARNING: could not set reg FDT_ERR_BADOFFSET.
reserved-memory:
cma: addr=10000000 size=8000000 drm-logo@00000000: addr=edf00000 size=b8000 ramoops@110000: addr=110000 size=e0000 Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000) Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000) Adding bank: 0x100000000 - 0x200000000 (size: 0x100000000) Adding bank: 0x2f0000000 - 0x300000000 (size: 0x10000000) Total: 1298.826/1454.744 ms
Starting kernel …
[ 1.463829] Booting Linux on physical CPU 0x0000000000 [0x412fd050] [ 1.463849] Linux version 5.10.198 (topeet@topeet) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 2.36.1.20210621) #2 SMP Mon Apr 27 11:22
CST 2026 [ 1.474061] Machine model: TOPEET RK3588 LP4 LP5 Board [ 1.517066] earlycon: uart8250 at MMIO32 0x00000000feb50000 (options ”) [ 1.564119] printk: bootconsole [uart8250] enabled [ 1.571368] efi: UEFI not found. [ 1.580173] OF: fdt: Reserved memory: failed to reserve memory for node ‘drm-cubic-lut@00000000’: base 0x0000000000000000, size 0 MiB [ 1.592902] Reserved memory: created CMA memory pool at 0x0000000010000000, size 128 MiB [ 1.601426] OF: reserved mem: initialized node cma, compatible id shared-dma-pool [ 1.725904] Zone ranges: [ 1.728585] DMA [mem 0x0000000000200000-0x00000000ffffffff] [ 1.735120] DMA32 empty [ 1.738167] Normal [mem 0x0000000100000000-0x00000002ffffffff] [ 1.744734] Movable zone start for each node [ 1.749313] Early memory node ranges [ 1.753096] node 0: [mem 0x0000000000200000-0x00000000083fffff] [ 1.759654] node 0: [mem 0x0000000009400000-0x00000000efffffff] [ 1.766196] node 0: [mem 0x0000000100000000-0x00000001ffffffff] [ 1.772815] node 0: [mem 0x00000002f0000000-0x00000002ffffffff] [ 1.779407] Initmem setup node 0 [mem 0x0000000000200000-0x00000002ffffffff] [ 1.831422] psci: probing for conduit method from DT. [ 1.836756] psci: PSCIv1.1 detected in firmware. [ 1.841692] psci: Using standard PSCI v0.2 function IDs [ 1.847246] psci: Trusted OS migration not required [ 1.852391] psci: SMC Calling Convention v1.2 [ 1.857319] percpu: Embedded 31 pages/cpu s88280 r8192 d30504 u126976 [ 1.864289] Detected VIPT I-cache on CPU0 [ 1.868556] CPU features: detected: GIC system register CPU interface [ 1.875277] CPU features: detected: Virtualization Host Extensions [ 1.881752] CPU features: detected: ARM errata 1165522, 1319367, or 1530923 [ 1.889113] alternatives: patching kernel code [ 1.895486] Built 1 zonelists, mobility grouping on. Total pages: 2059848 [ 1.902750] Kernel command line: storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal root=/dev/mmcblk0p6 androidboot.verifiedbootstate=orange rw rootwait earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 irqchip.gicv3_pseudo_nmi=0 rcupdate.rcu_expedited=1 rcu_nocbs=all [ 1.930920] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear) [ 1.939776] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 1.948025] mem auto-init: stack, heap alloc, heap free [ 1.960495] software IO TLB: mapped [mem 0x00000000e9f00000-0x00000000edf00000] (64MB) [ 2.026081] Memory: 7970784K/8370176K available (20544K kernel code, 3694K rwdata, 7244K rodata, 7168K init, 601K bss, 268320K reserved, 131072K cma-reserved) [ 2.041125] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 2.048057] ftrace: allocating 60858 entries in 238 pages [ 2.128016] ftrace: allocated 238 pages with 6 groups [ 2.133612] rcu: Hierarchical RCU implementation. [ 2.138570] rcu: RCU event tracing is enabled. [ 2.143393] rcu: RCU dyntick-idle grace-period acceleration is enabled. [ 2.150444] All grace periods are expedited (rcu_expedited). [ 2.156575] Rude variant of Tasks RCU enabled. [ 2.161397] Tracing variant of Tasks RCU enabled. [ 2.166471] rcu: RCU calculated value of scheduler-enlistment delay is 30 jiffies. [ 2.178567] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 2.187053] GICv3: GIC: Using split EOI/Deactivate mode [ 2.192668] GICv3: 480 SPIs implemented [ 2.196703] GICv3: 0 Extended SPIs implemented [ 2.201454] GICv3: Distributor has no Range Selector support [ 2.207436] GICv3: 16 PPIs implemented [ 2.211363] GICv3: CPU0: found redistributor 0 region 0 [ 2.218722] ITS [mem 0xfe640000-0xfe65ffff] [ 2.223179] ITS@0x00000000fe640000: allocated 8192 Devices @1001f0000 (indirect, esz 8, psz 64K, shr 0) [ 2.233048] ITS@0x00000000fe640000: allocated 32768 Interrupt Collections @100200000 (flat, esz 2, psz 64K, shr 0) [ 2.244063] ITS: using cache flushing for cmd queue [ 2.249247] ITS [mem 0xfe660000-0xfe67ffff] [ 2.253647] ITS@0x00000000fe660000: allocated 8192 Devices @100220000 (indirect, esz 8, psz 64K, shr 0) [ 2.263627] ITS@0x00000000fe660000: allocated 32768 Interrupt Collections @100230000 (flat, esz 2, psz 64K, shr 0) [ 2.274624] ITS: using cache flushing for cmd queue [ 2.279989] GICv3: using LPI property table @0x0000000100240000 [ 2.286399] GIC: using cache flushing for LPI property table [ 2.292379] GICv3: CPU0: using allocated LPI pending table @0x0000000100250000 [ 2.300070] rcu: Offload RCU callbacks from CPUs: 0-7. [ 2.410877] arch_timer: cp15 timer(s) running at 24.00MHz (phys). [ 2.417282] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 2.428654] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 2.438263] Console: colour dummy device 80x25 [ 2.442991] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=80000) [ 2.453823] pid_max: default: 32768 minimum: 301 [ 2.458771] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 2.466764] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 2.476538] rcu: Hierarchical SRCU implementation. [ 2.482394] Platform MSI: msi-controller@fe640000 domain created [ 2.488748] Platform MSI: msi-controller@fe660000 domain created [ 2.495409] PCI/MSI: /interrupt-controller@fe600000/msi-controller@fe640000 domain created [ 2.504128] PCI/MSI: /interrupt-controller@fe600000/msi-controller@fe660000 domain created [ 2.513018] EFI services will not be available. [ 2.518068] smp: Bringing up secondary CPUs … I/TC: Secondary CPU 1 initializing I/TC: Secondary CPU 1 switching to normal world boot I/TC: Secondary CPU 2 initializing I/TC: Secondary CPU 2 switching to normal world boot I/TC: Secondary CPU 3 initializing I/TC: Secondary CPU 3 switching to normal world boot I/TC: Secondary CPU 4 initializing I/TC: Secondary CPU 4 switching to normal world boot I/TC: Secondary CPU 5 initializing I/TC: Secondary CPU 5 switching to normal world boot I/TC: Secondary CPU 6 initializing I/TC: Secondary CPU 6 switching to normal world boot I/TC: Secondary CPU 7 initializing I/TC: Secondary CPU 7 switching to normal world boot [ 2.531053] Detected VIPT I-cache on CPU1 [ 2.531079] GICv3: CPU1: found redistributor 100 region 0 [ 2.531094] GICv3: CPU1: using allocated LPI pending table @0x0000000100260000 [ 2.531131] CPU1: Booted secondary processor 0x0000000100 [0x412fd050] [ 2.539378] Detected VIPT I-cache on CPU2 [ 2.539395] GICv3: CPU2: found redistributor 200 region 0 [ 2.539409] GICv3: CPU2: using allocated LPI pending table @0x0000000100270000 [ 2.539440] CPU2: Booted secondary processor 0x0000000200 [0x412fd050] [ 2.547709] Detected VIPT I-cache on CPU3 [ 2.547726] GICv3: CPU3: found redistributor 300 region 0 [ 2.547739] GICv3: CPU3: using allocated LPI pending table @0x0000000100280000 [ 2.547769] CPU3: Booted secondary processor 0x0000000300 [0x412fd050] [ 2.556039] CPU features: detected: Spectre-v4 [ 2.556041] CPU features: detected: Spectre-BHB [ 2.556043] Detected PIPT I-cache on CPU4 [ 2.556054] GICv3: CPU4: found redistributor 400 region 0 [ 2.556062] GICv3: CPU4: using allocated LPI pending table @0x0000000100290000 [ 2.556083] CPU4: Booted secondary processor 0x0000000400 [0x414fd0b0] [ 2.564326] Detected PIPT I-cache on CPU5 [ 2.564338] GICv3: CPU5: found redistributor 500 region 0 [ 2.564345] GICv3: CPU5: using allocated LPI pending table @0x00000001002a0000 [ 2.564367] CPU5: Booted secondary processor 0x0000000500 [0x414fd0b0] [ 2.572557] Detected PIPT I-cache on CPU6 [ 2.572568] GICv3: CPU6: found redistributor 600 region 0 [ 2.572575] GICv3: CPU6: using allocated LPI pending table @0x00000001002b0000 [ 2.572596] CPU6: Booted secondary processor 0x0000000600 [0x414fd0b0] [ 2.580836] Detected PIPT I-cache on CPU7 [ 2.580848] GICv3: CPU7: found redistributor 700 region 0 [ 2.580855] GICv3: CPU7: using allocated LPI pending table @0x00000001002c0000 [ 2.580876] CPU7: Booted secondary processor 0x0000000700 [0x414fd0b0] [ 2.580925] smp: Brought up 1 node, 8 CPUs [ 2.777429] SMP: Total of 8 processors activated. [ 2.782379] CPU features: detected: Privileged Access Never [ 2.788263] CPU features: detected: LSE atomic instructions [ 2.794147] CPU features: detected: User Access Override [ 2.799737] CPU features: detected: 32-bit EL0 Support [ 2.805136] CPU features: detected: Common not Private translations [ 2.811732] CPU features: detected: RAS Extension Support [ 2.817390] CPU features: detected: Data cache clean to the PoU not required for I/D coherence [ 2.826482] CPU features: detected: CRC32 instructions [ 2.831890] CPU features: detected: Speculative Store Bypassing Safe (SSBS) [ 2.839214] CPU features: detected: RCpc load-acquire (LDAPR) [ 2.870048] CPU: All CPU(s) started at EL2 [ 2.876198] devtmpfs: initialized [ 2.889264] Registered cp15_barrier emulation handler [ 2.894528] Registered setend emulation handler [ 2.899309] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370867519511994 ns [ 2.909449] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 2.917741] pinctrl core: initialized pinctrl subsystem [ 2.923363] DMI not present or invalid. [ 2.927509] NET: Registered protocol family 16 [ 2.932911] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations [ 2.940416] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 2.948950] Registered FIQ tty driver [ 2.952836] thermal_sys: Registered thermal governor ‘fair_share’ [ 2.952838] thermal_sys: Registered thermal governor ‘step_wise’ [ 2.959194] thermal_sys: Registered thermal governor ‘user_space’ [ 2.965463] thermal_sys: Registered thermal governor ‘power_allocator’ [ 2.971910] thermal thermal_zone1: power_allocator: sustainable_power will be estimated [ 2.987100] thermal thermal_zone2: power_allocator: sustainable_power will be estimated [ 2.995467] thermal thermal_zone3: power_allocator: sustainable_power will be estimated [ 3.003825] thermal thermal_zone4: power_allocator: sustainable_power will be estimated [ 3.012182] thermal thermal_zone5: power_allocator: sustainable_power will be estimated [ 3.020537] thermal thermal_zone6: power_allocator: sustainable_power will be estimated [ 3.028907] cpuidle: using governor menu [ 3.033077] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 3.040216] ASID allocator initialised with 65536 entries [ 3.046962] ramoops: dmesg-0 0x18000@0x0000000000110000 [
客户项目需求:
内核版本与实时性:锁定 Linux 5.10.160 或 6.1 LTS 分支,必须提供 PREEMPT_RT 补丁版本。验收时使用 cyclictest 在 CPU 满载下测试,最大延迟需控制在 200μs 以内,确保 ROS2 控制周期不抖动。
编译构建体系:交付完整 SDK 源码,包含 U-Boot、Kernel、Buildroot/Debian 根文件系统。必须支持纯净环境下一键编译(./build.sh all),严禁依赖主机特定环境变量,且工具链需内置于 prebuilts 目录。
设备树(DTS)适配:根据定制板卡原理图深度修改 DTS。PMIC(RK806)电压电流限制需匹配 PCB 载流能力;DDR 时序需提供全温范围(-40℃~85℃)眼图扫描报告;外设引脚复用(pinctrl)需与硬件走线一致,无冲突。
多媒体零拷贝通路:V4L2 驱动必须暴露 DMABUF 接口,支持 io-mode=dmabuf。验收标准:4K@60fps 视频流从 v4l2src 到 kmssink/NPU,CPU 占用率低于 15%。驱动内部需自动处理 16x16 像素对齐及 64 字节 DMA 地址对齐,杜绝 CIF_ISP_PIC_SIZE_ERROR 与 ALIGN_ERR。(没有4K 60的摄像头)
NPU 驱动与内存预留:RKNN Toolkit2 支持版本需 ≥ v1.4.0。系统启动时需在 DTS 中为 NPU 预留 ≥ 256MB 专用 CMA 内存池,防止长期运行后推理失败。/dev/rknn 节点权限需配置为 666 或归属 video 组,支持非 root 用户调用。现在的NPU调用使用的不是设备节点
外设接口映射:CAN 驱动必须注册为 SocketCAN(netdevice),支持 ip link 命令配置波特率,严禁仅提供字符设备。UART 驱动需优化 FIFO 阈值,921600 波特率下连续传输 1 小时丢包率为 0。
ROS2 兼容性:BSP 需预装 rmw_cyclonedds_cpp 并设为默认 RMW。内核参数需预设 kernel.shmmax=536870912,满足 DDS 共享内存需求。提供 ros2_test_suite 脚本,同时启动 talker/listener、RViz2 点云显示及 NPU 推理节点,运行 24 小时无 DDS 发现失败日志。
工业级可靠性:驱动需通过 -40℃ 低温静置 24 小时启动测试,及 85℃ 高温满负荷(stress-ng)运行 72 小时无看门狗复位。USB/以太网接口在高频振动下驱动不挂死,拔插后能自动恢复 link 状态。
交付物规范:拒绝仅提供 .img 镜像。必须交付包含所有自定义驱动源码的完整 SDK,提供 U-Boot + PMON 双固件支持底层诊断。驱动修改处需通过 configfs/sysfs 暴露配置节点,支持应用层动态调整参数而无需重编内核。(这里为啥会出现PMON)
工作记录(星期三)
摆脱一份幻觉比发现一个真理更能使人明智
当你在凝视深渊的时候,深渊也在凝视你
弱小和无知并不是生存的障碍,傲慢才是
repo init —repo-url ssh://git@www.rockchip.com.cn/repo/rk/tools/repo -u ssh://git@www.rockchip.com.cn/linux/rockchip/platform/manifests -b linux -m rk3588_linux_release.xml
08 5
10 7
20 9 6 5
30 5
40 5
echo 7 4 1 7 > /proc/sys/kernel/printk
echo 7 4 1 7 > /proc/sys/kernel/printk
sudo phytool read eth0/1/0x14
sudo ip link set eth0 down
sudo ip link set eth1 down
sudo ip link set eth0 up
sudo ip link set eth1 up
# 1. 关闭 eth0 的降速机制
sudo phytool write eth0/1/0x14 0x080c
# 2. 对 eth0 执行软复位使配置生效
sudo phytool write eth0/1/0x00 0x9140
# 3. 关闭 eth1 的降速机制
sudo phytool write eth1/1/0x14 0x080c
# 4. 对 eth1 执行软复位使配置生效
sudo phytool write eth1/1/0x00 0x9140

vim kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
static int phy_zxp211f_led_fixup(struct phy_device *phydev)
{
int val;
phy_write(phydev, 0x1e, 0xa00d);
phy_write(phydev, 0x1f, 0x70);
phy_write(phydev, 0x1e, 0xa00e);
phy_write(phydev, 0x1f, 0x607);
/*关闭智能降速机制*/
val = phy_read(phydev, 0x14);
if (val >= 0) {
val &= ~0x0020;
phy_write(phydev, 0x14, val);
}
/*执行软件复位使0x14的配置生效*/
val = phy_read(phydev, 0x00);
if (val >= 0) {
val |= 0x8000;
phy_write(phydev, 0x00, val);
}
return 0;
}

xrandr —output DSI-1 —right-of HDMI-1 —auto
xinput map-to-output 12 DSI-1
工作记录(星期四)
摆脱一份幻觉比发现一个真理更能使人明智
弱小和无知并不是生存的障碍,傲慢才是
当你在凝视深渊的时候,深渊也在凝视你
1.添加reset引脚
mac0 reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
mac1 reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
2.更新phy驱动
obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm.o
motorcomm-objs := motorcomm.o motorcomm_debugfs.o
3.修改fan
fan: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
pwms = <&pwm12 0 10000000 0>;
cooling-levels = <150 170 190 210 230 255>;
rockchip,temp-trips = <
40000 1 // 40度以上切换到 1档 (170)
50000 2 // 50度以上切换到 2档 (190)
60000 3 // 60度以上切换到 3档 (210)
70000 4 // 70度以上切换到 4档 (230)
80000 5 // 80度遇到高温时才满速 (255)
>;
};
fan: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
pwms = <&pwm9 0 10000000 0>;
cooling-levels = <150 170 190 210 230 255>;
rockchip,temp-trips = <
40000 1 // 40度以上切换到 1档 (170)
50000 2 // 50度以上切换到 2档 (190)
60000 3 // 60度以上切换到 3档 (210)
70000 4 // 70度以上切换到 4档 (230)
80000 5 // 80度遇到高温时才满速 (255)
>;
};
2026年5月21日 再次更新内核设备树,添加网口reset引脚,添加phy驱动
mini的没打包
全能的要重新拷贝一下
🎯 强推(演示瞬间能让客户”哇”的)
- 现场扫码上 Web 端
启动后在 Qt 主界面右上角画一个二维码(内容
http://<本机IP>:8080)。客户用自己手机扫一下就能即时体验"本地大模型",不需要你递设备。这是销售场景里最直接的转化动作,QR 码 QPainter
也能画(或直接调 qrencode -t PNG)。
2. 温度 / 功耗实时显示
RK3588 客户最常问的就是"会不会烫、耗多少电"。把 /sys/class/thermal/thermal_zone*/temp 和 NPU 当前频率读出来,跟现有 NPU
心电图并排显示一个"温度胶囊"。直接打脸"AI 一定耗电"的偏见。
3. 一行大字”100% 本地 · 0 联网 · 0 上云”
在标题栏或副标题区做一个非常显眼的"离线运行"徽章。这是 RK3588 边缘端最大的差异化卖点(vs 调云端 API),但你现在的 UI 里没明确写出来。
4. 演示自启播放 / Demo Mode
没人操作时(30s 空闲),自动循环跑一段预录脚本:自我介绍 → 控制 LED → 唱首歌 → 报性能。展会上让设备自己当销售,过路人就被吸住了。
💡 中等价值
- 快捷指令气泡(Quick Chips)
输入框上方加 4–6 个一键发送按钮:"讲个笑话"、"打开灯"、"现在几点"、"性能跑分"。客户不知道该问什么时就乱了,有了 chips 转化率立涨。
- About 弹窗 / 一键导出规格表
菜单加"关于本机":RK3588 八核、6 TOPS NPU、量化模型、tokens/s 实测值。客户合上盖子之前你能把这页截图发他,远胜口头介绍。
- 性能 Benchmark 一键跑
新增按钮:"跑一次基准测试",固定 prompt 跑 3 次取平均,弹窗显示首字延时 / tokens-per-second / 峰值 NPU 占用。生成一张可保存的"性能报告卡"。
- 中英双语切换
界面加个 EN/中 切换。海外客户、教育客户都会问。
🛠 锦上添花
- 主题切换(白天/夜晚),展示 UI 完成度
- 对话导出(Markdown / 截图),客户带走”我和 AI 的对话”作为纪念
- 硬件指令更花哨:LED 呼吸灯、风扇调速、播放本地音乐——把”自然语言控制硬件”这个杀手锏的覆盖面铺开
要不要我先挑 1(二维码)+ 3(离线徽章)+ 5(快捷指令) 这三个做掉?这套组合演示效果最猛、改动只集中在 chat_window.cpp 顶部 UI 区,不动 worker 和 web_server。你点头我就动手。
工作记录(星期五)
摆脱一份幻觉比发现一个真理更能使人明智
当你在凝视深渊的时候,深渊也在凝视你
弱小和无知并不是生存的障碍,傲慢才是
***************************************************
2026年5月22日
更新内核设备树,添加phy驱动
***************************************************
● 现在功能层已经相当饱满。剩下能继续”包装”的方向主要分三层:销售转化、专业化打磨、展示惊艳点。
🎯 销售转化层(让客户带走/再联系)
- 关于本机 / About 对话框 ⭐⭐⭐
点击 logo 或菜单弹窗,集中展示:
- RK3588 八核 / 6 TOPS NPU / 量化级别 / 模型大小 / 内核版本
- 当前 IP / MAC / 设备序列号 / 系统已运行时长
- 当前 Qt / RKLLM 库版本
客户问”这玩意儿啥配置”时一键解答,销售可以直接截图发给他。这是展会场景里最高频的需求。
- 一键跑分 / Benchmark 报告卡 ⭐⭐⭐
按钮 → 用固定 prompt 跑 3 次取平均,输出一张"性能报告卡"弹窗:
- 平均首字延时 (TTFT)
- 平均 Tokens/秒
- 峰值 NPU / CPU / 内存
- 峰值温度
- 可导出 PNG 让客户带走
量化数据胜过千言万语,比销售口头说”30 tokens/秒”有力 100 倍。
- 联系销售 / 厂商二维码 ⭐⭐⭐
设置一个底部或弹窗里的"销售联系卡":公司 logo + 微信二维码 + 电话 + 邮箱。客户体验完转身要走时,最后看到的是怎么找到你。这是真正的转化钩子。
- 对话导出 ⭐⭐
"导出本轮对话"按钮 → 保存为 Markdown 文件到桌面,或一键截图。客户带回去给他领导看:"我跟 RK3588 上的 AI 这么聊的"。
💎 专业化打磨层
- 使用帮助面板 / “我能问什么” ⭐⭐⭐
浮动 ❓ 按钮 → 弹出分类示例面板:
- 闲聊 / 编程 / 翻译 / 写作 / 硬件控制 五大类
- 每类 5-10 个典型问题,点击直接发送
很多客户站在面前不知道该问啥,沉默 30 秒就走了。有了这个,转化率立涨。
- 生命周期计数器 ⭐⭐
状态栏一个不起眼的胶囊:"已服务 N 轮 · 累计 M tokens · 已运行 X 小时",启动起递增。让设备显得"有阅历、在干活"。
- 硬件动作 toast 通知 ⭐⭐
执行"打开灯泡"时,屏幕右下角滑出一个绿色小气泡 ✓ LED ON,1.5 秒后自动消失。比目前只在聊天框打字反馈更有"控制感"。
- 演示模式可视化倒计时 ⭐
"演示模式 · 28 秒后自动开始" 的小进度条,让运营人员清楚知道再过多久会触发。
🎬 展示惊艳点
- TTS 播报实时波形动画 ⭐⭐⭐
播报时屏幕底部画一条音频波形随声音律动。纯技术展示,让客户感觉这设备"活着",特别上镜(拍展会视频极好用)。
- NPU 历史曲线放大图 ⭐
状态栏的小心电图点击 → 全屏弹窗显示最近 5 分钟 NPU/CPU/温度的大曲线图。技术决策者会很爱看。
- 欢迎引导 / Onboarding Tour ⭐⭐
首次开机或点击 "💡 新手引导" 时,逐个高亮功能点("这里是性能监控 → 这里扫码上手机 → 试试这个快捷指令"),3-5 步走完。
- Splash 自定义品牌 ⭐
现在的启动屏写的是 "ROCKCHIP · RK3588",可以做成贵公司的 logo + 标语,瞬间显得"这是我家的产品"而不是"借了瑞芯微的"。
我的推荐组合
如果只挑性价比最高的 3 个一起做:
▎ 关于本机 + 一键跑分 + 使用帮助面板
这三个加起来直接补齐”销售转化”的最大短板:客户问什么 → 看哪里 → 怎么联系,全闭环了。
如果想再加一个让客户带走:“对话导出”。
要不要我先把这三个或四个做了?或者你有更想要的优先级,直接点。
anhngoc64949505@gmail.com
shopmin91555
anhngoc649495055330@mail555.com
b7ujjdogbcoaguha52ycdegwoof3xypw|2024|Vietnam
RK3588 AI 智能中枢 · 项目介绍与使用手册
一台跑在 RK3588 NPU 上的本地大模型对话与硬件控制网关。 Qt5 桌面端 + Web 端双通道,离线推理,毫秒级硬件直通。
一、项目简介
rkllm_chat_gui 是面向 RK3588 系列开发板(如 iTOP-RK3588)的演示级 AI 应用,把”大语言模型 + 智能家居硬件控制”做成了一个开箱即用的桌面终端。整套对话推理 100% 在板上的 6 TOPS NPU 完成,不依赖任何云端 API,特别适合展会演示、教学样例和嵌入式 AI 项目原型。
核心能力
| 能力 | 实现要点 |
|---|---|
| 🧠 本地大模型对话 | RKLLM 运行时加载 qwen3-vl-4b-instruct W8A8 量化模型,三核 NPU 并行推理,~30 tokens/s |
| ⚡ 自然语言硬件控制 | 内置意图引擎,“开灯 / 调亮屏幕 / 播放音乐” 等命令绕过大模型,毫秒级直驱 GPIO / 背光 / 音频 |
| 🌡️ 实时环境感知 | DHT11 温湿度传感器读数,可通过对话或快捷指令查询 |
| 🎤 语音输入 (ASR) | 按住说话 → whisper-cli 离线转写 → 自动发送 |
| 🔊 语音播报 (TTS) | Edge-TTS 微软晓晓(需联网,可一键关闭进入完全离线模式) |
| 📱 Web 端双通道 | 同进程开 8080 端口,手机扫码即可同局域网访问,多人并发 |
| 🎬 演示模式 | 30 秒无人操作自动循环播放预置话术,展会无人值守 |
| 🌐 中英双语 + 🌗 浅深主题 | 一键切换,适配海外客户与不同光线环境 |
| 📊 性能仪表盘 | CPU / RAM / NPU 三核占用 / SoC 温度 / 首字延时 / Tokens-per-second 实时可视 |
二、硬件与软件需求
硬件
- 核心板:Rockchip RK3588(推荐 iTOP-RK3588 开发板,4×Cortex-A76 + 4×Cortex-A55 + 3 核 NPU @ 6 TOPS)
- 外设(按需):
- LED:板载
work1/work2指示灯(路径/sys/devices/platform/leds/leds/) - 蜂鸣器:板载,由
/topeet_test/03_beep/topeet_beep驱动 - DHT11 温湿度传感器:挂在 IIO 设备节点
- ES8388 音频编解码(板载,自动探测)
- 显示屏 + 背光(
/sys/class/backlight/backlight/brightness)
- LED:板载
软件
- Debian / Ubuntu (板厂出厂系统即可)
- Qt5(Widgets + Network)、CMake、g++、Python3-pip
mpg123(TTS 播放)、qrencode(手机扫码)、fonts-noto-color-emoji(emoji 渲染)
所有依赖会被
autorun.sh自动安装,正常情况下无需手动处理。
三、项目结构
rkllm_chat_gui/
├── autorun.sh # 一键部署脚本(装依赖、编译、装库、生成桌面快捷方式)
├── include/rkllm.h # RKLLM C API 头文件
├── lib/librkllmrt.so # RKLLM 运行时动态库(ARM64)
├── model/ # 模型文件存放目录(首次部署会拷到 /rkllm/model)
│ ├── qwen3-vl-4b-instruct_w8a8_rk3588.rkllm # 大模型
│ └── ggml-base.bin # Whisper ASR 模型
├── rkllm_api_demo/ # 官方原生命令行 demo(可选)
└── rkllm_chat/ # 主应用源码(Qt5)
├── main.cpp # 程序入口 + 启动屏
├── chat_window.cpp/.h # 主窗口 + UI + 意图引擎 + i18n + 演示模式
├── llm_worker.cpp/.h # RKLLM 推理后台线程
├── web_server.cpp/.h # 8080 端口 HTTP 服务(Web 端)
├── smart_control.sh # 底层硬件控制脚本(部署到 /usr/local/bin)
├── whisper-cli # 预编译的 Whisper ASR 二进制
├── rkllm_chat.desktop # 桌面快捷方式
└── CMakeLists.txt
四、安装与部署
方式 A:一键脚本(推荐)
把整个项目目录放到板子上,然后:
cd /home/topeet/rkllm_chat_gui
chmod +x autorun.sh
sudo ./autorun.sh
脚本会依次完成 7 个步骤:
| 步骤 | 内容 |
|---|---|
| 1/7 | 创建 /rkllm/model/ 工作目录 |
| 2/7 | 安装 Qt5、CMake、mpg123、qrencode、edge-tts 等依赖 |
| 3/7 | 把 librkllmrt.so 和 rkllm.h 安装到系统路径 |
| 4/7 | 编译官方原生命令行 demo(llm_demo) |
| 5/7 | 编译 Qt 主程序 rkllm_chat |
| 6/7 | 装到 /usr/bin/rkllm_chat,并把桌面快捷方式拷到用户桌面 |
| 7/7 | 拷贝模型到 /rkllm/model/ |
可选参数:
--clean删除 build 目录后全量重编--skip-apt跳过依赖安装(适合二次部署、离线环境)
方式 B:增量编译(改完源码后用)
cd /home/topeet/rkllm_chat_gui/rkllm_chat/build
cmake ..
make -j$(nproc)
sudo install -m 755 rkllm_chat /usr/bin/rkllm_chat
⚠️ 改完
chat_window.cpp/main.cpp后必须重编。直接复制源码到板子上不会让旧二进制有任何变化。
五、启动方式
| 入口 | 操作 |
|---|---|
| 桌面图标 | 双击桌面上 “RK3588 AI 智能中枢” 图标 |
| 终端命令 | sudo rkllm_chat(需要 root 才能写 /sys/class/backlight/ 等节点) |
启动后会出现:
- 品牌化启动屏(约 30 秒):展示 SoC / NPU / 模型规格,进度文案随加载阶段变化(唤醒 NPU → 加载 4B 模型 → 系统就绪)。
- 主窗口自动全屏(Kiosk 模式),按 Esc 可退出全屏成普通最大化窗口,F11 切回全屏。
- 首次启动会自动弹出”💡 新手引导”,逐步介绍每个控件的用法,下次启动不再打扰。可随时点顶部 💡 按钮再来一次。
六、界面布局
┌────────────────────────────────────────────────────────────────┐
│ ● 大模型100%本地推理 │ CPU │ RAM │ 🌡️ │ NPU0│NPU1│NPU2│ ⚡ │ ← 顶部状态栏
│ 📋│🌐│🌙│ℹ️│❓│💡│📱│🎬│🆕│🔊│ ← 工具栏
├────────────────────────────────────────────────────────────────┤
│ │
│ │
│ 【 对话展示区 】 │ ← 中央对话
│ │
│ │
├────────────────────────────────────────────────────────────────┤
│ 💡开灯 💡关灯 🎵播放 🔇停止 🌡️温度 💧温湿 🌐IP 🔔蜂鸣 …│ ← 快捷指令 chip
├────────────────────────────────────────────────────────────────┤
│ 🎤按住说话 │ 请输入您的问题… │ 发送 │ │ ← 输入区
└────────────────────────────────────────────────────────────────┘
顶部状态栏(左→右)
| 控件 | 说明 |
|---|---|
| ● 大模型 100% 本地推理 | 绿色徽章,鼠标悬浮看完整说明(含 TTS 联网注脚) |
| CPU / RAM | 实时百分比 |
| 🌡️ XX°C | SoC 温度,<60 绿 / <75 黄 / 否则红 |
| NPU0 / NPU1 / NPU2 | 三核占用迷你心电图,每秒推一个点 |
| ⚡ 待机 / 计算中… | 最近一次推理的首字延时 + Tokens/秒 |
工具栏按钮(右上)
| 按钮 | 功能 |
|---|---|
| 📋 复制回复 | 把最近一条 AI 回复复制到剪贴板 |
| 🌐 EN | 切换中 / 英界面(所有 UI 文本一次性刷新) |
| 🌙 深色 / ☀️ 浅色 | 主题切换 |
| ℹ️ 关于 | 弹出本机硬件 / 软件 / 网络信息卡 |
| ❓ 帮助 | 分类示例面板,点哪条就发哪条 |
| 💡 引导 | 重新打开新手引导,覆盖式聚光灯演示 |
| 📱 手机扫码 | 弹出二维码 + 局域网 IP,手机扫码访问 Web 端 |
| 🎬 演示模式 | 开启后 30 秒无人操作自动循环演示 |
| 🆕 新对话 | 清空大模型上下文(UI 历史保留) |
| 🔊 语音播报:开/关 | TTS 总开关,关闭后整套系统彻底离线 |
输入区
- 🎤 按住说话:按住开始录音 → 松开自动转写 → 自动发送
- 输入框:回车或点”发送”提交
- 🛑 停止:生成期间显示,点击立即中断 NPU 推理(调用
rkllm_abort)
快捷指令 chip
10 个常用预置,点哪个就发哪个:开 / 关灯、播放 / 停止、查温度、温湿度、查 IP、开 / 关蜂鸣器、写代码。
七、自然语言硬件控制
下面这些命令都会被 意图引擎拦截,毫秒级直驱硬件,不走大模型:
| 类别 | 中文示例 | 英文示例 |
|---|---|---|
| 💡 LED 灯 | ”打开灯泡” / “关闭灯泡” / “把灯点亮” | turn on the light / turn off the light |
| 🔔 蜂鸣器 | ”打开蜂鸣器” / “关闭蜂鸣器” | turn on the buzzer / turn off the buzzer |
| 🎵 音乐 | ”播放音乐” / “来一首歌” / “停止音乐” / “太吵了别放了” | play music / stop music |
| 🔆 屏幕背光 | ”调亮一点” / “屏幕太刺眼” / “背光设为 150” | brighter / dimmer / set brightness to 200 |
| 🌡️ 温度 | ”现在多少度” / “查一下温度” | what is the temperature |
| 💧 湿度 | ”湿度怎么样” | show humidity |
| 🌡️💧 温湿度 | ”获取温湿度” | show temperature and humidity |
| 🌐 IP | ”查询局域网 IP” / “本机地址” | show my IP address |
拦截命中后会在右下角弹出 toast 气泡(绿色=开 / 灰色=关 / 黄色=亮度 / 蓝色=查询),同时根据当前 TTS 开关决定是否语音播报。
非硬件类问题(聊天、写代码、翻译、写诗)会直接进大模型,三核 NPU 并行计算,首字延时通常 <1 秒,平均 30+ tokens/s。
八、Web 端访问(手机扫码)
- 点工具栏 📱 手机扫码 按钮
- 弹出对话框显示二维码 + 局域网 IP(如
http://192.168.1.100:8080) - 手机相机扫码,自动打开浏览器进入 Web 聊天界面
- Web 端的对话也会被同一套意图引擎拦截,硬件控制同样毫秒级响应
🔒 Web 端通信完全在局域网内,对话内容不离开你的网络。多人可并发查看实时状态。
九、演示模式(无人值守)
适用展会现场没人盯着的时候:
- 点工具栏 🎬 演示模式:关 按钮 → 切到 🎬 演示中(30s 空闲触发)
- 程序持续监听键盘 / 鼠标 / 触摸事件
- 30 秒内无任何用户操作 → 自动从预置话术池里挑下一条发送
- 话术池覆盖 10 种典型场景:自我介绍 / 程序员冷笑话 / 硬件控制 / 温度查询 / 边缘 AI 解释 / Python 代码 / 古诗创作 / 智能家居方案……
- 任何鼠标键盘动作都会立即暂停演示,避免抢走客户的交互
十、快捷键
| 键 | 行为 |
|---|---|
| Esc | 退出全屏 → 普通最大化窗口(带标题栏) |
| F11 | 普通窗口 ↔ 全屏切换 |
| Enter | 在输入框聚焦时发送消息 |
十一、文件路径速查
| 路径 | 说明 |
|---|---|
/usr/bin/rkllm_chat | 主程序 |
/usr/lib/librkllmrt.so | RKLLM 运行时库 |
/usr/include/rkllm.h | RKLLM 头文件 |
/usr/local/bin/whisper-cli | 离线语音识别二进制 |
/usr/local/bin/smart_control.sh | 底层硬件控制脚本 |
/usr/local/bin/edge-tts | 云端 TTS 软链 |
/rkllm/model/qwen3-vl-4b-instruct_w8a8_rk3588.rkllm | 大模型(W8A8 量化,约 4.5 GB) |
/rkllm/model/ggml-base.bin | Whisper 语音识别模型 |
~/桌面/rkllm_chat.desktop | 桌面快捷方式 |
/tmp/smart_gateway.log | 硬件操作日志(排查蜂鸣器 / LED 时看这里) |
/tmp/tts_err.log | TTS 错误日志(语音哑火时看这里) |
十二、常见问题排查
Q1:界面没有全屏 / 只是窗口
- 检查启动方式:必须是
sudo rkllm_chat或桌面快捷方式(已 sudo) - 程序默认
showFullScreen(),Esc 会退到窗口态,按 F11 重新进全屏
Q2:emoji 显示成方框
- 缺
fonts-noto-color-emoji包,运行sudo apt install -y fonts-noto-color-emoji && sudo fc-cache -f - 已经装了还不行:可能 fontconfig 缓存没刷新,再执行一次
fc-cache -f
Q3:语音播报无声音
- 看
/tmp/tts_err.log,常见原因:- edge-tts 没装 →
pip3 install --user edge-tts,确保/usr/local/bin/edge-tts软链存在 - 没联网 → Edge-TTS 是云端服务,断网会失败。可点 🔊 按钮关闭播报
- 声卡识别错误 → 启动日志会有
🔊 已锁定 ES8388 声卡号:X,错了就改chat_window.cpp::detectAudioCard
- edge-tts 没装 →
Q4:LED / 蜂鸣器不响应
- 看
/tmp/smart_gateway.log有没有报错 - 确认
/topeet_test/03_beep/topeet_beep存在且可执行 - 确认 GPIO 节点存在:
ls /sys/devices/platform/leds/leds/
Q5:模型加载失败 / NPU 报错
- 确认
/rkllm/model/qwen3-vl-4b-instruct_w8a8_rk3588.rkllm存在且大小约 4.5 GB - 确认 NPU 驱动加载正常:
cat /sys/kernel/debug/rknpu/version - 程序底部会弹”⚠️ AI 大模型加载失败”,但硬件直通指令仍可用
Q6:Web 端打不开
- 确认手机和板子在同一局域网
- 确认 8080 端口没被占用:
sudo netstat -tlnp | grep 8080 - 防火墙:
sudo ufw allow 8080或直接关闭 ufw
十三、关于”100% 本地”这件事
为了避免给客户留下过度承诺,整套 UI 的”本地”措辞已经统一:
- LLM 推理 + 意图识别:100% 在板上 RK3588 NPU 完成,对话不上云
- Whisper 语音识别 (ASR):本地,
whisper-cli离线运行 - 硬件控制:本地,直接读写 sysfs 节点
- 语音播报 (TTS):使用云端 Edge-TTS,需要联网
- 点工具栏 🔊 按钮关闭播报 → 即彻底离线
顶部徽章 / 关于弹窗 / 引导卡 / Tooltip 中所有提及”本地”的文案都已对齐这套口径。
十四、技术栈一览
- UI 框架:Qt 5 (Widgets + Network)
- 大模型推理:RKLLM Runtime(Rockchip 闭源运行时 librkllmrt.so)
- 模型:Qwen3-VL-4B-Instruct W8A8 量化,约 4.5 GB
- 语音识别:whisper.cpp 编译的
whisper-cli+ ggml-base 模型 - 语音合成:Microsoft Edge-TTS(zh-CN-XiaoxiaoNeural 音色)
- 音频播放:mpg123 → ALSA → ES8388
- Web 服务:QTcpServer 自实现 HTTP/1.1 子集
- 构建系统:CMake 3.10+
作者:基于 Rockchip RKLLM + 迅为 iTOP-RK3588 开发板 · 许可:项目内嵌的 RKLLM 运行时归 Rockchip 所有;演示代码部分自由使用
Qt5 桌面 GUI + RKLLM 推理线程 + 内置 8080 Web 服务 + Whisper 离线 ASR + Edge-TTS 可选联网播报 + shell 硬件控制脚本。
核心文件集中在:
- rkllm_chat/main.cpp:启动屏、全屏 kiosk、主窗口启动。
- rkllm_chat/chat_window.cpp:主 UI、意图识别、语音、TTS、性能状态、演示模式。
- rkllm_chat/llm_worker.cpp:RKLLM 初始化和推理线程。
- rkllm_chat/web_server.cpp:手机 Web 端。
- rkllm_chat/smart_control.sh:LED、蜂鸣器、背光、温湿度、音频等硬件控制。
- autorun.sh:一键部署、编译、安装依赖、复制模型。
优先建议
- 不要做图片识别,反而建议换掉 VL 模型
现在模型名是 qwen3-vl-4b-instruct_w8a8_rk3588.rkllm,虽然你没用图片输入,但 VL 模型本身通常比纯文本模型更占资源。既然 RK3588 内存紧张,后续应该优先换成同级别或更小的纯文本 RKLLM 模型,比如
1.5B/3B/4B 文本模型,别保留视觉分支能力。 - 把硬编码路径改成配置文件
现在 /rkllm/model/…、/usr/local/bin/whisper-cli、8080、声卡号、TTS 开关、模型参数都散在代码里。建议增加 /etc/rkllm-chat/config.ini 或项目目录下 config.json,让部署后不用重新编译就能改模型 路径、端口、是否启用 TTS/ASR/Web。 - 增加统一推理 busy/队列机制
Web 端有 isBusy,桌面端有 isGenerating,但它们不是统一锁。极端情况下桌面和 Web 可能同时向同一个 RKLLM worker 发请求。建议做一个全局 InferenceController:统一状态、统一 abort、统一排队或直接 拒绝。 - Web 端离线化
web_server.cpp 里 Web 页面依赖 jsdelivr 的 marked 和 highlight.js。这和“本地离线演示”定位冲突,断网时 Web 端 Markdown/代码高亮会受影响。建议把 JS/CSS 内置到本地资源,或者直接简化为纯文本/轻 量 Markdown 渲染。 - 增加真正的 Web 停止生成接口
当前 Web 端 stopGen() 主要是取消浏览器 fetch,服务端推理未必停止。建议增加 POST /abort,调用 rkllm_abort(),让手机端停止按钮真正中断 NPU 推理。 - 拆分 chat_window.cpp
这个文件已经 130KB+,承担 UI、i18n、硬件、TTS、ASR、Web 协调、性能监控。后续维护会越来越难。建议拆成:- intent_engine.*
- hardware_controller.*
- audio_asr.*
- tts_player.*
- system_monitor.*
- chat_window_ui.*
- 做正式包装部署
现在 autorun.sh 已经能用,但更像开发部署脚本。实际项目建议补:- install.sh
- uninstall.sh
- systemd service
- .desktop 文件不直接写 Exec=sudo …
- 日志目录改到 /var/log/rkllm-chat/
- 程序安装到 /opt/rkllm-chat/,/usr/bin/rkllm_chat 只做软链
- 减少运行时 shell 调用
每秒状态刷新里 RAM 调用 free,TTS/录音/硬件也大量 sh -c。在开发板上 shell 启动成本不算小。建议:- RAM 直接读 /proc/meminfo
- 背光、LED、温度等尽量 C++ 直接读写 sysfs
- shell 脚本保留为兼容层,不作为主路径
- 内存优化方向
不上图片识别的前提下,优先做:- 换纯文本小模型
- 降低 max_new_tokens,现在是 4096,演示场景可改成 512/1024
- TTS 默认关闭,避免网络和额外进程干扰演示
npm i -g @openai/codex@0.120.0
model_provider = "ccswitch"
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
disable_response_storage = true
review_model = "gpt-5.4"
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 190000
model_auto_compact_token_limit = 185000
[model_providers]
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
[model_providers.ccswitch]
name = "ccswitch"
base_url = "https://anyrouter.top/v1"
wire_api = "responses"
requires_openai_auth = true
[mcp_servers]
[mcp_servers.node_repl]
type = "stdio"
command = 'C:\Users\Administrator\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe'
startup_timeout_sec = 120
[mcp_servers.node_repl.env]
BROWSER_USE_AVAILABLE_BACKENDS = "chrome,iab"
BROWSER_USE_MARKETPLACE_NAME = "openai-bundled"
CODEX_CLI_PATH = 'C:\Users\Administrator\AppData\Local\OpenAI\Codex\bin\3f4fb8cdd344abc7\codex.exe'
CODEX_HOME = 'C:\Users\Administrator\.codex'
NODE_REPL_NATIVE_PIPE_CONNECT_TIMEOUT_MS = "1000"
NODE_REPL_NODE_MODULE_DIRS = ""
NODE_REPL_NODE_PATH = 'C:\Users\Administrator\AppData\Local\OpenAI\Codex\bin\5b9024f90663758b\node.exe'
NODE_REPL_TRUSTED_BROWSER_CLIENT_SHA256S = "167fdf579477181fba1773c1efb067b00c5a64fe85dafb50a2001bde198dc739"
NODE_REPL_TRUSTED_CODE_PATHS = 'C:\Users\Administrator\.codex'
NODE_REPL_UNTRUSTED_ENV_ALLOWLIST = "BROWSER_USE_MARKETPLACE_NAME"
[projects.'C:\Windows\System32']
trust_level = "trusted"
[notice.model_migrations]
"gpt-5.3-codex" = "gpt-5.4"
[windows]
sandbox = "unelevated"
npm i -g @openai/codex@0.120.0
我这是一个rk3588的rkllm 大语言模型项目,这是要提供给客户的,但现在的功能感觉还是比较单一,我想要对整个项目进行优化和包装,你看我要如何做呢,首先我这个模型是支持图片识别的,但是因为存储的原因,就不添加图片视觉相关的功能了,你帮我包装一下
一、智能家居方向
- 场景模式:增加“回家模式 / 离家模式 / 睡眠模式 / 影院模式 / 展厅模式”,一句话触发多个硬件动作,比如开灯、调亮度、播报欢迎语、播放音乐。
- 设备面板:在 Qt 主界面右侧或底部加“智能家居设备卡片”,显示灯光、蜂鸣器、音乐、屏幕亮度、温湿度、网络状态。
- 状态记忆:维护一份本地设备状态,例如灯是否打开、当前亮度、最近温度、音乐状态,避免每次都只是执行命令但 UI 不知道结果。
- 自动化规则:支持“温度超过 30 度提醒”“无人操作 60 秒进入展厅模式”“夜间自动降低屏幕亮度”等规则。
- 虚拟设备演示:即使客户板子没接完整外设,也可以显示“空调、窗帘、门锁、插座、风扇”等虚拟设备状态,适合售前展示。
二、代码层建议
- 抽象设备层:把现在分散在 rkllm_chat/chat_window.cpp 之后的硬件意图逻辑,拆成 DeviceManager、SceneManager、IntentRouter,以后加设备不用继续堆大文
件。 - 配置化意图:把“开灯/关灯/蜂鸣器/播放音乐”从硬编码改成 packaging/config.ini 或 JSON 配置,客户定制时不用改 C++。
- 统一动作返回值:硬件脚本目前更像“执行完就算”,建议返回结构化结果:成功、失败、设备名、动作、提示文本。
- Web 与 Qt 共用状态:Web 端 rkllm_chat/web_server.cpp 已有快捷 chip,但建议和 Qt 端共享同一套设备状态和场景列表。
- 减少主窗口臃肿:rkllm_chat/chat_window.cpp 已经很大,建议把帮助弹窗、引导、智能家居面板、主题、性能监控拆成独立组件。
三、可以新增的客户可见功能
- 智能家居控制中心页:不是只有聊天框,而是有一个“控制台”,客户一眼能看到这是 AI 中控,不只是大模型聊天。
- 一键演示按钮:比如“演示智能家居能力”,自动执行:开灯 → 查询温度 → 播放音乐 → 解释本地推理优势。
- 客户定制欢迎语:启动时显示“欢迎体验 XX 公司 RK3588 边缘 AI 中控方案”,从配置文件读取。
- 系统自检页:把 rkllm-healthcheck.sh 的结果做成 UI 页面,显示模型、NPU、Web、语音、硬件是否正常。
- 操作日志面板:展示“用户说了什么 → 命中了什么意图 → 执行了哪个设备动作”,客户会觉得系统更专业。
四、售前包装亮点
- 从 Demo 变方案:主打“本地大模型 + 智能家居中控 + 边缘硬件网关”,而不是“RKLLM 聊天窗口”。
- 从按钮变场景:客户不关心“能不能开灯”,更关心“一句话控制一个场景”。
- 从单机变网关:下一步可以接 MQTT / Home Assistant / Modbus / 串口设备,把 RK3588 包装成 AI 网关。
- 从模型能力变行业能力:教育、展厅、酒店、养老、工厂、实验室都可以用同一个底座改话术和设备。
d -
我建议下一步先做
- 第一阶段:加“智能家居场景模式 + 设备状态面板 + 配置化欢迎语”。
- 第二阶段:拆 DeviceManager / SceneManager / IntentRouter,把代码结构产品化。
- 第三阶段:Web 端同步设备卡片和场景按钮,手机端也像智能家居控制台。
- 第四阶段:加 MQTT/Home Assistant 适配,变成真正可扩展网关。
如果你愿意,我下一步可以直接开始实现第一阶段:在现有 Qt 界面里加“智能家居场景模式”和“设备状态面板”,先做出客户能明显感知的产品升级
| 对比项 | STM32MP157AAA3 | STM32MP157CAA3 | 是否影响程序 |
|---|---|---|---|
| 系列 | STM32MP157 | STM32MP157 | 不影响 |
| CPU | 双核 Cortex-A7 | 双核 Cortex-A7 | 不影响 |
| A7 主频 | 650 MHz | 650 MHz | 不影响 |
| M4 协处理器 | Cortex-M4 209 MHz | Cortex-M4 209 MHz | 不影响 |
| GPU / 显示 / 外设 | 基本一致 | 基本一致 | 不影响 |
| 封装 | AA = LFBGA448,18x18 mm,0.8 mm pitch | AA = LFBGA448,18x18 mm,0.8 mm pitch | PCB 基本兼容 |
| 温度等级 | 3 = -40 到 +125 °C | 3 = -40 到 +125 °C | 不影响 |
| 安全等级 | A = Basic security | C = Secure Boot + Cryptography | 影响 |
| 硬件加密 | 无 AES/TDES 加密加速 | 有 AES 128/192/256、TDES 等硬件加速 | 用到加密/安全启动时影响 |
| 安全启动 | 不支持完整 Secure Boot 方案 | 支持 Secure Boot | 启用安全启动时影响 |
工作记录(星期日)
摆脱一份幻觉比发现一个真理更能使人明智
当你在凝视深渊的时候,深渊也在凝视你
弱小和无知并不是生存的障碍傲慢才是
可以评估为:从 STM32MP157A 换到 STM32MP157C,若封装同为 AA3,硬件大概率兼容,软件常规功能也大概率兼容;主要差异在安全启动和硬件加密能力。
你们当前图片里是:
| 项目 | 当前 | 客户想换 |
|---|---|---|
| SoC | STM32MP157AAA3 | STM32MP157CAA3 |
| 安全等级 | A = Basic security | C = Secure boot + cryptography hardware |
| 封装 | AA = LFBGA448, 18x18 mm, 0.8 mm | AA = LFBGA448, 18x18 mm, 0.8 mm |
| 温度等级 | 3 = -40 到 +125 degC | 3 = -40 到 +125 degC |
硬件兼容性
| 检查项 | 结论 |
|---|---|
| PCB 封装 | 兼容 |
| 管脚 | pin-to-pin 兼容 |
| 电源 | 兼容 |
| DDR/eMMC/SD/ETH/CAN/UART 等外设 | 接口资源一致 |
| PMIC STPMIC1 | 相同 |
| 散热/功耗 | 基本一致 |
| 生产烧录 | 如果不开启 Secure Boot,流程基本不变;如果要启用安全启动,需要新增 OTP/密钥/签名烧录流程 |
软件兼容性
| 软件层 | 结论 |
|---|---|
| Linux 应用程序 | 基本无需改 |
| M4 固件 | 基本无需改 |
| 普通外设驱动 | 基本无需改 |
| 设备树 DTS/DTB | 建议改成 C 型号对应配置,例如从 stm32mp157a 系列切到 stm32mp157c 系列,以便正确暴露 crypto/hash/rng 等硬件 |
| TF-A / U-Boot | 常规启动大概率兼容,但建议按 STM32MP157C 重新配置/验证 |
| DDR 初始化 | 理论上与 A/C 无直接关系,更多取决于 DDR 颗粒和板级走线;但换 SoC 后仍建议完整跑 DDR stress test |
| Secure Boot | 如果不开启,影响很小;如果开启,需要重做启动链、镜像签名、OTP 烧录、调试权限策略 |
| 硬件加密 | C 支持 AES/TDES/HASH/TRNG 等,A 没有;如果客户需要加密加速,软件需要启用对应驱动/配置 |
主要风险点
-
不能只换芯片不改型号声明
旧软件如果一直按STM32MP157A设备树跑,普通功能可能没问题,但 C 的加密、安全硬件可能不会被启用。建议 BSP 里明确切到STM32MP157C。 -
Secure Boot 是最大差异
C 支持安全启动,但默认不等于必须启用。
如果客户只是想换成 C,不用安全启动,影响很小。
如果客户要求安全启动/防拷贝/固件签名,那就是一个独立项目,需要设计密钥、OTP、签名镜像、量产烧录和售后解锁流程。 -
调试口可能被安全策略影响
C 芯片如果烧了安全相关 OTP 或关闭调试权限,JTAG/SWD 行为会变化。工程样机阶段一定不要过早锁死。 -
BOM 里其他物料也要一起确认
你图里 DDR、eMMC 料号也不同。SoC A 换 C 本身风险不大,但 DDR/eMMC 换料会影响启动固件、DDR 参数、稳定性测试。
建议结论
如果客户只是要求 STM32MP157A 换成 STM32MP157C,并且仍然使用 AA3 封装:
硬件上可以按兼容替换评估,不需要改 PCB 的概率很高。软件上普通功能兼容,但建议 BSP/设备树切到 C 型号并重新做整板验证。
建议验证清单:
| 验证项 | 必测 |
|---|---|
| TF-A 启动 | 是 |
| U-Boot 启动 | 是 |
| Linux 启动 | 是 |
| DDR stress test | 是 |
| eMMC/SD 启动和读写 | 是 |
| Ethernet | 是 |
| UART/CAN/USB | 是 |
| M4 固件加载 | 是 |
| 休眠/唤醒 | 建议 |
| crypto/hash/rng 驱动 | 如果客户要用安全/加密功能则必测 |
| Secure Boot | 如果客户要安全启动则单独立项验证 |
一句话给客户可以这样说:
STM32MP157AAA3 替换为 STM32MP157CAA3,在相同 AA3 封装下硬件基本兼容,普通软件功能基本兼容;差异主要是 C 型号增加 Secure Boot 和硬件加密能力,若启用安全功能则需要调整 BSP、启动链和量产烧录流程。
目前发现的问题: 1.debian11、debian12会有乱码,总览下面的那段话哪里会有乱码 ai对话界面下面的TOPEET AI后面会乱码还有下面的话会乱码,智能家居 TOPEET AI后面的中文会乱码、TOPEET AI下面的也会乱码,就这几个小地方乱码,但是ubuntu22上就不会,我感觉是读取整个config.ini文件哪里不对了 ,然后ubuntu20编译报错了
t/rkllm_chat_gui/rkllm_chat/smart_home.cpp: In member function ‘void IntentRouter::loadConfiguredIntents()’:
/mnt/rkllm_chat_gui/rkllm_chat/smart_home.cpp:143:48: error: ‘SkipEmptyParts’ is not a member of ‘Qt’
143 | QStringList words = raw.split(',', Qt::SkipEmptyParts);
| ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/rkllm_chat.dir/build.make:102:CMakeFiles/rkllm_chat.dir/smart_home.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In constructor ‘ChatWindow::ChatWindow(QWidget*)’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1089:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1089 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::onInitFinished(bool)’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1164:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1164 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::handleSend()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1350:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1350 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1366:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1366 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::handleWebRequest(const QString&)’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1418:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1418 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1435:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1435 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::appendAIResponse(const QString&)’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1474:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1474 | chatDisplay->setMarkdown(fullMarkdownLog + currentAIResponse);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::onInferenceEnd()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1507:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1507 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1514:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1514 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::onNewChat()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1561:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
1561 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘double ChatWindow::getCpuUsage()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:1638:57: error: ‘SkipEmptyParts’ is not a member of ‘Qt’
1638 | QStringList parts = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
| ^~~~~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In lambda function:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:2866:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
2866 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In lambda function:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:2887:22: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
2887 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::onLangToggle()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:3088:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
3088 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp: In member function ‘void ChatWindow::onThemeToggle()’:
/mnt/rkllm_chat_gui/rkllm_chat/chat_window.cpp:3097:18: error: ‘class QTextEdit’ has no member named ‘setMarkdown’
3097 | chatDisplay->setMarkdown(fullMarkdownLog);
| ^~~~~~~~~~~
make[2]: *** [CMakeFiles/rkllm_chat.dir/build.make:115:CMakeFiles/rkllm_chat.dir/chat_window.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:77:CMakeFiles/rkllm_chat.dir/all] 错误 2
make: *** [Makefile:84:all] 错误 2
root@topeet:/mnt/rkllm_chat_gui#