2024-05-16 02:45:53 发布
网友
是否有一个与屏幕上的黄色闪电或红色PWR LED闪烁相同的东西可以从Python脚本中使用,以了解树莓是否存在电源问题
谢谢
在@MarkSetchell(谢谢!)的帮助下,这一切都很有效。我已经在RPI 3B+上测试了它,但有一些电源问题:
import subprocess pt = subprocess.Popen(['/opt/vc/bin/vcgencmd', 'get_throttled'],stdout=subprocess.PIPE,stderr=subprocess.PIPE) (res,err) = pt.communicate() res = res.decode().split("=")[1] res = res.rstrip("\n") print ("Current Power Issues? = ",(int(res,0) & 0x01) == 0x01) print ("Any Power issues before? = ",(int(res,0) & 0x50000) == 0x50000)
在@MarkSetchell(谢谢!)的帮助下,这一切都很有效。我已经在RPI 3B+上测试了它,但有一些电源问题:
相关问题 更多 >
编程相关推荐