SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Raspberry Pi と WebIOPi を使ってみよう 
ガリレオ 小山博史
小山博史 
Twitter: @hiro345 日経LinuxでRaspberry Pi記事連載中
宣伝 
 日経Linux 2014年8月号 
! 
IoTフレームワークのWebIOPiを取 
り上げています。これを使うと 
Raspberry Pi で簡単に Internet of 
Things のプロトタイプが作れるよ 
うになります。
Raspberry Pi とは 
• 教育用に開発されたボードPC 
• デスクトップPCとして使える 
• DebianベースのRaspbian OSがよく 
使われている 
• 電子部品やセンサーが簡単に接続可能 
• model B、B+ はLANコネクタ装備で 
ネットワークが利用可能 
• 豊富なUSB機器が利用可能
注目されている IoT 
• Internet of Things(モノのインターネット) 
• 色々なモノがインターネット接続できるようになって 
きたことが注目されている。 
• 個人的には、リアルワールドのモノがインターネット 
に接続してデータ化されると、バーチャルワールドと 
リアルワールドの境界がより近くなることだと認識し 
ています。
Raspberry Pi と IoT 
• 従来のパソコンと比較して小型 
• ネットワーク接続が簡単 
• Linuxが使えるので豊富なライブラリ、プログラミング 
言語を利用可能となり、開発が簡単 
• プロトタイピングに適している 
• ネットワーク機能を持たないデバイスのハブになる
WebIOPi 
• webiopi - Internet of Things framework - Google Project Hosting 
https://code.google.com/p/webiopi/ 
• Pythonベースなので、サーバサイドでカスタマイズしたり機能拡 
張をするにはPythonを使うのが基本 
• クライアントサイドプログラミング用にREST APIあり 
• bash、JavaScript、Ruby、Java、Pythonなど大抵のプログラミン 
グ言語から利用可能 
• JavaとPythonはクライアント用ライブラリあり
HTTPでそのまま利用
JavaScriptからの利用
外部サービスのAPI利用
WebIOPiのヘッダー画面GPIOの状態表示と制御が可能
ボタンのカスタマイズ簡単にできる
WebIOPiの 
ディレクトリ構成 
・htdocs/配下にJavaScriptなどがあることがわかる 
・サーバプログラムはpython/配下 
・examples、tutorialsを確認すると作り方がわかる 
・ドキュメントルートはカスタマイズ指定が可能 
WebIOPi-0.7.0/ 
├── doc/ 
│ ├── CHANGELOG 
│ ├── INSTALL 
│ ├── LICENSE 
│ ├── README 
│ └── updatedoc* 
├── examples/ 
│ ├── clients/ 
│ ├── magpi-cambot/ 
│ └── scripts/ 
├── htdocs/ 
│ ├── app/ 
│ ├── index.html 
│ ├── jquery.js 
│ ├── webiopi.css 
│ └── webiopi.js 
├── java/ 
│ └── client/ 
├── midori/ 
│ └── config 
├── play.sh* 
├── python/ 
│ ├── config 
│ ├── native/ 
│ ├── passwd 
│ ├── setup.py 
│ ├── webiopi/ 
│ ├── webiopi-passwd.py* 
│ ├── webiopi.init.sh* 
│ └── webiopi.sh* 
├── setup.sh* 
└── tutorials/ 
├── 1.basis/ 
├── 2.macros/ 
├── 3.devices/ 
├── 4.serial-streaming/ 
└── 5.serial-command/
Raspberry Pi のネットワーク設定 
• 開発中はインターネット接続 
• モバイルをしている最中は単体で稼働 
• PCやスマフォから接続させたい時がある 
• PCやスマフォからの接続は制限したい時がある 
• 用途に応じてネットワーク設定は調整が必要
USBシリアル変換ケーブル 
• USBシリアル通信でつなぐ 
• UARTピンのTX、RX、GNDと、USBシリアル変換コネクタを接続 
• 3.3V用のコネクタを利用する事 
• いろいろなUSBシリアル変換器 | hiro345 
http://www.sssg.org/blogs/hiro345/archives/16623.html 
• FTDI USBシリアル変換アダプター(5V/3.3V切り替え機能付き) – スイッチサイエンス 
• FTDI USB・シリアル変換ケーブル(3.3V)(秋月電子通商) 
• CH340 USBシリアルモジュール « ちっちゃいものくらぶ 
• USB-TTL変換 – aitendo@shopping 
• FT231X USBシリアル変換モジュール(秋月電子通商)
リンクローカルネットワークの設定 
・/etc/network/interfaces に記述! 
・169.254.12.24 の固定IPアドレス指定! 
・WindowsやOS Xでは、IPが取得できな! 
 いときに169.254.0.0のIPが自動設定! 
 されるので、これで直接通信可能! 
・クロスケーブルかHUB経由で接続が必要! 
auto lo! 
! 
iface lo inet loopback! 
iface eth0 inet dhcp! 
! 
auto eth0:1! 
iface eth0:1 inet static! 
address 169.254.12.24! 
netmask 255.255.0.0!
x11vnc 
リモートデスクトップ 
・リモートからGUIで操作したいときに利用! 
・VNCサーバの一種。他にはTightVNCなどもある! 
・接続先は、vnc://169.254.12.24:5900! 
・クライアントアプリ! 
 ・RealVNC:Linux、OS X、Windows! 
 ・TightVNC:Windows、Java! 
 ・OS 標準! 
  ・OS X:ファインダーのサーバへ接続! 
  ・Ubuntu:Remmina 
インストールは下記。起動時にパスワード設定あり! 
$ sudo apt-get install x11vnc! 
!! 
設定は $HOME/.config/autostart/x11vnc.desktop! 
----! 
[Desktop Entry]! 
Encoding=UTF-8! 
Type=Application! 
Name=X11VNC! 
Exec=/usr/bin/x11vnc -forever -usepw -display :0! 
StartupNotify=false! 
Terminal=false! 
Hidden=false! 
----
無線LAN 
アクセスポイント化 
・hostapdで無線LAN接続提供 
・isc-dhcp-server でIPアドレス付与 
・本体は/etc/network/interfacesで 
 固定値を設定 
・起動時にwlan0が認識されない 
 ことがあるので、スクリプトで 
 調整 
インストール! 
$ sudo apt-get install hostapd! 
$ sudo apt-get install isc-dhcp-server! 
! 
ネットワーク設定変更! 
allow-hotplug wlan0! 
iface wlan0 inet static! 
address 192.168.20.1! 
netmask 255.255.255.0! 
$ cat wlan0_check.sh ! 
#!/bin/sh! 
LANG=C ifconfig wlan0|grep inet! 
if [ $? -eq 1 ]; then! 
sudo /sbin/ifconfig wlan0 192.168.20.1! 
sudo /usr/sbin/service isc-dhcp-server restart! 
fi! 
!! 
$ crontab -l! 
*/2 * * * * sh /home/pi/wlan0_check.sh > /dev/null!
インストールしておくと便利なもの 
• WiringPi 
• RPi-Cam Web Interface
WiringPi 
• Raspberry Pi specific functions 
• Timing functions 
• Program priority, timing and threads 
• Serial library 
• SPI library 
• I2C library 
• Shift library 
• Software PWM library 
• Software tone library 
■ インストール! 
$ sudo apt-get install libi2c-dev! 
$ git clone git://git.drogon.net/wiringPi! 
$ cd wiringPi/! 
$ sudo ./build
RPi-Cam-Web-Interface 
• Raspberry Pi カメラをWebインタフェースで利用可能 
• インストールも簡単 
• 撮影した動画はH.264、自動でmp4へ変換(処理が重い) 
• 手動で変換するにはMP4Boxコマンド 
• Webブラウザで撮影した動画、静止画をダウンロード可能 
■ インストール! 
$ cd /home/pi/RPi_Cam_Web_Interface! 
$ git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git! 
$ git pull origin master! 
$ ./RPi_Cam_Web_Interface_Installer.sh install! 
$ ./RPi_Cam_Web_Interface_Installer.sh start
参考:USBカメラ 
• USBカメラは値段が安い 
• 使用するアプリのインストールが少し大変 
• 監視カメラを作っている人も多い 
• ロボットへ搭載して利用している人も多い
まとめ 
• Raspberry Pi を使うと IoT のモノを開発しやすい 
• 実際に利用しようとすると工夫が必要 
• WebIOPiを使うとREST APIの提供が簡単 
• Raspberry Pi カメラも簡単にWebブラウザから使えるよう 
になっている 
• 高速開発をしたい場合はPython。性能を上げるにはWiringPi 
が便利

Weitere ähnliche Inhalte

Andere mochten auch

Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
 

Andere mochten auch (20)

HTML5 によるロボット制御
HTML5 によるロボット制御HTML5 によるロボット制御
HTML5 によるロボット制御
 
Python, RaspberryPi, Arduinoで作る消費電力モニタリングシステム
Python, RaspberryPi, Arduinoで作る消費電力モニタリングシステムPython, RaspberryPi, Arduinoで作る消費電力モニタリングシステム
Python, RaspberryPi, Arduinoで作る消費電力モニタリングシステム
 
Educar valores a traves del futbol
Educar valores a traves del futbolEducar valores a traves del futbol
Educar valores a traves del futbol
 
Tutorial for the ReportLinker App
Tutorial for the ReportLinker AppTutorial for the ReportLinker App
Tutorial for the ReportLinker App
 
Lean Day: West recap (censored)
Lean Day: West recap (censored)Lean Day: West recap (censored)
Lean Day: West recap (censored)
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Facebook og søk for BRAK
Facebook og søk for BRAKFacebook og søk for BRAK
Facebook og søk for BRAK
 
Como realizar un plan de clases
Como realizar un plan de clasesComo realizar un plan de clases
Como realizar un plan de clases
 
I16092.00_E501-E501
I16092.00_E501-E501I16092.00_E501-E501
I16092.00_E501-E501
 
Call me VL-11 28.11.2012 Ole Kassow
Call me VL-11 28.11.2012 Ole KassowCall me VL-11 28.11.2012 Ole Kassow
Call me VL-11 28.11.2012 Ole Kassow
 
Need An Arabic Tutor
Need An Arabic TutorNeed An Arabic Tutor
Need An Arabic Tutor
 
Casa Duplex
Casa DuplexCasa Duplex
Casa Duplex
 
Group 2 - Pitch
Group 2 - PitchGroup 2 - Pitch
Group 2 - Pitch
 
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
だいすきStoryboard - #potatotips (iOS/Android開発Tips共有会) 第7回
 
Decalogue 1st Day
Decalogue 1st DayDecalogue 1st Day
Decalogue 1st Day
 
PHP 7 Crash Course
PHP 7 Crash CoursePHP 7 Crash Course
PHP 7 Crash Course
 
CANENERO Advertising - Gilberto Chiacchiera
CANENERO Advertising - Gilberto ChiacchieraCANENERO Advertising - Gilberto Chiacchiera
CANENERO Advertising - Gilberto Chiacchiera
 
Il Web E Le Reti Di Vendita
Il Web E Le Reti Di Vendita Il Web E Le Reti Di Vendita
Il Web E Le Reti Di Vendita
 
IT+Summer Edition - Alkossunk élményt - Kolozsi István, kolboid
IT+Summer Edition - Alkossunk élményt - Kolozsi István, kolboidIT+Summer Edition - Alkossunk élményt - Kolozsi István, kolboid
IT+Summer Edition - Alkossunk élményt - Kolozsi István, kolboid
 
Маркетинг 2015 - основни правила за малкия и среден бизнес
Маркетинг 2015 - основни правила за малкия и среден бизнесМаркетинг 2015 - основни правила за малкия и среден бизнес
Маркетинг 2015 - основни правила за малкия и среден бизнес
 

Ähnlich wie Raspberry Pi and WebIOPi

Internet Week 2018 知っておくべきIPv6とセキュリティの話
Internet Week 2018 知っておくべきIPv6とセキュリティの話Internet Week 2018 知っておくべきIPv6とセキュリティの話
Internet Week 2018 知っておくべきIPv6とセキュリティの話
Akira Nakagawa
 

Ähnlich wie Raspberry Pi and WebIOPi (20)

RaspberryPiでWebサーバーを建てよう
RaspberryPiでWebサーバーを建てようRaspberryPiでWebサーバーを建てよう
RaspberryPiでWebサーバーを建てよう
 
Raspberry Pi勉強会(前編)-京大機械研究会
Raspberry Pi勉強会(前編)-京大機械研究会Raspberry Pi勉強会(前編)-京大機械研究会
Raspberry Pi勉強会(前編)-京大機械研究会
 
WebRTC mediasoup on raspberrypi3
WebRTC mediasoup on raspberrypi3WebRTC mediasoup on raspberrypi3
WebRTC mediasoup on raspberrypi3
 
Raspberry Pi用のコンテナをクラウドでビルドする方法
Raspberry Pi用のコンテナをクラウドでビルドする方法Raspberry Pi用のコンテナをクラウドでビルドする方法
Raspberry Pi用のコンテナをクラウドでビルドする方法
 
ほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Dive
ほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Diveほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Dive
ほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Dive
 
Osc2013 tokyospring
Osc2013 tokyospringOsc2013 tokyospring
Osc2013 tokyospring
 
Raspberry piで幸せになろう
Raspberry piで幸せになろうRaspberry piで幸せになろう
Raspberry piで幸せになろう
 
近頃のDockerネットワーク
近頃のDockerネットワーク近頃のDockerネットワーク
近頃のDockerネットワーク
 
WWCT ラズパイ Bluemix 講習資料
WWCT ラズパイ Bluemix 講習資料WWCT ラズパイ Bluemix 講習資料
WWCT ラズパイ Bluemix 講習資料
 
ロボットシステム学2015年第7回
ロボットシステム学2015年第7回ロボットシステム学2015年第7回
ロボットシステム学2015年第7回
 
Rpi users201312
Rpi users201312Rpi users201312
Rpi users201312
 
130412 kayac-cinnamon
130412 kayac-cinnamon130412 kayac-cinnamon
130412 kayac-cinnamon
 
hpingで作るパケット
hpingで作るパケットhpingで作るパケット
hpingで作るパケット
 
Internet Week 2018 知っておくべきIPv6とセキュリティの話
Internet Week 2018 知っておくべきIPv6とセキュリティの話Internet Week 2018 知っておくべきIPv6とセキュリティの話
Internet Week 2018 知っておくべきIPv6とセキュリティの話
 
【アシアル塾】Linux超入門編・第二回 仮想サーバー上にLAMP環境を構築してみよう
【アシアル塾】Linux超入門編・第二回 仮想サーバー上にLAMP環境を構築してみよう【アシアル塾】Linux超入門編・第二回 仮想サーバー上にLAMP環境を構築してみよう
【アシアル塾】Linux超入門編・第二回 仮想サーバー上にLAMP環境を構築してみよう
 
Osoljp201204
Osoljp201204Osoljp201204
Osoljp201204
 
「Python言語」はじめの一歩 / First step of Python
「Python言語」はじめの一歩 / First step of Python「Python言語」はじめの一歩 / First step of Python
「Python言語」はじめの一歩 / First step of Python
 
Raspberry Piで始める自宅サーバー超入門
Raspberry Piで始める自宅サーバー超入門Raspberry Piで始める自宅サーバー超入門
Raspberry Piで始める自宅サーバー超入門
 
RasPiからSEILにL2TP/IPSec接続
RasPiからSEILにL2TP/IPSec接続RasPiからSEILにL2TP/IPSec接続
RasPiからSEILにL2TP/IPSec接続
 
Hadoop on LXC
Hadoop on LXCHadoop on LXC
Hadoop on LXC
 

Mehr von hiro345

Nseg20120929
Nseg20120929Nseg20120929
Nseg20120929
hiro345
 
Nseg20120825
Nseg20120825Nseg20120825
Nseg20120825
hiro345
 

Mehr von hiro345 (10)

手軽に使ってみようIoTデバイス
手軽に使ってみようIoTデバイス手軽に使ってみようIoTデバイス
手軽に使ってみようIoTデバイス
 
リーダブルパスワード - SQLアンチパターンより抜粋 -
リーダブルパスワード - SQLアンチパターンより抜粋 -リーダブルパスワード - SQLアンチパターンより抜粋 -
リーダブルパスワード - SQLアンチパターンより抜粋 -
 
Frontend framework and Template
Frontend framework and TemplateFrontend framework and Template
Frontend framework and Template
 
WordPress安全運用の基礎
WordPress安全運用の基礎WordPress安全運用の基礎
WordPress安全運用の基礎
 
Arduino、Raspberry Pi、PIC 入門以前(NSEG 2014-04-19)
Arduino、Raspberry Pi、PIC 入門以前(NSEG 2014-04-19)Arduino、Raspberry Pi、PIC 入門以前(NSEG 2014-04-19)
Arduino、Raspberry Pi、PIC 入門以前(NSEG 2014-04-19)
 
5分でわかる! SqljockyでDart+MySQL
5分でわかる! SqljockyでDart+MySQL5分でわかる! SqljockyでDart+MySQL
5分でわかる! SqljockyでDart+MySQL
 
15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )
 
15分で知るVagrant (NSEG 2013-08-24)
15分で知るVagrant (NSEG 2013-08-24)15分で知るVagrant (NSEG 2013-08-24)
15分で知るVagrant (NSEG 2013-08-24)
 
Nseg20120929
Nseg20120929Nseg20120929
Nseg20120929
 
Nseg20120825
Nseg20120825Nseg20120825
Nseg20120825
 

Raspberry Pi and WebIOPi

  • 1. Raspberry Pi と WebIOPi を使ってみよう ガリレオ 小山博史
  • 2. 小山博史 Twitter: @hiro345 日経LinuxでRaspberry Pi記事連載中
  • 3. 宣伝  日経Linux 2014年8月号 ! IoTフレームワークのWebIOPiを取 り上げています。これを使うと Raspberry Pi で簡単に Internet of Things のプロトタイプが作れるよ うになります。
  • 4. Raspberry Pi とは • 教育用に開発されたボードPC • デスクトップPCとして使える • DebianベースのRaspbian OSがよく 使われている • 電子部品やセンサーが簡単に接続可能 • model B、B+ はLANコネクタ装備で ネットワークが利用可能 • 豊富なUSB機器が利用可能
  • 5. 注目されている IoT • Internet of Things(モノのインターネット) • 色々なモノがインターネット接続できるようになって きたことが注目されている。 • 個人的には、リアルワールドのモノがインターネット に接続してデータ化されると、バーチャルワールドと リアルワールドの境界がより近くなることだと認識し ています。
  • 6. Raspberry Pi と IoT • 従来のパソコンと比較して小型 • ネットワーク接続が簡単 • Linuxが使えるので豊富なライブラリ、プログラミング 言語を利用可能となり、開発が簡単 • プロトタイピングに適している • ネットワーク機能を持たないデバイスのハブになる
  • 7. WebIOPi • webiopi - Internet of Things framework - Google Project Hosting https://code.google.com/p/webiopi/ • Pythonベースなので、サーバサイドでカスタマイズしたり機能拡 張をするにはPythonを使うのが基本 • クライアントサイドプログラミング用にREST APIあり • bash、JavaScript、Ruby、Java、Pythonなど大抵のプログラミン グ言語から利用可能 • JavaとPythonはクライアント用ライブラリあり
  • 13. WebIOPiの ディレクトリ構成 ・htdocs/配下にJavaScriptなどがあることがわかる ・サーバプログラムはpython/配下 ・examples、tutorialsを確認すると作り方がわかる ・ドキュメントルートはカスタマイズ指定が可能 WebIOPi-0.7.0/ ├── doc/ │ ├── CHANGELOG │ ├── INSTALL │ ├── LICENSE │ ├── README │ └── updatedoc* ├── examples/ │ ├── clients/ │ ├── magpi-cambot/ │ └── scripts/ ├── htdocs/ │ ├── app/ │ ├── index.html │ ├── jquery.js │ ├── webiopi.css │ └── webiopi.js ├── java/ │ └── client/ ├── midori/ │ └── config ├── play.sh* ├── python/ │ ├── config │ ├── native/ │ ├── passwd │ ├── setup.py │ ├── webiopi/ │ ├── webiopi-passwd.py* │ ├── webiopi.init.sh* │ └── webiopi.sh* ├── setup.sh* └── tutorials/ ├── 1.basis/ ├── 2.macros/ ├── 3.devices/ ├── 4.serial-streaming/ └── 5.serial-command/
  • 14. Raspberry Pi のネットワーク設定 • 開発中はインターネット接続 • モバイルをしている最中は単体で稼働 • PCやスマフォから接続させたい時がある • PCやスマフォからの接続は制限したい時がある • 用途に応じてネットワーク設定は調整が必要
  • 15. USBシリアル変換ケーブル • USBシリアル通信でつなぐ • UARTピンのTX、RX、GNDと、USBシリアル変換コネクタを接続 • 3.3V用のコネクタを利用する事 • いろいろなUSBシリアル変換器 | hiro345 http://www.sssg.org/blogs/hiro345/archives/16623.html • FTDI USBシリアル変換アダプター(5V/3.3V切り替え機能付き) – スイッチサイエンス • FTDI USB・シリアル変換ケーブル(3.3V)(秋月電子通商) • CH340 USBシリアルモジュール « ちっちゃいものくらぶ • USB-TTL変換 – aitendo@shopping • FT231X USBシリアル変換モジュール(秋月電子通商)
  • 16. リンクローカルネットワークの設定 ・/etc/network/interfaces に記述! ・169.254.12.24 の固定IPアドレス指定! ・WindowsやOS Xでは、IPが取得できな!  いときに169.254.0.0のIPが自動設定!  されるので、これで直接通信可能! ・クロスケーブルかHUB経由で接続が必要! auto lo! ! iface lo inet loopback! iface eth0 inet dhcp! ! auto eth0:1! iface eth0:1 inet static! address 169.254.12.24! netmask 255.255.0.0!
  • 17. x11vnc リモートデスクトップ ・リモートからGUIで操作したいときに利用! ・VNCサーバの一種。他にはTightVNCなどもある! ・接続先は、vnc://169.254.12.24:5900! ・クライアントアプリ!  ・RealVNC:Linux、OS X、Windows!  ・TightVNC:Windows、Java!  ・OS 標準!   ・OS X:ファインダーのサーバへ接続!   ・Ubuntu:Remmina インストールは下記。起動時にパスワード設定あり! $ sudo apt-get install x11vnc! !! 設定は $HOME/.config/autostart/x11vnc.desktop! ----! [Desktop Entry]! Encoding=UTF-8! Type=Application! Name=X11VNC! Exec=/usr/bin/x11vnc -forever -usepw -display :0! StartupNotify=false! Terminal=false! Hidden=false! ----
  • 18. 無線LAN アクセスポイント化 ・hostapdで無線LAN接続提供 ・isc-dhcp-server でIPアドレス付与 ・本体は/etc/network/interfacesで  固定値を設定 ・起動時にwlan0が認識されない  ことがあるので、スクリプトで  調整 インストール! $ sudo apt-get install hostapd! $ sudo apt-get install isc-dhcp-server! ! ネットワーク設定変更! allow-hotplug wlan0! iface wlan0 inet static! address 192.168.20.1! netmask 255.255.255.0! $ cat wlan0_check.sh ! #!/bin/sh! LANG=C ifconfig wlan0|grep inet! if [ $? -eq 1 ]; then! sudo /sbin/ifconfig wlan0 192.168.20.1! sudo /usr/sbin/service isc-dhcp-server restart! fi! !! $ crontab -l! */2 * * * * sh /home/pi/wlan0_check.sh > /dev/null!
  • 20. WiringPi • Raspberry Pi specific functions • Timing functions • Program priority, timing and threads • Serial library • SPI library • I2C library • Shift library • Software PWM library • Software tone library ■ インストール! $ sudo apt-get install libi2c-dev! $ git clone git://git.drogon.net/wiringPi! $ cd wiringPi/! $ sudo ./build
  • 21. RPi-Cam-Web-Interface • Raspberry Pi カメラをWebインタフェースで利用可能 • インストールも簡単 • 撮影した動画はH.264、自動でmp4へ変換(処理が重い) • 手動で変換するにはMP4Boxコマンド • Webブラウザで撮影した動画、静止画をダウンロード可能 ■ インストール! $ cd /home/pi/RPi_Cam_Web_Interface! $ git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git! $ git pull origin master! $ ./RPi_Cam_Web_Interface_Installer.sh install! $ ./RPi_Cam_Web_Interface_Installer.sh start
  • 22. 参考:USBカメラ • USBカメラは値段が安い • 使用するアプリのインストールが少し大変 • 監視カメラを作っている人も多い • ロボットへ搭載して利用している人も多い
  • 23. まとめ • Raspberry Pi を使うと IoT のモノを開発しやすい • 実際に利用しようとすると工夫が必要 • WebIOPiを使うとREST APIの提供が簡単 • Raspberry Pi カメラも簡単にWebブラウザから使えるよう になっている • 高速開発をしたい場合はPython。性能を上げるにはWiringPi が便利