HOME
  Security
   Software
    Hardware
  
FPGA
  CPU
   Android
    Raspberry Pi
  
nLite
  Xcode
   etc.
    ALL
  
English Translate 中文翻訳
LINK
BACK
 

2017/10/02

Orange Pi PC 2 Armbianの CPU温度の取得、CPUの動作周波数 CPUガバナーの変更方法など Orange Pi PC 2 Armbianの CPU温度の取得、CPUの動作周波数 CPUガバナーの変更方法など

(Orange Pi PC2 H5 Armbianの CPU温度の取得、CPUの動作周波数の変更方法 CPUFreq Governors)

Tags: [Raspberry Pi], [Orange Pi], [電子工作], [海外通販], [通信販売]





● Shenzhen Xunlong Software社の Orange Pi PC 2を買ってみた

 中国深圳のShenzhen Xunlong Software社の製品。
 ラズパイを意識した作りで、2匹目のドジョウを狙っているんでしょうか?
 ラズパイよりも低価格で高性能です。また、オレンジパイは非常に多くの種類を出しています。

 Orange Pi PC 2はその内の一つとなります。

What’s Orange Pi PC 2?

 Allwinner H5 Cortex-A53(4core)を搭載
 ギガビットLAN

 AliExpressの公式ストア(購入はここからできます)
AliExpress - Store: Shenzhen Xunlong Software CO.,Limited

 今回は、カメラモジュール付きを 25.30ドルで購入しました。
Orange Pi PC2 set 9 :Pi PC2 and Camera with wide-angle lens not for raspberry pi 2
 Price: US $25.30
 Shipping: US $3.31 to Japan via China Post Registered Air Mail
      Estimated Delivery Time:13-21days
 ※ 「カメラセット」の「カメラ」を使う方法がまだ分かりません。
 ※ Orange Pi PC2は電源の相性が有るので「専用電源セット」を購入するのがオススメです。
 "Orange Pi PC2 set 4 : Orange Pi PC2 + Power Supply Run Android 4.4, Ubuntu, Debian Image"

 専用の携帯アプリでも買い物ができます。



● Orange Pi PC2 Armbianの CPU温度の取得、CPUの動作周波数の変更方法など

● Orange Pi PC2 Armbianの CPU温度の取得
user@orangepipc2:~$ sensors
The program 'sensors' is currently not installed. You can install it by typing:
sudo apt install lm-sensors

user@orangepipc2:~$ sudo apt install lm-sensors
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  fancontrol sensord read-edid i2c-tools
The following NEW packages will be installed:
  lm-sensors
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 76.4 kB of archives.
After this operation, 352 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com xenial/universe arm64 lm-sensors arm64 1:3.4.0-2 [76.4 kB]
Fetched 76.4 kB in 1s (58.3 kB/s)
Selecting previously unselected package lm-sensors.
(Reading database ... 34013 files and directories currently installed.)
Preparing to unpack .../lm-sensors_1%3a3.4.0-2_arm64.deb ...
Unpacking lm-sensors (1:3.4.0-2) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up lm-sensors (1:3.4.0-2) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...

user@orangepipc2:~$ sensors
iio_hwmon-isa-0000
Adapter: ISA adapter
temp1:        +22.6°C

● Orange Pi PC2 Armbianの CPUの動作周波数の変更方法 CPUFreq Governors
 いわゆる CPUガバナー設定、CPUガバナーとは CPUの動作クロックを調節する設定の項目名称。
user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
ondemand

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
408000
408000
408000
408000

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
480000
480000
480000
480000

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
1152000
1152000
1152000
1152000

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

conservative userspace powersave ondemand performance schedutil

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
408000 648000 816000 912000 960000 1008000 1056000 1104000 1152000

user@orangepipc2:~$ sudo sh -c "echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"

user@orangepipc2:~$ sudo sh -c "echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"

user@orangepipc2:~$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
userspace
userspace
userspace
userspace

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
480000
480000
480000
480000

user@orangepipc2:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
960000
960000
960000
960000

# CPU Freq Governorsに Conservativeを設定で電源に対する負荷変動をマイルドになるようにする。
user@orangepipc2:~$sudo sh -c 'echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'

 cpufreq-infoで CPUの設定状態を確認
user@orangepipc2:~$ cpufreq-info -o
          minimum CPU frequency  -  maximum CPU frequency  -  governor
CPU  0       480000 kHz ( 41 %)  -    1152000 kHz (100 %)  -  conservative
CPU  1       480000 kHz ( 41 %)  -    1152000 kHz (100 %)  -  conservative
CPU  2       480000 kHz ( 41 %)  -    1152000 kHz (100 %)  -  conservative
CPU  3       480000 kHz ( 41 %)  -    1152000 kHz (100 %)  -  conservative
user@orangepipc2:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 1.74 ms.
  hardware limits: 408 MHz - 1.15 GHz
  available frequency steps: 408 MHz, 648 MHz, 816 MHz, 912 MHz, 960 MHz, 1.01 GHz, 1.06 GHz, 1.10 GHz, 1.15 GHz
  available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
  current policy: frequency should be within 480 MHz and 1.15 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 648 MHz.
  cpufreq stats: 408 MHz:37.79%, 648 MHz:43.41%, 816 MHz:1.48%, 912 MHz:0.64%, 960 MHz:0.42%, 1.01 GHz:0.48%, 1.06 GHz:0.21%, 1.10 GHz:0.43%, 1.15 GHz:15.14%  (71)
analyzing CPU 1:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 1.74 ms.
  hardware limits: 408 MHz - 1.15 GHz
  available frequency steps: 408 MHz, 648 MHz, 816 MHz, 912 MHz, 960 MHz, 1.01 GHz, 1.06 GHz, 1.10 GHz, 1.15 GHz
  available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
  current policy: frequency should be within 480 MHz and 1.15 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 648 MHz.
  cpufreq stats: 408 MHz:37.79%, 648 MHz:43.41%, 816 MHz:1.48%, 912 MHz:0.64%, 960 MHz:0.42%, 1.01 GHz:0.48%, 1.06 GHz:0.21%, 1.10 GHz:0.43%, 1.15 GHz:15.14%  (71)
analyzing CPU 2:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 1.74 ms.
  hardware limits: 408 MHz - 1.15 GHz
  available frequency steps: 408 MHz, 648 MHz, 816 MHz, 912 MHz, 960 MHz, 1.01 GHz, 1.06 GHz, 1.10 GHz, 1.15 GHz
  available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
  current policy: frequency should be within 480 MHz and 1.15 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 648 MHz.
  cpufreq stats: 408 MHz:37.79%, 648 MHz:43.41%, 816 MHz:1.48%, 912 MHz:0.64%, 960 MHz:0.42%, 1.01 GHz:0.48%, 1.06 GHz:0.21%, 1.10 GHz:0.43%, 1.15 GHz:15.14%  (71)
analyzing CPU 3:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 1.74 ms.
  hardware limits: 408 MHz - 1.15 GHz
  available frequency steps: 408 MHz, 648 MHz, 816 MHz, 912 MHz, 960 MHz, 1.01 GHz, 1.06 GHz, 1.10 GHz, 1.15 GHz
  available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
  current policy: frequency should be within 480 MHz and 1.15 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency is 648 MHz.
  cpufreq stats: 408 MHz:37.79%, 648 MHz:43.41%, 816 MHz:1.48%, 912 MHz:0.64%, 960 MHz:0.42%, 1.01 GHz:0.48%, 1.06 GHz:0.21%, 1.10 GHz:0.43%, 1.15 GHz:15.14%  (71)

 cpupower frequency-infoは動かない??
cpupower frequency-info
sudo apt install linux-tools-common

user@orangepipc2:~$ cpupower frequency-info
The program 'cpupower' is currently not installed. You can install it by typing:
sudo apt install linux-tools-common

user@orangepipc2:~$ sudo apt install linux-tools-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  linux-tools-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 117 kB of archives.
After this operation, 437 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com xenial-security/main arm64 linux-tools-common all 4.4.0-98.121 [117 kB]
Fetched 117 kB in 1s (76.5 kB/s)
Selecting previously unselected package linux-tools-common.
(Reading database ... 34044 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_4.4.0-98.121_all.deb ...
Unpacking linux-tools-common (4.4.0-98.121) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up linux-tools-common (4.4.0-98.121) ...

user@orangepipc2:~$ cpupower frequency-info
WARNING: cpupower not found for kernel 4.13.12

  You may need to install the following packages for this specific kernel:
    linux-tools-4.13.12-sunxi64
    linux-cloud-tools-4.13.12-sunxi64

  You may also want to install one of the following packages to keep up to date:
    linux-tools-sunxi64
    linux-cloud-tools-sunxi64


● Orange Pi PC2の基板に実装してある緑 LEDと 赤LEDを制御する

 下記がそれぞれに対応します。
ls -l /sys/class/leds/orangepi\:red\:status/
ls -l /sys/class/leds/orangepi\:green\:pwr/

# 起動毎に毎回設定する必要が有る
# ハートビート
echo heartbeat > /sys/class/leds/orangepi\:red\:status/trigger

# 無指定
echo none > /sys/class/leds/orangepi\:red\:status/trigger
# 消灯状態
echo 0 > /sys/class/leds/orangepi\:red\:status/brightness
# 点灯状態(あらかじめ triggerを無指定にする必要がある)
echo 1 > /sys/class/leds/orangepi\:red\:status/brightness

echo none > /sys/class/leds/orangepi\:green\:pwr/trigger
echo 1 > /sys/class/leds/orangepi\:green\:pwr/brightness

 triggerに設定できる設定値の一覧
# cat /sys/class/leds/orangepi\:green\:pwr/trigger
none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock usbport usb-gadget usb-host mmc0 heartbeat cpu0 cpu1 cpu2 cpu3 1c30000.ethernet-0:00:1Gbps 1c30000.ethernet-0:00:100Mbps 1c30000.ethernet-0:00:10Mbps rfkill-any bluetooth-power

 一般ユーザーの場合(sudoを使う場合は sudo sh -cとする)
# 赤 LEDをハートビートに設定
sudo sh -c "echo heartbeat > /sys/class/leds/orangepi\:red\:status/trigger"

# 緑 LEDを SDカードのアクセスランプに設定
sudo sh -c "echo mmc0 > /sys/class/leds/orangepi\:green\:pwr/trigger"



OrangePiLibra/OrangePiH5_external - OrangePiH5_external/sys_config/OrangePiH5_PC2_sys_config.fex

;----------------------------------------------------------------------------------
;   used: 模块使能端     1:开启模块   0:关闭模块
;   mode: 模式选择       1:一键进入OTA升级     2:一键恢复(通过sysrecovery分区来恢复)  其他值:无效
;   recovery_key : 按键配置  (例如:recovery_key= port:PH16<0><default>)
;----------------------------------------------------------------------------------
[recovery_para]
used =  1
mode =  1
recovery_key = port:PL04<0><default><default><default>

[boot_init_gpio]
boot_init_gpio_used   = 1
gpio0 =  port:PL10<1><default><default><1>
gpio1 =  port:PA20<1><default><default><1>

;----------------------------------------------------------------------------------
;i2c configuration
;----------------------------------------------------------------------------------
[twi0]
twi0_used        = 1
twi0_scl         = port:PA11<2><default><default><default>
twi0_sda         = port:PA12<2><default><default><default>

[twi0_suspend]
twi0_scl         = port:PA11<7><default><default><default>
twi0_sda         = port:PA12<7><default><default><default>

[twi1]
twi1_used        = 1
twi1_scl         = port:PA18<3><default><default><default>
twi1_sda         = port:PA19<3><default><default><default>

[twi1_suspend]
twi1_scl         = port:PA18<7><default><default><default>
twi1_sda         = port:PA19<7><default><default><default>

[twi2]
twi2_used        = 0
twi2_scl         = port:PE12<3><default><default><default>
twi2_sda         = port:PE13<3><default><default><default>

[twi2_suspend]
twi2_scl         = port:PE12<7><default><default><default>
twi2_sda         = port:PE13<7><default><default><default>

;----------------------------------------------------------------------------------
;uart configuration
;uart_port ---  x (/dev/ttySx, x=0,1,2,...)
;uart_type ---  2 (2 wire), 4 (4 wire), 8 (8 wire, full function)
;----------------------------------------------------------------------------------
[uart0]
uart0_used       = 1
uart0_port       = 0
uart0_type       = 2
uart0_tx         = port:PA4<2><1><default><default>
uart0_rx         = port:PA5<2><1><default><default>

[uart0_suspend]
uart0_tx         = port:PA4<7><1><default><default>
uart0_rx         = port:PA5<7><1><default><default>

[uart1]
uart1_used       = 1
uart1_port       = 1
uart1_type       = 4
uart1_tx         = port:PG6<2><1><default><default>
uart1_rx         = port:PG7<2><1><default><default>
uart1_rts        = port:PG8<2><1><default><default>
uart1_cts        = port:PG9<2><1><default><default>

[uart1_suspend]
uart1_tx         = port:PG6<7><1><default><default>
uart1_rx         = port:PG7<7><1><default><default>
uart1_rts        = port:PG8<7><1><default><default>
uart1_cts        = port:PG9<7><1><default><default>

[uart2]
uart2_used       = 1
uart2_port       = 2
uart2_type       = 4
uart2_tx         = port:PA0<2><1><default><default>
uart2_rx         = port:PA1<2><1><default><default>
uart2_rts        = port:PA2<2><1><default><default>
uart2_cts        = port:PA3<2><1><default><default>

[uart2_suspend]
uart2_tx         = port:PA0<7><1><default><default>
uart2_rx         = port:PA1<7><1><default><default>
uart2_rts        = port:PA2<7><1><default><default>
uart2_cts        = port:PA3<7><1><default><default>

[uart3]
uart3_used       = 0
uart3_port       = 3
uart3_type       = 4
uart3_tx         = port:PA13<2><1><default><default>
uart3_rx         = port:PA14<2><1><default><default>
uart3_rts        = port:PA15<2><1><default><default>
uart3_cts        = port:PA16<2><1><default><default>

[uart3_suspend]
uart3_tx         = port:PA13<7><1><default><default>
uart3_rx         = port:PA14<7><1><default><default>
uart3_rts        = port:PA15<7><1><default><default>
uart3_cts        = port:PA16<7><1><default><default>

;----------------------------------------------------------------------------------
;SPI controller configuration
;----------------------------------------------------------------------------------
[spi0]
spi0_used       = 1
spi0_cs_number  = 1
spi0_cs_bitmap  = 1
spi0_cs0        = port:PC3<3><1><default><default>
spi0_sclk       = port:PC2<3><default><default><default>
spi0_mosi       = port:PC0<3><default><default><default>
spi0_miso       = port:PC1<4><default><default><default>

[spi0_suspend]
spi0_cs0        = port:PC3<7><1><default><default>
spi0_sclk       = port:PC2<7><default><default><default>
spi0_mosi       = port:PC0<7><default><default><default>
spi0_miso       = port:PC1<7><default><default><default>

[spi1]
spi1_used       = 1
spi1_cs_number  = 1
spi1_cs_bitmap  = 1
spi1_cs0        = port:PA13<2><1><default><default>
spi1_sclk       = port:PA14<2><default><default><default>
spi1_mosi       = port:PA15<2><default><default><default>
spi1_miso       = port:PA16<2><default><default><default>

[spi1_suspend]
spi1_cs0        = port:PA13<7><1><default><default>
spi1_sclk       = port:PA14<7><default><default><default>
spi1_mosi       = port:PA15<7><default><default><default>
spi1_miso       = port:PA16<7><default><default><default>

;----------------------------------------------------------------------------------
;pwm config
;----------------------------------------------------------------------------------
[pwm0]
pwm_used            = 0
pwm_positive        = port:PD22<2><0><default><default>

[pwm0_suspend]
pwm_positive        = port:PD22<7><0><default><default>

[pwm16]
s_pwm0_used         = 0
pwm_positive        = port:PL10<2><0><default><default>

[pwm16_suspend]
pwm_positive        = port:PL10<7><0><default><default>

mikutter



Tags: [Raspberry Pi], [Orange Pi], [電子工作], [海外通販], [通信販売]

●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)

ラズパイを意識した別物製品 Orange Pi Zeroを買ってみた、Allwinner H2+ Cortex-A7 4core
ラズパイを意識した別物製品 Orange Pi Zeroを買ってみた、Allwinner H2+ Cortex-A7 4core

  オレンジパイはラズパイよりもコスパは良いが情報が無いので利用者側に一定のスキルが必要

Orange Pi PC 2を買ってみた、Allwinner H5 Cortex-A53 4core ARM64
Orange Pi PC 2を買ってみた、Allwinner H5 Cortex-A53 4core ARM64

  ラズパイを意識した別物製品、オレンジパイはラズパイよりもコスパが良い、でも情報が無い

Raspberry Pi Zero Wを海外通販の Pimoroni等での購入方法、購入できる通販ショップ一覧まとめ
Raspberry Pi Zero Wを海外通販の Pimoroni等での購入方法、購入できる通販ショップ一覧まとめ

  ラズパイゼロW ワイヤレスモデルを海外通販でサクッと簡単に個人輸入で入手。技適通過でも国内販売は常に品切れ

Raspberry Pi 3で安定して使える相性の無い最適な microSDカードの種類のまとめ
Raspberry Pi 3で安定して使える相性の無い最適な microSDカードの種類のまとめ

  ラズパイ3で安定して使える microSDカードを購入する Teamと SanDiskは絶対に買わない

Raspberry Pi 3の Linuxコンソール上で使用する各種コマンドまとめ
Raspberry Pi 3の Linuxコンソール上で使用する各種コマンドまとめ

  ラズパイの Raspbian OSのコマンドラインで使用する便利コマンド、負荷試験や CPUシリアル番号の確認方法等も

大人気の CPUボード、Raspberry Pi 3 Model Bで作ってみよう
大人気の CPUボード、Raspberry Pi 3 Model Bで作ってみよう

  Raspberry Piの開発環境の構築やタッチパネル付き液晶ディスプレイや各種センサーの使い方まとめ

Espressif ESP8266 Arduino互換でスケッチが使える ESP-12Eモジュール基板
Espressif ESP8266 Arduino互換でスケッチが使える ESP-12Eモジュール基板

  Espressif ESP8266 ESP-12-E NodeMCU V1 ESP12 CP2102

BangGood通販はドローン以外にも面白い商品がまだまだ有った(電子工作編)
BangGood通販はドローン以外にも面白い商品がまだまだ有った(電子工作編)

  レーザー彫刻機、カラー液晶の DIYオシロ、Arduinoや Raspberry Pi用の小型カラー液晶



[HOME] | [BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c) 2017 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator

http://www.neko.ne.jp/~freewing/raspberry_pi/orange_pi_pc2_cpu_temperature_governor/