e-tipsmemo

ごった煮

Ryzen 録画サーバー 電力測定①

e-tipsmemo.hatenablog.com
e-tipsmemo.hatenablog.com

録画サーバーをたててエンコも自動にする目論見があるが、
気になるのは消費電力。

常時起動させておくとしても電気を食いそうなので測りたい。
またエンコードもH265でやりたいと考えているが、
エンコードに時間がかかるとその際の消費電力を測っておきたい。

そこでリモートで電力が測れる手段を考えて以下のものを買った

Bluetoothスマホからログを得られるようだが、
ハナからスマホからの利用などは考えていない。

Raspiを使えばBluetoothにつなげるし、さらにWifi経由でアクセスもできる。


そのほかもろもろを購入して全体構成図は以下のようになる予定
f:id:katakanan:20181021162553p:plain

やることはここと同じ
https://iot-plus.net/make/raspi/24h-watt-monitoring-using-rex-btwattch1/

準備

RaspiのSSHを繋げる。

bluetoothをONにする

pi@raspberrypi:~ $ bluetoothctl
[NEW] Controller XX:XX:XX:XX:XX:XX raspberrypi [default]
[bluetooth]# power on
Failed to set power on: org.bluez.Error.Blocked
[bluetooth]#

なんかエラー出た。

pi@raspberrypi:~ $ sudo rfkill unblock bluetooth

を行ったらうまくいった。
How do I solve Failed to pair: org.bluez.Error.... |Intel Communities

pi@raspberrypi:~ $ bluetoothctl
[NEW] Controller XX:XX:XX:XX:XX:XX raspberrypi [default]
[bluetooth]# power on
Changing power on succeeded
[bluetooth]#

[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes
[NEW] Device YY:YY:YY:YY:YY:YY WATT CHECKER
・・・・
その他のデバイス
・・・・
[bluetooth]#

ペアリングする

MACアドレスを入れる

[bluetooth]# pair YY:YY:YY:YY:YY:YY
Attempting to pair with YY:YY:YY:YY:YY:YY
[CHG] Device YY:YY:YY:YY:YY:YY Connected: yes
[CHG] Device YY:YY:YY:YY:YY:YY UUIDs:
・・・・・・・UUIDが表示される・・・・・・
[CHG] Device YY:YY:YY:YY:YY:YY Paired: yes
Pairing successful
[bluetooth]#

なんかPINコードの入力を求められなかった。

[bluetooth]# trust YY:YY:YY:YY:YY:YY
[CHG] Device YY:YY:YY:YY:YY:YY Trusted: yes
Changing YY:YY:YY:YY:YY:YY trust succeeded

[bluetooth]# info 00:0C:BF:29:7C:B0

で情報が取得できていたらOK

exit

で終了。

ワットチェッカーがでかいので壁コンセントがふさがらないように
以下のようなものをつなげて壁から離している。