The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Create a Simple Script to Get System Information
#1
I found this elsewhere and then modified it a bit to add more info.

Simply ssh into your moode and then

nano your_file_name.sh

and then paste this in it and save the changes:


Code:
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU  temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# Edits by: Cogitech (add Core Volts and CPU Freq)
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU temp   => $(vcgencmd measure_temp)"
echo "CPU temp   => $((cpu/1000))'C"
echo "Core Volts => $(vcgencmd measure_volts)"
echo "CPU Freq   => $(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq) KHz"


Then do:


Code:
chmod +x your_file_name.sh


To run the script, simply:


Code:
./your_file_name.sh


The output will look something like:

Code:
Wed Dec 20 17:18:46 MST 2023 @ moode
-------------------------------------------
GPU temp   => temp=45.7'C
CPU temp   => 46'C
Core Volts => volt=0.8600V
CPU Freq   => 700000 KHz


You can also do the following if you want to monitor this info while playing music, running tests (resampling, EQ, DSP, etc.)

Code:
watch ./your_file_name.sh
Reply


Messages In This Thread
Create a Simple Script to Get System Information - by cogitech - 12-21-2023, 12:30 AM

Forum Jump: