Screen Shot 2014-10-05 at 5.27.25 AM

WebIOPiをインストールする – Raspberry Piでリープモーション 4

WebIOPiをインストールする – Raspberry Piでリープモーション 4ラズベリーパイのGPIOを操作するのにいろいろ方法があるみたいだけど、WebSocketを利用したリープモーションとの連携を考えて、Ptyhonベースで使いやすそうなWebIOPiをセットアップしてみた。

cd /usr/src
sudo wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.0.tar.gz
sudo tar xvzf WebIOPi-*
cd WebIOPi-*
sudo ./setup.sh

Installing WebIOPi...

Updating apt package list...
./setup.sh: line 20: apt-get: command not found

Found Python 2.7.5...
Trying to install python-dev using apt-get
./setup.sh: line 39: apt-get: command not found
Cannot install for Python 2.7.5 : missing development headers\n
ERROR: WebIOPi cannot be installed - please check errors above

// python development headersが見当たらなかったのでPython-develをインストール

sudo yum install -y python-devel python-setuptools
sudo ./setup.sh
sudo webiopi -d -c /etc/webiopi/config
2014-09-27 07:34:06 - WebIOPi - INFO - Starting WebIOPi/0.7.0/Python2.7
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.digitalCount to REST GET /GPIO/count
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.digitalRead to REST GET /GPIO/%(channel)d/value
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.digitalWrite to REST POST /GPIO/%(channel)d/value/%(value)d
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.getFunctionString to REST GET /GPIO/%(channel)d/function
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.getPulse to REST GET /GPIO/%(channel)d/pulse
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.outputSequence to REST POST /GPIO/%(channel)d/sequence/%(args)s
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.portRead to REST GET /GPIO/*/integer
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.portWrite to REST POST /GPIO/*/integer/%(value)d
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.pulse to REST POST /GPIO/%(channel)d/pulse/
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.pulseAngle to REST POST /GPIO/%(channel)d/pulseAngle/%(value)f
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.pulseRatio to REST POST /GPIO/%(channel)d/pulseRatio/%(value)f
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.setFunctionString to REST POST /GPIO/%(channel)d/function/%(value)s
2014-09-27 07:34:06 - WebIOPi - DEBUG - Mapping GPIO.wildcard to REST GET /GPIO/*
2014-09-27 07:34:06 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2014-09-27 07:34:06 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2014-09-27 07:34:06 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2014-09-27 07:34:06 - WebIOPi - INFO - HTTP Server binded on http://192.168.0.19:8000/
2014-09-27 07:34:06 - WebIOPi - INFO - CoAP Server binded on coap://192.168.0.19:5683/
2014-09-27 07:34:06 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)

ブラウザでアクセス

http://localhost:8000/

  • id webiopi
  • pass raspberry

参考サイトさま

About the author
  • コメントを残す