CHAPTER 4

image

vcgencmd

Apart from the usual Linux commands that display status, the Raspberry Pi includes a custom command named vcgencmd, which can report voltages and temperatures. This chapter documents the known features of the command.

The executable file behind the command is /usr/bin/vcgencmd.

vcgencmd Commands

There is no man page for this command, but the list of all supported options can be displayed with the commands option. The command output has been broken over several lines for readability:

$ vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing,
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"

At the time of this writing, some of these options remained undocumented. A summary list of options is itemized in Table 4-1.

Table 4-1. Summary of vcgencmd Command-Line Options

Option Name

Argument(s)

Description

ap_output_control

  

ap_output_post_processing

  

cache_flush

 

Flushes GPU’s L1 cache

codec_enabled

codec

Reports status of codec

commands

 

Lists options

disk_notify

  

egl_platform_switch

  

file

  

get_config

  

get_lcd_info

 

Returns height, width, and depth of the display frame buffer

hdmi_ntsc_freqs

  

inuse_notify

  

led_control

  

measure_clock

clock

Reports frequency

measure_temp

 

Reports SoC temperature

measure_volts

device

Reports voltage

mem_oom

 

Reports Out of Memory events

mem_reloc_stats

 

Reports relocatable memory stats

mem_validate

  

otp_dump

  

pm_get_status

  

pm_set_policy

  

pm_show_stats

  

pm_start_logging

  

pm_stop_logging

  

render_bar

  

set_backlight

  

set_bus_arbiter_mode

  

set_logging

  

Option measure_clock

This firmware access option provides the user with clock rate information, according to the argument appearing after measure_clock. Valid values for <clock> are listed in Table 4-2.

vcgencmd  measure_clock  <clock>

Table 4-2. Valid Arguments for the measure_clock Option

Clock

Description

arm

ARM CPU

core

Core

dpi

Display Pixel Interface

emmc

External MMC device

h264

h.264 encoder

hdmi

HDMI clock

isp

Image Sensor Pipeline

pixel

Pixel clock

pwm

Pulse Width Modulation

uart

UART clock

v3d

Video 3D

vec

 

The following shell script is often used to list all available clocks:

$ for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do
  echoe "$src : $(vcgencmd measure_clock $src)" ;
done

Here is the example output:

arm  :   frequency (45)=700074000
core :   frequency (1)=250000000
h264 :   frequency (28)=250000000
isp  :   frequency (42)=250000000
v3d  :   frequency (43)=250000000
uart :   frequency (22)=3000000
pwm  :   frequency (25)=0
emmc :   frequency (47)=100000000
pixel :  frequency (29)=108000000
vec   :  frequency (10)=0
hdmi  :  frequency (9)=163683000
dpi   :  frequency (4)=0

Option measure_volts

The measure_volts option allows the various subsystem voltages to be reported:

$ for id in core sdram_c sdram_i sdram_p ; do
  echoe "$id: $(vcgencmd measure_volts $id)" ;
done
core   :  volt=1.20V
sdram_c:  volt=1.20V
sdram_i:  volt=1.20V
sdram_p:  volt=1.23V

Table 4-3 provides a legend for the output report lines.

Table 4-3. Valid Device Names for measure_volts

Device

Description

core

Core

sdram_c

SDRAM controller

sdram_i

SDRAM I/O

sdram_p

SDRAM physical

Option measure_temp

The measure_temp option allows the user to retrieve the SoC temperature, in degrees Celsius.

$ vcgencmd measure_temp
temp=36.3 °C

In this example, the relatively idle core was reported to be 36.3°C.

Option codec_enabled

The codec_enabled option reports the operational status of the codecs supported by the Raspberry Pi. Valid codec names are listed in Table 4-4. The codec support can be summarized with the following command:

$ for id in H264 MPG2WCV1 ; do
  echoe "$id: $(vcgencmd codec_enabled $id)";
done
H264:   H264=enabled
MPG2:   MPG2=disabled
WCV1:   WCV1=disabled

Table 4-4. vcgencmd CODEC Names

Name

Description

H264

h.264 CODEC

MPG2

MPEG-2 CODEC

WVC1

VC1 CODEC

Option version

The version option reports the GPU firmware version:

$ vcgencmd version
Oct 25 2012 16:37:21
Copyright (c) 2012 Broadcom
version 346337 (release)

Option get_lcd_info

While get_lcd_info was undocumented at the time of this writing, it appears to provide LCD/monitor width and height, and pixel depth:

$ vcgencmd get_lcd_info
720 480 24

Option get_config

The get_config option is useful in scripts that need to query your Raspberry Pi’s configuration, as defined in /boot/config.txt. See Chapter 2 for the options that can be queried. For example, a script can query whether avoid_safe_mode is in effect:

$ vcgencmd get_config avoid_safe_mode
avoid_safe_mode=0
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.17.46