27. 27
xx
温度センサーの結果をmuninで表示
#!/bin/sh
#%# family=auto
#%# capabilities=autoconf
GETNUM=`ruby /home/pi/tmp.rb`
if [ "$1" = "autoconf" ]; then
if [ -n ${GETNUM} ] ; then
echo yes
exit 0
else
echo no
exit 0
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Temperature'
echo 'graph_args --base 1000 -l 0 -u 50'
echo 'graph_vlabel Temp(C)'
echo 'graph_category Room'
echo 'total.label temperature'
echo 'total.type GAUGE'
exit 0
fi
echo "total.value $GETNUM";
● プラグインの作成
cd /usr/share/munin/plugins/
sudo vi FetchTemperature
●
ライブラリーのインストール
sudo gem install munin-ruby
● 設定
sudo chmod +x FetchTemperature
sudo ln -s FetchTemperature /usr/share/munin/plugins/FetchTemperature
sudo vi /etc/munin/plugin-conf.d/munin-node
sudo munin-node restart
● 実行確認
sudo munin-run FetchTemperature
[FetchTemperature]
user root
FetchTemperature
28. 28
xx
Raspberry Pi 電子工作
電子回路設計ツール
Fritzing はWindows/Mac/Linux で動作し、回路図の設計、シミュレーション等ができる。
【ダウンロードURL】
http://fritzing.org/download/
【使い方】
配置したいパーツを右上のパーツから選択してブレッドボードのウィンドウにドラッグ&ドロッ
プするだけで配線できる。作成した回路図は各種ファイルに書き出すことも可能。
【Raspberry Pi パーツ】
Adafruit の Fritzing Library を使うことで Raspberry Pi のパーツを利用することができる。
以下の URL からファイルをダウンロードして Fritzing の [ファイル] -> [開く] から必要な
.fzpz ファイルを開けばパーツウィンドウにパーツが追加される。
https://github.com/adafruit/Fritzing-Library
29. 29
xx
紹介
ぼちぼちぼっち開発 with Raspberry Pi in 大阪
場所:Namba CoWorking
http://namba.cc/price
費用:1000円(場所代)
必要な物:raspberry pi、PC
日時:Doorkeerperで通知予定