SkatterBencher is working on a telemetry tool for the Raspberry Pi
Even Johnny 5 can't deal with all of this data!
Getting accurate data from your Raspberry Pi is easy using the vcgencmd command but this project from SkatterBencher measures every aspect of our favorite single board computer and handily records it to a CSV file.
The project's creator noticed a lack of comprehensive telemetry tools, noting that others had created their own projects for specific data (just like our project.) Skatterbencher wanted a tool that worked more like HWiNFO, a tool to monitor and record telemetry data during a stress test. While this script doesn't (yet) perform a stress test, it does automatically record multiple datapoints for later analysis.
Written in Python, this script calls the vcgencmd command and provides real-time data on how our Raspberry Pi is performing. We took it for a spin on our Raspberry Pi 5 housed inside Sunfounder's Pironman 5 case.
First of all, we get a plethora of Pi-data written to the Linux terminal. From the data, we know the clock speeds for our Arm CPU, GPU, UART, PWM, and many other interfaces. That Arm CPU temperature is displayed in its own section, just above the voltages for the CPU core and the onboard RAM. Next up we get data on CPU throttling which triggers once the CPU hits 82 degrees Celsius. Lastly, we get data on the PMIC (Power Management IC) which tells us about every aspect of the PMIC. This is especially useful for the new Raspberry Pi 5 which has a beefy PMIC compared to previous models.
All of this data updates every second, so we get a constantly refreshed display. But for those of us who like to pore over the data in a spreadsheet, us included, then fear not, as the data is logged to a CSV file that can be easily imported into Microsoft Excel, LibreOffice, or even Google Sheets. The CSV output gives us granular-level data. We can see how our CPU is being used and its speed. We also get the data for PMIC, clocks, and temperature logged to the file every second.
Running the code is a simple matter of cloning the repository.
git clone https://github.com/SkatterBencher/rpi5-telemetry-python.git
Changing directory to the cloned repository, and we can then run the code using Python.
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
cd rpi5-telemetry-python
python telemetry_printCsvWorks_b.py
We get the real-time output and data logged to CSV for later use in a spreadsheet. All it needs now is a stress test option and we may have the perfect tool to stress and record our Raspberry Pis.
The project source can be found on the SkatterBencher GitHub page.
Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".
-
bit_user IIUC, this is basically just a python script that wraps vcgencmd and displays it interactively or logs the values? I wonder what's the performance impact of doing that, especially for so many values that might be of no interest to the user.Reply
I think a better approach would be to find out what sysfs interface vcgencmd is using for things, and then accessing those nodes directly. That eliminates the overhead of running it and parsing its output. Then, give users an option of which stats they want, so you don't waste time polling stuff they don't care about. Basically, they should be trying to replicate what turbostat does.
The efficiency of monitoring tools can be really important, since generally want the tool to have minimal impact on either the system or whatever benchmark it happens to be running.
Finally, I hope it supports polling intervals above 1 Hz. A lot of these values can change significantly, in much less time than that. For my own performance measurements, I tend to use a polling interval of 0.1 sec (i.e. 10 Hz).