https://www.raspberrypi.com/documentation/computers/os.html#vcgencmd
# 安裝
sudo apt-get install python3-pip
sudo pip-3.2 install setuptools
sudo pip-3.2 install git+https://github.com/nicmcd/vcgencmd.git
sudo python3 setup.py install
# 功能
python3 -m vcgencmd
# 解除安裝
sudo pip-3.2 uninstall vcgencmd
$vcgendcmd command
# 溫度
vcgencmd measure_temp
temp=53.5'C
# 電壓
vcgencmd measure_volts core
for id in core sdram_c sdram_i sdram_p ; do echo -e "$id:\t$(vcgencmd measure_volts $id)" ; done
output:
core: volt=0.8500V
sdram_c: volt=1.1000V
sdram_i: volt=1.1000V
sdram_p: volt=1.1000V
#時脈
vcgencmd measure_clock arm
frequency(48)=1500345728
for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do echo -e "$src:\t$(vcgencmd measure_clock $src)" ; done
arm: frequency(48)=1500398464
core: frequency(1)=500000992
h264: frequency(28)=500000992
isp: frequency(45)=500000992
v3d: frequency(46)=500000992
uart: frequency(22)=47988280
pwm: frequency(25)=107143064
emmc: frequency(50)=250000496
pixel: frequency(29)=150002928
vec: frequency(10)=0
hdmi: frequency(0)=0
dpi: frequency(4)=0
控制影像輸出
display_power子命令可用來控制樹莓派上不同影像輸出介面的啟閉,以 4B 來說影像輸出介面包含 HDMI0、HDMI1、DSI 與類比輸出等。鍵入 vcgencmd display_power 0 可關閉目前的影像介面,開啟則可以鍵入 vcgencmd display_power 1 。若要指定影像輸出介面,可再多帶入一個 ID 參數來指定,該 ID 列表如下:
Display | ID |
Main LCD | 0 |
Secondary LCD | 1 |
HDMI 0 | 2 |
Composite | 3 |
HDMI 1 | 7 |
查型號
cat /sys/firmware/devicetree/base/model