用vcgencmd获取树莓派硬件状态数据
本帖最后由 八宝粥 于 2013-6-30 01:32 编辑命令可用性这些是从固件(版本362371)中获得的命令.
vcgencmd命令显示可用的命令列表.root@raspberrypi:~# vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit,
pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, version, commands,
set_vll_dir, led_control, set_backlight, set_logging, get_lcd_info, set_bus_arbiter_mode,
cache_flush, otp_dump, codec_enabled, measure_clock, measure_volts, measure_temp, get_config,
hdmi_ntsc_freqs, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled,
sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, file,
vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"vcgencmd measure_clock <clock>显示时序, 可指定arm, core, h264, isp, v3d, uart, pwm, emmc, pixel, vec, hdmi, dpi.root@raspberrypi:~# \
> 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(45)=700000000
core: frequency(1)=250000000
h264: frequency(28)=0
isp: frequency(42)=250000000
v3d: frequency(43)=250000000
uart: frequency(22)=3000000
pwm: frequency(25)=0
emmc: frequency(47)=100000000
pixel:frequency(29)=154000000
vec: frequency(10)=0
hdmi: frequency(9)=163682000
dpi: frequency(4)=0
vcgencmd measure_volts <id>显示电压. id可以是core, sdram_c, sdram_i, sdram_p, 如不指定默认为core.root@raspberrypi:~# \
> for id in core sdram_c sdram_i sdram_p ; do \
> echo -e "$id:\t$(vcgencmd measure_volts $id)" ; \
> done
core: volt=1.20V
sdram_c: volt=1.20V
sdram_i: volt=1.20V
sdram_p: volt=1.23V
vcgencmd measure_temp显示BCM2835芯片的温度.root@raspberrypi:~# vcgencmd measure_temp
temp=42.8'C
vcgencmd codec_enabled <codec>显示指定解码器是否可用, 解码器分别有H264, MPG2, WVC1, MPG4, MJPG, WMV9. 请注意MPG2和VC1是需要购买证书的.root@raspberrypi:~# \
> for codec in H264 MPG2 WVC1 MPG4 MJPG WMV9 ; do \
> echo -e "$codec:\t$(vcgencmd codec_enabled $codec)" ; \
> done
H264: H264=enabled
MPG2: MPG2=enabled
WVC1: WVC1=enabled
MPG4: MPG4=enabled
MJPG: MJPG=enabled
WMV9: WMV9=enabled如果你按照这篇帖子的内容设置了VP6和VP8 (WEBM)解码器, 虽然能正常工作, 但你要注意这只是实验, 你需要自行承担后果.
vcgencmd get_config 显示你设置的配置参数. 参数可以是指定的参数名或者int, 用number-datatype参数显示全部配置, 用str参数以数据类型格式显示所有配置vcgencmd get_config int
arm_freq=1000
core_freq=500
sdram_freq=600
over_voltage=6
disable_overscan=1
force_pwm_open=1
vcgencmd get_mem arm/gpu 显示CPU和GPU分别占了多少内存.root@raspberrypi:~# vcgencmd get_mem arm && vcgencmd get_mem gpu
arm=448M
gpu=64M
vcgencmd版本显示固件版本root@raspberrypi:~# vcgencmd version
Jan 13 2013 16:24:29
Copyright (c) 2012 Broadcom
version 362371 (release)
对于剩余其他命令的参数和功能还不大清楚.更多
[*]这篇文章也列出一些vcgencmd选项
页:
[1]