sushantnadkar / vcgencmd

Python binding for Raspberry Pi's Video Core General Command Service (vcgencmd)
MIT License
4 stars 9 forks source link

issue with measure_clock("arm") not reporting correctly depending how it is run. #1

Open ivyvisors opened 4 years ago

ivyvisors commented 4 years ago

when run from a script, measure_clock("arm") the output is the maximum clock speed of the CPU instead of the actual clock speed.

Example:

from vcgencmd import Vcgencmd
vcgm = Vcgencmd()
Hz = vcgm.measure_clock("arm")
print(Hz)

running using python3

pi@behemoth:~ $ python3 vcg.py 
1000000000

Though when running in an interactive python3 shell:

pi@behemoth:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from vcgencmd import Vcgencmd
>>> vcgm = Vcgencmd()
>>> Hz = vcgm.measure_clock("arm")
>>> print(Hz)
700000000
>>> 

The current running clock is shown.

ivyvisors commented 4 years ago

Also, the same issue is found in the following module:

https://github.com/nicmcd/vcgencmd