View: 7499|Reply: 0

How do i monitor freq and temp on OP+ (H3)

[Copy link]

4

threads

21

posts

449

credits

Intermediate member

Rank: 3Rank: 3

credits
449
Published in 2015-10-26 12:24:17 | Show all floors |Read mode
Edited by Vlad at 2015-10-26 12:27

Here is my bash script, namely sensors.sh:
  1. #/bin/bash
  2. while (true); do
  3.     cpu_cur=$(( `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq` / 1000 ))
  4.     cpu_max=$(( `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq` / 1000 ))
  5.     cpu_min=$(( `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq` / 1000 ))
  6.     cpu_cur="$(printf "%4s" $cpu_cur)"
  7.     cpu_max="$(printf "%4s" $cpu_max)"
  8.     cpu_min="$(printf "%4s" $cpu_min)"
  9.     tempr=`cat /sys/devices/virtual/hwmon/hwmon1/temp1_input`
  10.     tempr="$(printf "%3s" $tempr)"
  11.     ddr_cur=$(( `cat /sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/cur_freq` / 1000 ))
  12.     ddr_max=$(( `cat /sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/max_freq` / 1000 ))
  13.     ddr_min=$(( `cat /sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/min_freq` / 1000 ))
  14.     ddr_cur="$(printf "%4s" $ddr_cur)"
  15.     ddr_max="$(printf "%4s" $ddr_max)"
  16.     ddr_min="$(printf "%4s" $ddr_min)"
  17.     echo -ne "  CPU (MHz): $cpu_cur (min $cpu_min, max $cpu_max)  TEMPERATURE: $tempr  MEMORY (MHz): $ddr_cur (min $ddr_min, max $ddr_max)   "\\r
  18.     sleep 0.2
  19. done
Copy code

It was designed by reverse engenering. is there docs by officials?


You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list