[[PageOutline]] [[TitleIndex(TipAndDoc/monitor,format=group)]] = lm-sensors = * [https://bugs.launchpad.net/ubuntu/+source/linux/+bug/418246 Bug #418246 “it87 (sensors) module broken, needs automatic addin...” : Bugs : “linux” package : Ubuntu] * $ sudo modprobe -v it87 {{{ insmod /lib/modules/2.6.32-42-generic/kernel/drivers/hwmon/it87.ko FATAL: Error inserting it87 (/lib/modules/2.6.32-42-generic/kernel/drivers/hwmon/it87.ko): Device or resource busy }}} = SystemTap = * [http://www.atmarkit.co.jp/flinux/rensai/tantei03/bangai03a.html SystemTapで真犯人を捕まえろ!(1/4) - @IT] * [http://d.hatena.ne.jp/mhiramat/20081006/1223259316 最新のSystemtapのインストール方法 - mhiramatの日記] = Zabbix = * [http://www.kunitake.org/chalow/2013-03-25-1.html Zabbixトラッパー(zabbix-sender) で、munin-node plugin のデータを取り込む] = Watt Checker = * [http://little-beans.net/gadget/watt-checker/ ログ記録型ワットチェッカーを比較!TAP-TST10とF-PLUG、REX-BTWATTCH1のどれを選ぶ!?] * 仕様が公開されている F-PLUG115 BSCESFP0103 が良さそうだが、販売終了とのこと ([http://www.fujitsu.com/jp/group/bsc/document/services/f-plug/f-plug-20150702.pdf F-PLUG 販売終了に関するご案内(PDF)] * 現在所持しているもの * TAP-TST5 * TAP-TST10 == TAP-TST10 == * github:nonakap/taptst10ctl * [http://blog.osakana.net/archives/4436 USB電力計 サンワサプライ TAP-TST10をLinuxで使ってみた | OSAKANA TAROのメモ帳] * Arch Linux 4.1.6-1-ARCH 1. $ pacaur -S python2-pyusb-git * aur:python2-pyusb-git (python2-pyusbは0.4.3-7とバージョンが古い) 1. $ sudo sh -c 'echo -n "0003:040B:2201.0004" > /sys/bus/hid/drivers/hid-generic/unbind ' 1. $ sudo sh -c 'echo -n "3-1:1.0" >/sys/bus/usb/drivers/usbhid/unbind' * {{{echo > unbind}}} はこちらだけで良いかも。 1. $ vim taptst10ctl.py {{{#!diff diff --git a/taptst10ctl.py b/taptst10ctl.py index 1207fef..f5e8724 100644 --- a/taptst10ctl.py +++ b/taptst10ctl.py @@ -83,7 +83,7 @@ watts = [] kWhs = [] outep.write('\x02\x18\x0a') while True: - data = dev.read(ENDPOINT, 17, intf, 1000) + data = dev.read(ENDPOINT, 17, 1000) # dump raw data #print(" ".join("{:02x}".format(x) for x in data)) }}} * [https://bitbucket.org/benallard/galileo/issues/41/errors-in-kubuntu benallard / galileo / 課題 / #41 - TypeError: write() takes at most 4 arguments (5 given) — Bitbucket] 1. $ sudo python2 taptst10ctl.py {{{ No.,DateTime,Watt,kWh 1,2015/09/23 10:30,4.5,0.00 2,2015/09/23 10:40,41.5,0.00 3,2015/09/23 10:50,41.3,0.01 4,2015/09/23 11:00,40.3,0.02 }}} === bug? === * github:nonakap/taptst10ctl は消費電力が増えるとオーバーフローするのか値がおかしくなる模様 * 100W~ 程度の負荷下 * $ sudo python2 taptst10ctl.py {{{ No.,DateTime,Watt,kWh 1,2015/09/23 11:00,40.0,0.01 2,2015/09/23 11:10,106.0,0.02 3,2015/09/23 11:20,3251.0,2.56 4,2015/09/23 11:30,3251.0,5.10 5,2015/09/23 11:40,3251.0,7.64 }}} * 3251Wになってしまう * TAP-TST10 Watt Monitor USB Program (公式アプリ) * [[Image(TAP-TST10.png,33%)]] == F-PLUG115 == * [http://www.fujitsu.com/jp/group/bsc/services/f-plug/ F-PLUG(エフプラグ) - 電力、温度、湿度、照度を同時に測定して見える化する電力測定機器 : 富士通ビー・エス・シー] * [http://www.fujitsu.com/jp/group/bsc/services/f-plug/downloads/message.html F-PLUG メッセージ一覧 : 富士通ビー・エス・シー] 本サイトではF-PLUG制御用メッセージに関する情報を提供いたします。 * Windows 10からユーティリティを用いて接続する場合、事前にファームウェアバージョン 1300 にアップデートが必要 http://www.fujitsu.com/jp/group/bsc/services/f-plug/downloads/ * [[Image(F-PLUG115-update.png,33%)]] === Linux === * github:goto2048/fplug_for_linux * [http://obdnmagazine.blogspot.jp/2013/03/tested-f-plug-ax3a6.html OBDNマガジン: (.tested) 富士通ビー・エス・シー F-PLUG (AX3)(A6)] * [http://www.bravotouring.com/~yano/diary/it/20140616fplug4linux.htm YANO's digital garage - fplug_for_linux] * $ sudo ./fpstatus -with /dev/rfcomm0 {{{ FP_WATT=21.4;FP_ILLUM=83;FP_TEMP=25.0;FP_HUMID=33; }}} * github:hasegaw/pyfplug * pyfplug2.py {{{#!diff --- pyfplug.py 2015-10-25 17:45:30.577000467 +0900 +++ pyfplug2.py 2015-10-25 18:05:20.859804410 +0900 @@ -355,7 +355,7 @@ self.sfile.flush() def test_fplug_dev(): - dev = FPlugDevice('/dev/rfcomm0', debug = True) + dev = FPlugDevice('/dev/rfcomm0', debug = False) # print "init:", dev.plug_init() }}} * $ sudo python2 pyfplug2.py {{{ on: 1 off: 0 set_datetime: True TMP: 25.0 degree C HUM: 33 % ILL: 84 PWR: 21.4 W ACC: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22] HIST PWR: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22] HIST MISC: [(None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (None, None, None), (26.0, 33, 83), (26.0, 33, 82)] }}} * $ sudo python2 fplugctl init * 履歴を初期化(ACC, HIST *が0に戻る) * 機能面ではpyfplug、応答性ではfplug_for_linuxがよさそう(Cで書かれているので予想通りではあるが…) * $ {{{time for i in `seq 1 100`; do for opt in w i t h ; do sudo ./fpstatus -$opt /dev/rfcomm0 ; done; done}}} {{{ real 2m43.929s user 0m0.407s sys 0m0.187s }}} * $ {{{time for i in `seq 1 100`; do for opt in t h i p ; do sudo python2 fplugctl get $opt ; done ; done}}} {{{ real 4m57.676s user 0m3.840s sys 0m0.817s }}} * [http://blogs.yahoo.co.jp/beachinside/11942257.html Raspberry PiにF-PLUGを2個繋いでみた ( UNIX ) - ロードバイクときどきiPad/Airなblog - Yahoo!ブログ] * [http://qiita.com/jkawamoto/items/80e44f46c01783c59d20 Raspberry Pi で F-PLUG のログ収集 - Qiita]