20250603在荣品的PRO-RK3566开发板的Android13下的使用命令行来查看RK3566的温度【显示优化版本】

news2025/6/7 20:59:24

20250603在荣品的PRO-RK3566开发板的Android13下的使用命令行来查看RK3566的温度【显示优化版本】
2025/6/3 11:58


RK3566的cpu运行效率 top
busybox top


rk3566_t:/ #
rk3566_t:/ #
rk3566_t:/ # cd /sys/class/thermal/
rk3566_t:/sys/class/thermal # ls -l
rk3566_t:/sys/class/thermal # cd thermal_zone0/
rk3566_t:/sys/class/thermal/thermal_zone0 #
rk3566_t:/sys/class/thermal/thermal_zone0 # ls -l
rk3566_t:/sys/class/thermal/thermal_zone0 # cat temp
51875
rk3566_t:/sys/class/thermal/thermal_zone0 #


完整的LOG:
【可以直接将DeepSeek的内容拷贝到XShell的串口界面,但是WIN10的命令行的adb中不行!】
【XShell8】
console:/ $ 
rmal : $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))°C"              <
CPU thermal : 50°C
console:/ $ 
: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))°C"                   <
CPU温度: 50°C
console:/ $ 
console:/ $ 


【ADB显示异常了!】
Microsoft Windows [版本 10.0.19045.5737]
(c) Microsoft Corporation。保留所有权利。

C:\Users\QQ>adb shell
adb server version (40) doesn't match this client (41); killing...
* daemon started successfully
rk3566_t:/ $ echo "CPU?: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"
CPU?: 50C
rk3566_t:/ $
rk3566_t:/ $ echo "CPU?: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"^C
130|rk3566_t:/ $
130|rk3566_t:/ $ echo "CPU thermal : $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"
CPU thermal : 50C
rk3566_t:/ $
rk3566_t:/ $ echo "CPU thermal : $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"
CPU thermal : 50C
rk3566_t:/ $
rk3566_t:/ $ echo "CPU?: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"
CPU?: 50C
rk3566_t:/ $


 

rk3566_t:/ #
rk3566_t:/ #
rk3566_t:/ #
rk3566_t:/ # cd /sys/class/thermal/
rk3566_t:/sys/class/thermal #
rk3566_t:/sys/class/thermal # ls -l
total 0
lrwxrwxrwx 1 root root 0 2025-06-02 18:01 cooling_device0 -> ../../devices/virtual/thermal/cooling_device0
lrwxrwxrwx 1 root root 0 2017-08-04 17:00 thermal_zone0 -> ../../devices/virtual/thermal/thermal_zone0
lrwxrwxrwx 1 root root 0 2017-08-04 17:00 thermal_zone1 -> ../../devices/virtual/thermal/thermal_zone1
lrwxrwxrwx 1 root root 0 2017-08-04 17:00 thermal_zone2 -> ../../devices/virtual/thermal/thermal_zone2
rk3566_t:/sys/class/thermal #
rk3566_t:/sys/class/thermal #
rk3566_t:/sys/class/thermal # cd the
thermal_zone0/  thermal_zone1/  thermal_zone2/
rk3566_t:/sys/class/thermal # cd thermal_zone0/
rk3566_t:/sys/class/thermal/thermal_zone0 #
rk3566_t:/sys/class/thermal/thermal_zone0 # ls -l
total 0
-r--r--r-- 1 root   root   4096 2025-06-02 18:02 available_policies
lrwxrwxrwx 1 root   root      0 2025-06-02 18:02 cdev0 -> ../cooling_device0
-r--r--r-- 1 root   root   4096 2025-06-02 18:02 cdev0_trip_point
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 cdev0_weight
drwxr-xr-x 3 root   root      0 2017-08-04 17:00 hwmon0
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 integral_cutoff
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 k_d
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 k_i
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 k_po
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 k_pu
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 mode
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 offset
-rw-r--r-- 1 system system 4096 2017-08-04 17:00 policy
drwxr-xr-x 2 root   root      0 2017-08-04 17:00 power
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 slope
lrwxrwxrwx 1 root   root      0 2025-06-02 18:02 subsystem -> ../../../../class/thermal
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 sustainable_power
-r--r--r-- 1 root   root   4096 2025-06-02 17:56 temp
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_0_hyst
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_0_temp
-r--r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_0_type
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_1_hyst
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_1_temp
-r--r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_1_type
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_2_hyst
-rw-r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_2_temp
-r--r--r-- 1 root   root   4096 2025-06-02 18:02 trip_point_2_type
-r--r--r-- 1 root   root   4096 2025-06-02 17:56 type
-rw-r--r-- 1 root   root   4096 2017-08-04 17:00 uevent
rk3566_t:/sys/class/thermal/thermal_zone0 #
rk3566_t:/sys/class/thermal/thermal_zone0 # cat temp
51875
rk3566_t:/sys/class/thermal/thermal_zone0 #
C:\Users\QQ>
 

在命令行查看RK3566的温度
在 RK3566 平台上,你可以通过以下方法在命令行中查看 SoC 温度:

方法 1:通过 sysfs 接口查询
RK3566 的温度传感器数据通常通过内核的 thermal 子系统暴露在 /sys/class/thermal 目录下:

bash
# 列出所有 thermal zone
ls /sys/class/thermal/

# 通常 thermal_zone0 对应 SoC 温度
cat /sys/class/thermal/thermal_zone0/temp

# 更友好的显示方式(除以1000得到摄氏度)
echo "CPU温度: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))°C"
方法 2:使用 sensors 命令(需安装 lm-sensors)
如果系统支持:

bash
# 安装 lm-sensors(如果未安装)
sudo apt install lm-sensors

# 检测硬件传感器
sudo sensors-detect

# 查看温度信息
sensors
方法 3:通过调试接口(需要 root)
有些 RK3566 平台可能提供额外的调试接口:

bash
# 查看 PMIC 温度(如果支持)
cat /sys/kernel/debug/regulator/regulator_temp

# 或通过 debugfs
cat /sys/kernel/debug/thermal/thermal_zone0/temp
方法 4:使用第三方工具
bash
# 安装并运行 psensor
sudo apt install psensor
psensor
注意事项:
不同厂商的 RK3566 板卡/设备可能温度传感器路径略有不同

某些嵌入式系统可能简化了 thermal 子系统实现

温度值通常是毫摄氏度(需要除以1000得到摄氏度)

如果没有显示,可能需要检查内核配置是否启用了 thermal 驱动:

bash
dmesg | grep thermal
如果需要更精确的信息,建议查阅你所使用的具体 RK3566 平台的硬件手册或内核设备树配置。

在命令行查看RK3566的温度  更加友好的显示方式。RK3566不支持 中文。不支持 温度的度的显示。请切换为 英文状态下的更加友好的显示方式
Here are several English-friendly ways to check the RK3566 temperature in the command line:

Method 1: Simple Temperature Readout
bash
echo "CPU Temp: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"
Sample output:

CPU Temp: 42C
Method 2: Formatted Thermal Information
bash
temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
printf "RK3566 Temperature\n=================\nSOC: %d°C\n" $temp
Sample output:

RK3566 Temperature
=================
SOC: 42°C
Method 3: Continuous Monitoring (refresh every 2 seconds)
bash
watch -n 2 'echo "Current Temp: $(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))C"'
Method 4: Thermal Zone Summary
bash
for zone in $(ls /sys/class/thermal/ | grep thermal_zone); do
  type=$(cat /sys/class/thermal/${zone}/type)
  temp=$(($(cat /sys/class/thermal/${zone}/temp)/1000))
  printf "%-15s: %2dC\n" $type $temp
done
Sample output:

soc_thermal    : 42C
Method 5: Color-Coded Temperature (requires terminal with color support)
bash
temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
if [ $temp -gt 70 ]; then
  echo -e "\033[31mWARNING: High Temp - ${temp}C\033[0m"
elif [ $temp -gt 50 ]; then
  echo -e "\033[33mNormal Temp - ${temp}C\033[0m"
else
  echo -e "\033[32mCool Temp - ${temp}C\033[0m"
fi
Notes:
All methods use standard POSIX shell commands for maximum compatibility

The degree symbol (°) is optional and may be replaced with just 'C'

For embedded systems with limited shell support, Method 1 is the most universal

If thermal_zone0 doesn't exist, check other zones with ls /sys/class/thermal/

使用shell脚本 表示 温度的度
在 Shell 脚本中,你可以使用 printf 或 echo -e 来显示温度的单位符号(°C)。以下是几种在 RK3566 上友好显示温度的方法:

方法 1:使用 Unicode 编码显示 °C 符号
bash
#!/bin/bash

temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
echo "CPU Temp: ${temp}°C"
输出示例:

CPU Temp: 42°C
方法 2:使用 printf 格式化输出
bash
#!/bin/bash

temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
printf "Current Temperature: %d°C\n" "$temp"
输出示例:

Current Temperature: 42°C
方法 3:使用 ASCII 替代符号(兼容性更强)
如果终端不支持 Unicode 符号,可以用 C 代替 °C:

bash
#!/bin/bash

temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
echo "CPU Temp: ${temp}C"
输出示例:

CPU Temp: 42C
方法 4:带颜色和警告的 Shell 脚本
bash
#!/bin/bash

temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))

if [ "$temp" -gt 70 ]; then
    echo -e "\e[31mWARNING: High Temperature - ${temp}°C\e[0m"
elif [ "$temp" -gt 50 ]; then
    echo -e "\e[33mNormal Temperature - ${temp}°C\e[0m"
else
    echo -e "\e[32mCool Temperature - ${temp}°C\e[0m"
fi
输出示例:

如果温度 > 70°C → 红色警告

如果温度 50-70°C → 黄色提示

如果温度 < 50°C → 绿色正常

方法 5:持续监控温度(每 2 秒刷新)
bash
#!/bin/bash

while true; do
    temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
    printf "\rCurrent Temperature: %d°C" "$temp"
    sleep 2
done
按 Ctrl+C 退出监控

注意事项
确保 /sys/class/thermal/thermal_zone0/temp 存在(不同 RK3566 设备可能路径不同)。

如果终端不支持 Unicode,可以用 C 代替 °C。

部分嵌入式系统可能不支持 echo -e 颜色,可以去掉颜色代码。

你可以选择最适合你的方式,推荐 方法 1 或 方法 2 进行简单温度读取,方法 5 用于实时监控。

在SHELL脚本中,如果让小写的字幕o显示在上面?
在 Shell 脚本中,如果你想让小写字母 o 显示在数字的上方(类似上标效果),可以使用 Unicode 组合字符 或 ANSI 控制码 来实现。但由于终端限制,纯文本环境无法真正实现上标,以下是几种替代方案:

方法 1:使用 Unicode 上标字母(部分支持)
Unicode 提供了上标字母 ᵒ(U+1D52),但并非所有终端都能正确渲染:

bash
echo "42°C"  # 正常显示
echo "42ᵒC"  # 尝试用小上标 ᵒ 替代(可能显示异常)
输出可能类似:

42°C
42ᵒC
方法 2:用 printf 和垂直偏移(部分终端支持)
某些终端(如 terminator、gnome-terminal)支持 ANSI 控制码调整字符位置:

bash
printf "42\e[1A\e[1Do\e[1B\e[1DC\n"  # 尝试将 o 上移一行
效果不稳定,可能显示为:

42
 oC
方法 3:直接使用特殊符号 °(推荐)
大多数 Shell 环境支持 Unicode 的度符号 °(U+00B0),这是最可靠的方式:

bash
echo "42°C"  # 标准温度显示
输出:

42°C
方法 4:用 ASCII 艺术模拟上标
如果终端完全无法显示 Unicode,可以用换行和空格模拟:

bash
echo -e "42\n oC"
输出:

42
 oC
注意事项
终端兼容性:

Unicode 上标(如 ᵒ)在 SSH、嵌入式设备终端中可能显示为乱码。

推荐优先使用 °(U+00B0),它被广泛支持。

脚本可移植性:
如果目标设备是 RK3566 嵌入式系统,建议直接使用 C 或 °C,避免复杂格式。

检查终端支持:
运行 echo -e "\u00B0" 测试是否能正常显示 ° 符号。

最终推荐方案
bash
# 最兼容的写法(支持 Unicode 时用 °,否则用 o)
if echo -e "\u00B0" | grep -q "°"; then
    echo "42°C"
else
    echo "42oC"  # 降级显示
fi
输出:

支持 Unicode → 42°C

不支持 → 42oC

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2403330.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C语言字符数组初始化的5种方法(附带实例)

所谓初始化&#xff0c;就是在定义的同时进行赋值。 C语言中&#xff0c;初始化字符数组的方式多样&#xff0c;每种方式都有其特定的用途和优势。 1、使用字符串字面量初始化 最常见和简洁的初始化方式是使用字符串字面量。在这种方法中&#xff0c;我们直接将一个用双引号…

npm run dev 报错:Error: error:0308010C:digital envelope routines::unsupported

npm run dev时报错如下 原因&#xff1a;更换node版本导致 解决&#xff1a; 修改package.json文件&#xff0c;在相关构建命令之前加入 SET NODE_OPTIONS–openssl-legacy-provider 运行成功

基于LLaMA-Factory和Easy Dataset的Qwen3微调实战:从数据准备到LoRA微调推理评估的全流程指南

随着开源大模型如 LLaMA、Qwen 和 Baichuan 的广泛应用&#xff0c;其基于通用数据的训练方式在特定下游任务和垂直领域中的表现仍存在提升空间&#xff0c;因此衍生出针对具体场景的微调训练需求。这些训练涵盖预训练&#xff08;PT&#xff09;、指令微调&#xff08;SFT&…

idea中 maven 本地仓库有jar包,但还是找不到,解决打包失败和无法引用的问题

1、删除本地仓库中的文件 进入本地仓库对应jar包文件目录中删除_remote.repositories文件和结尾为.lastUpdated的文件 2、回到IDEA刷新Maven 3、查看之前引用不了的jar是否引入成功

(33)课54--??:3 张表的 join-on 连接举例,多表查询总结。

&#xff08;112&#xff09;3 张表的 join-on 连接举例 &#xff1a; &#xff08;113&#xff09; 多表查询总结 &#xff1a; &#xff08;114&#xff09;事务 &#xff1a; &#xff08;115&#xff09; &#xff08;116&#xff09; &#xff08;117&#xff09; …

SpringCloud学习笔记-3

声明&#xff1a;笔记来源于网络&#xff0c;如有侵权联系删除 1 openfeign 1&#xff09;openfeign远程调用声明式实现 1.启动类中添加注解 EnableFeignClients EnableFeignClients SpringBootApplication public class OrderMainApplication {public static void main(St…

BugKu Web渗透之eval

启动场景&#xff0c;打开网页&#xff0c;显示的是一段代码。 步骤一&#xff1a; 分析代码。 代码大概意思是&#xff1a; <?php//包含"flag.php"的文件include "flag.php"; //获取网页请求的hello数据$a $_REQUEST[hello]; //显示变量a的详…

DAY45 可视化

DAY 45 Tensorborad 之前的内容中&#xff0c;我们在神经网络训练中&#xff0c;为了帮助自己理解&#xff0c;借用了很多的组件&#xff0c;比如训练进度条、可视化的loss下降曲线、权重分布图&#xff0c;运行结束后还可以查看单张图的推理效果。 如果现在有一个交互工具可…

11.RV1126-ROCKX项目 API和人脸检测画框

一.ROCKX的API 1.ROCKX的作用 ROCKX的AI组件可以快速搭建 AI的应用&#xff0c;这些应用可以是车牌识别、人脸识别、目标识别&#xff0c;人体骨骼识别等等。主要用于各种检测识别。例如下图&#xff1a; 2.ROCKX人脸识别的API rockx_ret_t rockx_create(rockx_handle_t *han…

超构光学与 AR 的深度融合 | 攻克 VAC 与眼动范围难题

原文信息 原文标题&#xff1a;“Three-dimensional varifocal meta-device for augmented reality display” 第一作者&#xff1a;宋昱舟&#xff0c;袁家琪&#xff0c;陳欽杪&#xff0c;刘小源 &#xff0c;周寅&#xff0c;程家洛&#xff0c;肖淑敏*&#xff0c;陈沐…

[ Qt ] | 与系统相关的操作(三):QFile介绍和使用

目录 之前的操作文件的方式 Qt中的文件操作简介 QFile 打开 读 写 关闭 一个例子来说明 QFileInfo 之前的操作文件的方式 C语言中&#xff0c;fopen 打开文件&#xff0c;fread fwrite 读写文件&#xff0c;fclose 关闭文件。 C中&#xff0c;fstream 打开文件&…

软件工程:如何做好软件产品

1、什么是产品 从项目到产品 产品&#xff1a;满足行业共性需求的标准产品。即要能够做到配置化的开发&#xff0c;用同一款产品最大限度地满足不同客户的需求&#xff0c;同时让产品具有可以快速响应客户需求变化的能力。 好的产品一定吸收了多个项目的共性&#xff0c;一定是…

蓝桥杯 省赛 2025python(B组)题目(分析)

目录 第一题 为什么答案是103而不是104&#xff1f; 第二题 为什么必须按长度排序&#xff1f; 第三题 易错点总结 第四题 逻辑问题&#xff1a; 可能超过时间复杂度的代码示例 1. 暴力枚举所有可能的子串 2. 递归回溯 第五题 1. 暴力枚举法 2. 优化枚举 3.数…

React - 组件通信

组件通信 概念&#xff1a;组件通信就是组件之间数据传递&#xff0c;根据组件嵌套关系不同&#xff0c;有不同的通信方法 父传子 —— 基础实现 实现步骤 父组件传递数据 - 在子组件标签上绑定属性子组件接收数据 - 子组件通过props参数接收数据 声明子组件并使用 //声明子…

飞牛使用Docker部署Tailscale 内网穿透教程

之前发过使用docker部署Tailscale的教程&#xff0c;不过是一年前的事情了&#xff0c;今天再重新发表一遍&#xff0c;这次使用compose部署更加方便&#xff0c;教程也会更加详细一点&#xff0c;希望对有需要的朋友有所帮助&#xff01; 对于大部分用户来说&#xff0c;白嫖 …

《数据挖掘》- 房价数据分析

这里写目录标题 采用的技术1. Python编程语言2. 网络爬虫库技术点对比与区别项目技术栈的协同工作流程 代码解析1. 导入头文件2. 读取原始数据3. 清洗数据4. 数据分割4.1 统计房屋信息的分段数量4.2 将房屋信息拆分为独立列4.3 处理面积字段4.4 删除原始房屋信息列 5. 可视化分…

C++之动态数组vector

Vector 一、什么是 std::vector&#xff1f;二、std::vector 的基本特性&#xff08;一&#xff09;动态扩展&#xff08;二&#xff09;随机访问&#xff08;三&#xff09;内存管理 三、std::vector 的基本操作&#xff08;一&#xff09;定义和初始化&#xff08;二&#xf…

【Zephyr 系列 11】使用 NVS 实现 BLE 参数持久化:掉电不丢配置,开机自动加载

🧠关键词:Zephyr、NVS、非易失存储、掉电保持、Flash、AT命令保存、配置管理 📌目标读者:希望在 BLE 模块中实现掉电不丢配置、支持产测参数注入与自动加载功能的开发者 📊文章长度:约 5200 字 🔍 为什么要使用 NVS? 在实际产品中,我们经常面临以下场景: 用户或…

【Android】Android Studio项目代码异常错乱问题处理(2020.3版本)

问题 项目打开之后&#xff0c;发现项目文件直接乱码&#xff0c; 这样子的 这本来是个Java文件&#xff0c;结果一打开变成了这种情况&#xff0c;跟见鬼一样&#xff0c;而且还不是这一个文件这样&#xff0c;基本上一个项目里面一大半都是这样的问题。 处理方法 此时遇到…

一些免费的大A数据接口库

文章目录 一、Python开源库&#xff08;适合开发者&#xff09;1. AkShare2. Tushare3. Baostock 二、公开API接口&#xff08;适合快速调用&#xff09;1. 新浪财经API2. 腾讯证券接口3. 雅虎财经API 三、第三方数据平台&#xff08;含免费额度&#xff09;1. 必盈数据2. 聚合…