【树莓派】:电压监控一直提示low voltage warning,please check your power supply

编程入门 行业动态 更新时间:2024-10-06 10:40:41

【树莓派】:<a href=https://www.elefans.com/category/jswz/34/1763661.html style=电压监控一直提示low voltage warning,please check your power supply"/>

【树莓派】:电压监控一直提示low voltage warning,please check your power supply

使用VNC连接树莓派时桌面任务栏一直提示low voltage warning,please check your power supply
【现象分析】:
对于使用集成raspberry 4B系列产品使用官方电源一般不会有报警,本报警主要为使用CM4核心板+自制载板时出现的异常现象,报警提示如下:

【原因分析】:
1.CM4核心板需要3.3v的供电,首先分析是电压供电不足导致的报警:

发生报警时,首先检查核心板3.3V的供电是否异常,负载过多会存在较大压降,
ioboard的具体原理参考:
核心板模块介绍:
载板模块介绍:
官网整个模块介绍:

2.电压检测脚本:
1.使用sh检测

#!/bin/bash# Before running this script, make sure you have sysbench installed:
#           sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here:  If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
#
# 45.6'C 1400 / 600 MHz 1.3813V -
# 55.3'C 1400 / 1400 MHz 1.3813V -
# 58.0'C 1400 / 1400 MHz 1.3813V -
# 60.2'C 1400 / 1400 MHz 1.3813V -
# 60.2'C 1400 / 1400 MHz 1.3813V -
# 61.1'C 1400 / 1400 MHz 1.3813V -
# 61.1'C 1400 / 1400 MHz 1.3813V -
# 60.8'C 1400 / 1400 MHz 1.3813V -# If your power supply can't provide a stable 5V 2.5A or if the cable is not good enough, you should get something like:
#
# 39.7'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 48.3'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 52.1'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 54.8'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 55.8'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 56.4'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 57.5'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 58.0'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,
# 59.6'C 1400 / 1400 MHz 1.3875V - Throttling has occurred, Under-voltage has occurred,function throttleCodeMask {perl -e "printf \"%s\", $1 & $2 ? \"$3\" : \"$4\""
}# Make the throttled code readable
#
# See the `get_throttled` method documentation on: .md
#function throttledToText {throttledCode=$1throttleCodeMask $throttledCode 0x80000 "Soft temperature limit has occurred, " ""throttleCodeMask $throttledCode 0x40000 "Throttling has occurred, " ""throttleCodeMask $throttledCode 0x20000 "Arm frequency capping has occurred, " ""throttleCodeMask $throttledCode 0x10000 "Under-voltage has occurred, " ""throttleCodeMask $throttledCode 0x8 "Soft temperature limit active, " ""throttleCodeMask $throttledCode 0x4 "Currently throttled, " ""throttleCodeMask $throttledCode 0x2 "Arm frequency capped, " ""throttleCodeMask $throttledCode 0x1 "Under-voltage detected, " ""
}# Main script, kill sysbench when interrupted
trap 'kill -HUP 0' EXIT
sysbench --test=cpu --cpu-max-prime=10000000 --num-threads=4 run > /dev/null &
maxfreq=$(( $(awk '{printf ("%0.0f",$1/1000); }' < /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq) -15 ))# Read sys info, print and loop
while true; dotemp=$(vcgencmd measure_temp | cut -f2 -d=)real_clock_speed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f", $2 / 1000000); }' )sys_clock_speed=$(awk '{printf ("%0.0f",$1/1000); }' </sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)voltage=$(vcgencmd measure_volts | cut -f2 -d= | sed 's/000//')throttled_text=$(throttledToText $(vcgencmd get_throttled | cut -f2 -d=))echo "$temp $sys_clock_speed / $real_clock_speed MHz $voltage - $throttled_text"sleep 5
done

2.添加到ssh连接时自动展示:
在/etc/profile.d/新增temp-volt.sh脚本文件,具体代码如下

#换行
echo ''
#运行命令查看cpu温度
#echo `vcgencmd measure_temp`
#执行脚本文件
source  ~/raspberry-power-supply-check.sh

raspberry-power-supply-check.sh脚本内容:

#!/bin/bash
function throttleCodeMask {perl -e "printf \"%s\", $1 & $2 ? \"$3\" : \"$4\""
}
function throttledToText {throttledCode=$1throttleCodeMask $throttledCode 0x80000 "Soft temperature limit has occurred, " ""throttleCodeMask $throttledCode 0x40000 "Throttling has occurred, " ""throttleCodeMask $throttledCode 0x20000 "Arm frequency capping has occurred, " ""throttleCodeMask $throttledCode 0x10000 "Under-voltage has occurred, " ""throttleCodeMask $throttledCode 0x8 "Soft temperature limit active, " ""throttleCodeMask $throttledCode 0x4 "Currently throttled, " ""throttleCodeMask $throttledCode 0x2 "Arm frequency capped, " ""throttleCodeMask $throttledCode 0x1 "Under-voltage detected, " ""
}
temp=$(vcgencmd measure_temp | cut -f2 -d=)
real_clock_speed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f", $2 / 1000000); }' )
sys_clock_speed=$(awk '{printf ("%0.0f",$1/1000); }' </sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
voltage=$(vcgencmd measure_volts | cut -f2 -d= | sed 's/000//')
throttled_text=$(throttledToText $(vcgencmd get_throttled | cut -f2 -d=))
echo "$temp $sys_clock_speed / $real_clock_speed MHz $voltage - $throttled_text"

结果展示:

参考链接:

更多推荐

【树莓派】:电压监控一直提示low voltage warning,please check your power supply

本文发布于:2024-02-14 13:35:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1763504.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电压   提示   voltage   树莓派   power

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!