{"id":14978055,"url":"https://github.com/sushantnadkar/vcgencmd","last_synced_at":"2025-06-13T08:32:43.228Z","repository":{"id":54768193,"uuid":"255958026","full_name":"sushantnadkar/vcgencmd","owner":"sushantnadkar","description":"Python binding for Raspberry Pi's Video Core General Command Service (vcgencmd)","archived":false,"fork":false,"pushed_at":"2023-11-05T13:39:58.000Z","size":15,"stargazers_count":4,"open_issues_count":15,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T17:10:28.095Z","etag":null,"topics":["python","raspberry-pi","rpi","vcgencmd","videocore","videocore-gpu"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sushantnadkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-15T15:23:31.000Z","updated_at":"2024-09-17T09:00:52.000Z","dependencies_parsed_at":"2024-09-18T23:03:11.763Z","dependency_job_id":null,"html_url":"https://github.com/sushantnadkar/vcgencmd","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"68578dd887f2e0f62c1e8bf95323574cfc489be0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sushantnadkar/vcgencmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantnadkar%2Fvcgencmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantnadkar%2Fvcgencmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantnadkar%2Fvcgencmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantnadkar%2Fvcgencmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sushantnadkar","download_url":"https://codeload.github.com/sushantnadkar/vcgencmd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sushantnadkar%2Fvcgencmd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259610142,"owners_count":22884200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","raspberry-pi","rpi","vcgencmd","videocore","videocore-gpu"],"created_at":"2024-09-24T13:56:47.688Z","updated_at":"2025-06-13T08:32:43.159Z","avatar_url":"https://github.com/sushantnadkar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python binding for RaspberryPi vcgencmd command-line tool\n\n## Summary\n\n'vcgencmd' is a command line utility that can get various pieces of information from the VideoCore GPU on the Raspberry Pi. This Python package is a binding to that tool.\n\n## Install\n\n`vcgencmd` is compatible with both Python2.7+ and Python3.x. These instructions will be for Python 3.x. You can substitute the python and pip commands accordingly for other versions. The installer requires the `setuptools` package.\n\n(Note: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.)\n\n### Requirements\nPip (Python 3 version):\n```bash\nsudo apt-get install python3-pip\n```\nSetuptools (Python 3 version):\n```bash\nsudo pip3 install setuptools\n```\n\n### Python package manager (PIP)\nInstall globally:\n```bash\nsudo pip3 install vcgencmd\n```\nInstall locally:\n```bash\npip3 install --user vcgencmd\n```\n\n### Source installation\nInstall globally:\n```bash\nsudo pip3 install -e .\n```\nInstall locally:\n```bash\npip3 install -e . --user\n```\n\n## Uninstall\n```bash\nsudo pip3 uninstall vcgencmd\n```\n\n## Usage\n\n```\nfrom vcgencmd import Vcgencmd\n\nvcgm = Vcgencmd()\noutput = vcgm.version()\nprint(output)\n\n```\n\n## Commands\n\n#### get_sources(src)\n\nReturns list of all possible sources/arguments,  required for some of the methods listed below.\n\nExample: `get_sources(\"mem\")` will return `[\"arm\", \"gpu\"]` which are the sources/arguments for `get_mem(source)` that returns the memory of the source passed as argument to it.\n\n#### vcos_version()\n\nReturns a string with build date and version of the firmware on the VideoCore.\n\n#### vcos_log_status()\n\nReturns the error log status of the various VideoCore software areas in JSON format.\n\n#### version()\n\nReturns the string containing build date and version of the firmware on the VideoCore.\n\n#### get_camera()\n\nReturns the enabled and detected state of the official camera in JSON format. 1 means yes, 0 means no. Whilst all firmware (except cutdown versions) will support the camera, this support needs to be enabled by using [raspi-config](https://www.raspberrypi.org/documentation/configuration/raspi-config.md).\n\n#### get_throttled()\n\nReturns the throttled state of the system in JSON format. This is a bit pattern - a bit being set indicates the following meanings:\n\n| Bit | Meaning |\n|:---:|---------|\n| 0   | Under-voltage detected |\n| 1   | Arm frequency capped |\n| 2   | Currently throttled |\n| 3   | Soft temperature limit active |\n| 16  | Under-voltage has occurred |\n| 17  | Arm frequency capping has occurred |\n| 18  | Throttling has occurred |\n| 19  | Soft temperature limit has occurred |\n\nA value of zero indicates that none of the above conditions is true.\n\nTo find if one of these bits has been set, convert the value returned to binary, then number each bit along the top. You can then see which bits are set. For example:\n\n``0x50000 = 0101 0000 0000 0000 0000``\n\nAdding the bit numbers along the top we get:\n\n```text\n19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0\n 0  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0\n```\n\nFrom this we can see that bits 18 and 16 are set, indicating that the Pi has previously been throttled due to under-voltage, but is not currently throttled for any reason.\n\n#### measure_temp()\n\nReturns the temperature of the SoC as measured by the on-board temperature sensor.\n\n#### measure_clock(clock)\n\nThis returns the current frequency of the specified clock in Hertz. List of clock options can be retrieved by `get_sources(\"clock\")`. The options are:\n\n| clock | Description |\n|:-----:|-------------|\n| arm   | ARM cores |\n| core  | VC4 scaler cores |\n| H264  | H264 block |\n| isp   | Image Signal Processor |\n| v3d   | 3D block |\n| uart  | UART |\n| pwm   | PWM block (analogue audio output) |\n| emmc  | SD card interface |\n| pixel | Pixel valve |\n| vec | Analogue video encoder |\n| hdmi | HDMI |\n| dpi | Display Peripheral Interface |\n\n#### measure_volts(block)\n\nReturns the current voltage used by the specific block in volts. List of voltage sources can be retrieved by `get_sources(\"volts\")`. The options are:\n\n| block | Description |\n|:-----:|-------------|\n| core | VC4 core voltage |\n| sdram_c | |\n| sdram_i | |\n| sdram_p | |\n\n#### otp_dump()\n\nReturns the content of the One Time Programmable (OTP) memory, which is part of the SoC. These are 32 bit values, indexed from 8 to 64, in JSON format. See the [OTP bits page](https://www.raspberrypi.org/documentation/hardware/raspberrypi/otpbits.md) for more details.\n\n#### get_mem(type)\n\nReturns the amount of memory allocated to the ARM cores and the VC4, in Megabytes. List of memory type options can be retrieved by `get_sources(\"mem\")`. The options are:\n\n| type | Description |\n|:-----:|-------------|\n| arm | ARM core |\n| gpu | VC4 |\n\n**Note:** On a Raspberry Pi 4 with greater than 1GB of RAM, the `arm` option is inaccurate. This is because the GPU firmware which implements this command is only aware of the first gigabyte of RAM on the system, so the `arm` setting will always return 1GB minus the `gpu` memory value. To get an accurate report of the amount of ARM memory, use one of the standard Linux commands, such as `free` or `cat /proc/meminfo`\n\n#### codec_enabled(type)\n\nReturns whether the specified CODEC type is enabled, in boolean type. Possible options for type are AGIF, FLAC, H263, H264, MJPA, MJPB, MJPG, **MPG2**, MPG4, MVC0, PCM, THRA, VORB, VP6, VP8, **WMV9**, **WVC1**. This list can be retrieved by `get_sources(\"codec\")`. Those highlighted currently require a paid for licence (see the [FAQ](https://www.raspberrypi.org/documentation/faqs/README.md#pi-video) for more info), except on the Pi4, where these hardware codecs are disabled in preference to software decoding, which requires no licence. Note that because the H265 HW block on the Raspberry Pi4 is not part of the Videocore GPU, its status is not accessed via this command.\n\n#### get_config(type | name)\n\nThis returns a JSON object of all the configuration items of the specified type that have been set in `/boot/config.txt`, or a single configuration item. Possible values for type parameter are **int, str**, or simply use the name of the configuration item.\n\n#### get_lcd_info()\n\nReturns the resolution and colour depth of any attached display, in JSON format.\n\n#### mem_oom()\n\nReturn JSON object containing statistics on any Out Of Memory events occuring in the VC4 memory space.\n\n#### mem_reloc_stats()\n\nReturn JSON object containing statistics from the relocatable memory allocator on the VC4.\n\n#### read_ring_osc()\n\nReturn JSON object containing the curent speed, voltage and temperature of the ring oscillator.\n\n#### hdmi_timings()\n\nReturns the current HDMI settings timings, in JSON format. See [Video Config](https://www.raspberrypi.org/documentation/configuration/config-txt/video.md) for details of the values returned.\n\n#### dispmanx_list()\n\nReturns a JSON object of all dispmanx items currently being displayed.\n\n#### display_power_on(display)\n\nSets the display power state to *on* of the display whose ID is passed as the parameter.\n\n#### display_power_off(display)\n\nSets the display power state to *off* of the display whose ID is passed as the parameter.\n\n#### display_power_state(display)\n\nReturns the display power state as *on* or *off* of the display whose ID is passed as the parameter.\n\nThe display ID for the preceding three methods are determined by the following table.\n\n| Display | ID |\n| --- | --- |\n|Main LCD       | 0 |\n|Secondary LCD  | 1 |\n|HDMI 0         | 2 |\n|Composite      | 3 |\n|HDMI 1         | 7 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsushantnadkar%2Fvcgencmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsushantnadkar%2Fvcgencmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsushantnadkar%2Fvcgencmd/lists"}