Raspberry Pi
- Raspberry Pi
- Raspberry Pi - Wikipedia
- こじ研(Raspberry Pi)
- RPi Hub - eLinux.org
- Coder for Raspberry Pi
- Raspberry Pi - Google+
- Kano - Make a Computer
- Piper: a Minecraft Toolbox – 人気ゲーム「マインクラフト」で電子工作を学ぶツールボックス
- Piper Raspberry Pi Computer Kit
- Raspad: Raspberry Pi Tablet For Your Creative Projects by SunFounder — Kickstarter
- Raspberry Pi Memo - 松谷健史のホームページ
- RaspberryPi の産業用途 - Qiita
- Raspberry Pi 3 B+ 何が変わったの?
- 【 速報 】Raspberry Pi 3 Model B+は、USB Boot Modeがデフォルトだった! | FABSHOP.JP -デジタルでものづくり! ファブショップ !
Raspbianのインストール
最新
モニターとキーボードなしで導入する
- Raspbianのインストールと初期設定 2018年10月版
- Raspbianのインストールと初期設定2017年12月版
- Raspberry Piをモニターとキーボードなしで導入する(その1)SSHでのログインまで | 株式会社インデペンデンスシステムズ横浜
イメージをSDカードに書き込む
- ダウンロード
Index of /pub/raspberrypi/raspbian/images
- 書き込み
2016-11-25版からSSHはデフォルトで無効
/bootパーティションにsshという名前のファイルを作成する。/bootパーティションはFATなのでWindowsから読み書きすることができる。
Bonjour Print Services (Windows)
raspberrypi.local
ttermpro.exe raspberrypi.local
/auth=<mode> <mode> で指定された認証方式で自動ログインを試みる
password パスワード認証 publickey 公開鍵認証 challenge チャレンジレスポンス(キーボードインタラクティブ)認証 pageant Pageant を用いた公開鍵認証
/user=<username> ユーザ名を指定する /passwd=<password> パスワードを指定する
設定
$ sudo raspi-config
- 言語
- タイムゾーン
- Wi-Fi(国の設定)
- microSDHCカードの領域拡大
固定IPアドレスを振る
$ sudo vi /etc/dhcpcd.conf # 設定ファイルにこの行以下を追記する interface eth0 static ip_address=192.168.11.101/24 static routers=192.168.11.1 static domain_name_servers=192.168.11.1
- Raspberry Pi 3 で固定IPアドレスを設定する(Wifi) - Qiita
- RaspberryPi - Raspberry Pi 2 (Raspbian: jessie) でIPアドレスを固定する - Qiita
ネットワークのリスタート
sudo systemctl restart networking
固定IPの変更
sudo systemctl restart dhcpcd
apt(apt-get,aptitude)のproxyサーバ設定
$ cat /etc/apt/apt.conf.d/10proxy Acquire::http::proxy "http://10.2.1.7:8080/"; Acquire::https::proxy "https://10.2.1.7:8080/"; Acquire::ftp::proxy "ftp://10.2.1.7:8080/";
一時的にproxy設定を無効にするには
$ sudo apt -o "Acquire::http::proxy=DIRECT" update
環境変数によるproxyサーバの指定
$ export http_proxy=http://10.2.1.7:8080 $ export https_proxy=http://10.2.1.7:8080 $ export ftp_proxy=http://10.2.1.7:8080 $ export HTTP_PROXY=http://10.2.1.7:8080 $ export HTTPS_PROXY=http://10.2.1.7:8080 $ export FTP_PROXY=http://10.2.1.7:8080
$ cat /etc/environment http_proxy=http://10.2.1.7:8080 https_proxy=http://10.2.1.7:8080 ftp_proxy=http://10.2.1.7:8080 HTTP_PROXY=http://10.2.1.7:8080 HTTPS_PROXY=http://10.2.1.7:8080 FTP_PROXY=http://10.2.1.7:8080
wgetのproxy設定
# vi /etc/wgetrc 以下のコメントを外す。 # https_proxy=http://... # http_proxy=http://... # ftp_proxy=http://... このように記述する。 https_proxy=http://10.2.1.7:8080/ http_proxy=http://10.2.1.7:8080/ ftp_proxy=http://10.2.1.7:8080/
一時的にプロキシを無効にする
$ wget --no-proxy
gitのproxy設定
$ git config --global http.proxy http://10.2.1.7:8080 $ git config --global https.proxy http://10.2.1.7:8080 $ git config --global url."https://".insteadOf git://
gpgのproxyサーバ設定
--keyserver-option http-proxy=http://<アカウント>:<パスワード>@プロキシサーバ:ポート
ブラウザのproxyサーバ設定
ブラウザのproxyサーバの設定は個別に設定する必要がある。Chromiumはシステムのproxyを使うようになっているが、raspbianではシステムの設定にproxyは見つからない。Chromiumのコマンドラインパラメータに--proxy-serverがあるのでこれを使う。
$ chromium-browser --proxy-server="http=http://10.2.1.7:8080;https=https://10.2.1.7:8080"
一度プロキシが通った状態で起動したらプロキシ設定用のプラグインがあるのでそれをインストールすると良い。
以前のMidoriブラウザのproxy設定は、
メニュー → 設定 → ネットワーク
から行える。
OSを最新の状態にする
$ sudo apt update $ sudo apt upgrade
ファームウェアのアップデート
プロキシの設定。
$ sudo HTTPS_PROXY=http://<username>:<password>@proxy:port rpi-update
sudo で環境変数を引き継ぐには-Eオプションをつける。
$ sudo -E rpi-update
vimのインストール
sudo apt install vim
network-managerのインストール
タイムゾーンの設定
$sudo timedatectl set-timezone Asia/Tokyo
日付時刻の設定
$ sudo date -s '10/24 20:30'
キーボードレイアウトの変更
(1)
sudo dpkg-reconfigure keyboard-configuration
(2)
setxkbmap -layout jp
(3)
日本語入力
$ suto apt inatall scmi-anthy
single user mode
rootのパスワードを忘れたときにはsingle user modeで起動し、passwdコマンドで新しいパスワードを設定する。
バージョン
$ cat /etc/debian_version
$ cat /etc/issue
$ lsb_release -a
ruby 1.9.3p194 (2012-04-20 revision 35410) [arm-linux-eabihf]
Python 2.7.3
- Jessie
Python 2.7.9 (default, Mar 8 2015, 00:52:26)
2016-09-23版
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
2017-4-10版
ruby 2.1.5p273 (2014-11-13) [arm-linux-gnueabihf]
- Stretch 9.1
2017-09-07版
node -v
v4.8.2
ruby 2.3.3p222 (2016-11-21) [arm-linux-gnueabihf]
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)
2018-06-27版
node -v
v8.11.1
Python
- [|https://bootstrap.pypa.io/]
- python - How to get pip to work behind a proxy server - Stack Overflow
- Installation ― pip 8.0.2 documentation
- Installing Python's easy_install using ez_setup.py from behind a proxy server - Stack Overflow
パッケージ一覧
$ dpkg -l | grep パッケージ名の一部
pyenv
Bluetooth
RasPi3以降にはBlutoothが標準で搭載されている。特に何もしなくてもBlutooth関係のコマンドが使用できる。以下は不要。
$ sudo apt install bluetooth bluez-utils
SPP
従来の方法でSPPを使用するには、
sudo nano /etc/systemd/system/dbus-org.bluez.service
buetoothデーモンが互換モードで起動するように'ExecStart='の行末に'-C' を付け加える。 そして、その行のすぐ後に SPプロフィルを付け加えるために'ExecStartPost='を新たに付け加える。次の2行のようにする。
ExecStart=/usr/lib/bluetooth/bluetoothd -C ExecStartPost=/usr/bin/sdptool add SP
書き換え後の再起動は、以下のコマンドを実行する。
sudo systemctl daemon-reload sudo systemctl restart bluetooth
$ sdptool browse local $ hcitool scan $ sdptool browse 2C:8A:72:F0:DA:89 $ sudo bluez-simple-agent hci0 2C:8A:72:F0:DA:89 $ sudo nano /usr/bin/bluez-simple-agent $ sudo perl -i -pe 's/KeyboardDisplay/DisplayYesNo/' /usr/bin/bluez-simple-agent $ sudo bluez-test-device trusted 2C:8A:72:F0:DA:89 yes $ sudo sdptool add --channel=22 SP $ sudo rfcomm listen /dev/rfcomm0 22 $ sudo rfcomm watch /dev/rfcomm0 22
ペアリングの解除
# sudo bluez-test-device remove 2C:8A:72:F0:DA:89
- Raspberry Pi 3 Bluetoothキーボード マウスを使ってみる
- Muro Lab. -Yamamuro Laboratory-
- RaspberryPiでBTキーボード - yunoyaの日記
- Pythonでシリアル通信 - Qiita
- [OBDNマガジン 【.tested】Logitec Bluetooth USBアダプタ LBT-UAN04C2 [Debian Wheezy-Squeeze][AX3][A6]ここ
- [bluetooth Analog Devices Open Source| Mixed-signal and Digital Signal Processing ICs]
- 40歳から始めるブログ: Raspberry PiでBluetoothを使う
- kakakikikekeのブログ: bluetoothctl と expect で無線キーボードに定期的に接続するスクリプト
- [SOLVED] Control bluetoothctl with scripting?
- linux - bluetoothctl to hcitool equivalent commands - Stack Overflow
- Bluetoothctl automation · GitHub
- Jessie
$ sudo apt install bluetooth bluez-tools bluez-firmware
- kakakikikekeのブログ: RaspberryPi の bluetoothctl で無線キーボードに接続
- Raspberry Pi • View topic - Bluetooth RFCOMM - Jessie
- sdptool is broken in Bluez 5 / Networking, Server, and Protection / Arch Linux Forums
- Raspberry Piをbluetooth使用ルータとして活用する (Step2 bluetoothペアリング) - ぱっそ あ ぱっそ
- 倉庫のブログ: Raspberry Piに挑戦-Bluetoothキーボードの接続
- Raspberry Pi • View topic - Bluetooth issues
無線LAN
WPS
wpa_cli wps_pbc
または、
wpa_cli -i wlan0 wps_pbc
認証
- パスワード
$ echo -n 'パスワード' | iconv -t utf16le | openssl md4 > hash.txt
- wpa_supplicant.conf
$ cat /etc/wpa_supplicant/wpa_supplicant.conf country=JP ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1
network={ ssid="SSID" priority=1 proto=RSN key_mgmt=WPA-EAP pairwise=CCMP auth_alg=OPEN eap=PEAP identity="ユーザー名" password="パスワード" phase1="peaplabel=0" phase2="auth=MSCHAPV2" }
- 追記
# lsusb # wpa_passphrase "SSID" "password" network={ ssid="SSID" #psk="password" psk=暗号化されたパスワード } # vi /etc/wpa_supplicant/wpa_supplicant.conf network={ ssid="SSID" psk=暗号化されたパスワード } # vi /etc/dhcpcd.conf interface wlan0 static ip_address=192.168.11.101/24 static routers=192.168.11.1 static domain_name_servers=192.168.11.1
再起動して、ifconfigで確認する。
- DHCP
sudo dhclient -v -r wlan0 sudo dhclient -v wlan0
- ルータのボタンをワンプッシュ!Raspberry Pi Zero WのWifi接続を簡単に切り替える方法 - もぐてっく
- RaspberryPi - Raspberry Pi Raspbian Wheezy(2015-05-05)で最速Wi-Fiセットアップ - Qiita
- Raspberry Pi 3 Model Bの WiFiを無線LANアクセスポイントにする方法 (ラズパイ3に内蔵の WiFiを無線LANアクセスポイントにして通信環境を設定する方法)
- Raspberry Pi 3でWifi接続(PEAP, MSCHAPv2) - Qiita
- [Raspberry Pi • View topic - Tutorial] Setup Raspberry Pi - PEAP/MSCHAPV2 conne
- Raspberry Pi 3 and PEAP-MSCHAPv2 WiFi Networks
ELECOM WDC-150SU2M (8188euチップセット)
- [Linux - WifiのSuspend設定を解除するRaspberry pi] - Qiita
- Raspberry Pi + Raspbian 無線 LAN アダプタの省電力モードをオフにする - Linearstar
- Raspberry PiのOSアップデートでWDC-150SU2MがLXPanelから使えなくなっていた原因がわかった - 知的好奇心 for IoT
SSH
VNC
2016-09-23版から標準でVNCサーバがインストールされている。
ただし、有効にするにはraspi-configで設定する必要がある。
- Raspberry Piの設定【VNCサーバ(tightVNC)の設定】 - Aldebaranな人のブログ
- 【ラズパイ】VNCサーバ on Raspberry pi セットアップ手順 - "Diary" インターネットさんへの恩返し
Raspberry Piを別のPCからリモート操作 » DesignSpark- UltraVNC - 窓の杜ライブラリ
- Download VNC Viewer for Windows | VNC Connect
$ sudo apt install tightvncserver
xrdp
$ sudo apt install xrdp $ cd /etc/xrdp $ sudo wget http://w.vmeta.jp/temp/km-0411.ini $ sudo chown xrdp:xrdp km-0411.ini $ sudo ln -s km-0411.ini km-e0010411.ini $ sudo ln -s km-0411.ini km-e0200411.ini $ sudo service xrdp start
Java
Node.js (JavaScript)
$ sudo apt install nodejs $ sudo apt install npm $ sudo npm cache clean $ sudo npm install n -g $ sudo -E n stable
- プロキシ
$ npm -g config set proxy http://proxyserver:8080 $ npm -g config set https-proxy http://proxyserver:8080
nは環境変数http_proxy,https_proxyを参照する。sudoには-Eオプションが必要。
GPIO
RPi.GPIO
Jessie以降では最初からインストールされている。
pigpio
標準でインストール済み。自動起動するので特別な操作は不要。raspi-config(Remote GPIO)で設定する。
sudo systemctl status pigpiod
- [Raspberry PiのGPIO制御の決定版 pigpio を試す - karaage. からあげ]
- Raspberry Pi 3 pigpioを使ってLチカ PWM編
- pigpioでサーボモーターを動かす。 – Blue-black.ink
WiringPi
現在は標準でインストールされている。
- Jessie
sudo apt install wiringpi
WebIOPi
I2C
sudo raspi-config
以下はもう必要ない。
sudo apt-get install i2c-tools sudo /usr/sbin/i2cdetect -y 1
- Raspberry Pi の I2C を有効化する方法 (2015年版) - 意識低い開発者のBlog
- 最近の Raspberry Pi で I2C を有効化 - Rabbit Note
- Raspberry Pi で I2C の Repeated Start Condition を有効化 - Rabbit Note
- How To Use A MCP23017 I2C Port Expander With The Raspberry Pi – Part 1
RTC
- raspberry pi と RTCモジュール | Linux & Android Dialy
- Raspberry PIへリアルタイムクロックモジュールのI2C接続 | TomoSoft
- 工作と小物のがらくた部屋: Raspberry Pi で I2C その1 秋月RTCモジュール
- Raspberry Pi(ラズベリーパイ)で秋月のリアルタイムクロックRTC-8564NBをバックアップ回路付きで使う
SPI
spidevはパッケージが存在し標準でインストールされています。
python-spidev python3-spidev
以下は、不要。
raspi-config git clone http://github.com/doceme/py-spidev.git/ cd py-spidev sudo python setup.py install
- Simple ADC with the Raspberry Pi | We Saw a Chicken …
- RaspberryPi - Raspberry PiのPythonからTMP36のアナログ温度センサとMCP3008のADコンバータを使う - Qiita
wget https://github.com/doceme/py-spidev/archive/master.zip
ADC
- 10bit 2ch ADコンバータ MCP3002−I/P: 半導体 秋月電子通商-電子部品・ネット通販
- Raspberry Pi 3でpythonを使いA/Dコンバーターでアナログ信号を検出する! - Qiita
ServoBlaster
Debian stretchでは、動作しないそうです。
- [|https://github.com/richardghirst/PiBits/archive/master.zip]
- RaspberryPiとWiringPiでサーボを動かす - Qiita
- SG90データシート
PlatformIO Core
LIRC
$ sudo apt install lirc
$ sudo systemctl status lircmd
- Raspbian Stretchで LIRC機能を使った学習リモコン、赤外線リモコンを動かす方法 (Raspberry Pi Raspbian Stretchで赤外線リモコンの制御アプリ LIRC 0.9.4cの設定方法)
- Raspberry pi 3 で部屋の赤外線受信できる機器をコントロール!
音声
MIDI
sudo apt install libasound2-dev sudo pip instal rtmidi sudo pip install mido
Wiiリモコン
$ sudo apt install wminput $ wget https://www.raspberrypi-spy.co.uk/archive/python/wii_remote_1.py
$ sudo pip install wiiuse --proxy=
- 白いバナナ: Wiiリモコンハック with Raspberry Pi
- HOWTO: Python Wiimote fun (LEDs, rumble, accel, buttons) - maemo.org - Talk
- CWiiDをUbuntu 14.04にインストールする ( パソコン ) - 熱血挑戦者のブログ - Yahoo!ブログ
- XWiimote - ArchWiki
- abstrakraft/cwiid: Linux Nintendo Wiimote interface
- Wiimote/Library - WiiBrew
- Bad constant? · Issue #9 · dvdhrm/xwiimote-bindings · GitHub
- GitHub - sanjay900/Wiimote-Guitar-Linux: Backport the guitar fixes from a previous linux kernel, that were removed because they were submitted alongside drums.
- tswast/pywiiuse: Automatically exported from code.google.com/p/pywiiuse
$ sudo apt install libxwiimote-dev swig $ sudo apt install autoconf libtool $ ./autogen.sh --prefix=/usr
sudo apt install libncurses5-dev
PSコントローラ
Wiiリモコンプラス
- Connecting a Wii Remote Plus controller with Debian 8 (jessie) – Gordon Lesti
- Left Brain Tinkering: Wii Remote Plus and Linux
- bluetooth - How to pair Wiimote in Ubuntu 15.10? - Ask Ubuntu
PS3コントローラ
RapiroをPS3のDUALSHOCK3で動かしてみる | Makuake(マクアケ)NOTE クラウドファンディングブログ- Welcome to QtSixA!
- Raspberry Pi 2にPS3のコントローラーをBluetoothで接続する - カイワレスタイル
- Raspberry Pi で戦車を作る(Bluetooth/PS3 Dualshock3編) | Moonmile Solutions Blog
PS4コントローラ
esp8266 MQTT
$ sudo apt install mosquitto mosquitto-clients
- サブスクライバー(受信)
mosquitto_sub -d -t test -v
- パブリッシャー(送信)
mosquitto_pub -d -t test -m "こんにちは"
MQTT
$ sudo apt install mosquitto $ sudo apt install mosquitto-clients
Nginx (Webサーバー)
Apache2 (Webサーバー)
$ sudo apt install apache2
/var/www/html
MySQL (データベースサーバー)
$ sudo apt install mysql-server
# mysql -u root -p Enter password:root
Redmine (プロジェクト管理ソフトウェア)
$ sudo apt install mysql-server $ sudo apt install redmine redmine-mysql libapache2-mod-passenger
途中いろいろ聞かれるがデフォルトのまま進める。データベースサーバはmysqlを選択する。
設定をやり直すときは、
$ sudo dpkg-reconfigure -plow redmine
$ sudo ln -s /usr/share/redmine/public /var/www/html/redmine
$ cat /etc/apache2/mods-available/passenger.conf
<IfModule mod_passenger.c> PassengerDefaultUser www-data PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini PassengerDefaultRuby /usr/bin/ruby RailsBaseURI /redmine </IfModule>
$ sudo su -c 'cat << EOF > /etc/apache2/sites-available/redmine.conf <Directory /redmine> Options FollowSymLinks PassengerResolveSymlinksInDocumentRoot on AllowOverride None </Directory> EOF'
Apacheを再起動する
$ sudo systemctl restart apache2
アクセスは
http://ホスト/redmine
- Redmine on Raspberry Pi 2 | ktkr3d
- Ubuntu 14.04にRedmine(MySQLとApache2)をインストールする - Narrow Escape
- RaspberryPiにRedmineをインストール(チケットファイル添付対応) - Kamuycikap - SentenceDataBase
PHP5
sudo apt install php5
PHP7
sudo apt install php
または
sudo apt install php7.0
systemctl
Scratch
- Raspberry PiでScratchを使う際の覚書
- Squeak - Dev - International text input on X11 | Page 3
- Linux版Scratch1.4で日本語入力 - Qiita
- neuralassemblyのメモ: NOOBS 1.9.2でインストールしたRaspbian (jessie) 上のScratchで日本語入力を可能にしてみた
- http://swikis.ddo.jp/WorldStethoscope/16
- littleBits Arduino モジュールをScratchから使う
FreeBASIC
マインクラフト
- Minecraft Pi editionで牛、羊、ゾンビなどが出てくるサバイバルモードを楽しむ – FABSHOP.JP -デジタルでものづくり! ファブショップ !
- Raspberry PiデビューしてMinecraft Pi Editionで遊んだ話 - Qiita
- マインクラフト − Raspberry Pi公式ドキュメントを日本語訳
FLiR
$ sudo raspi-config $ sudo apt install qt4-dev-tools $ wget https://github.com/groupgets/LeptonModule/archive/master.zip $ unzip master.zip
- raspberrypi_video
- Pi zero はどれだけ使えるか? - Take’s diary
- blog/2015-07-16/Flir leptonという赤外線カメラ - Linux工作室
- FLIR Lepton Hookup Guide - learn.sparkfun.com
- FLiR開発キット - スイッチサイエンス
- Quick start guide: Lepton and Raspberry Pi – Lepton Maker Community
- How to install FLIR Lepton Thermal Camera and applications on Raspberry Pi - Appropedia: The sustainability wiki
- [|https://groupgets.com/manufacturers/getlab/products/purethermal-1-flir-lepton-smart-i-o-module]
- [|https://github.com/groupgets/pylepton]
- Streaming the output of Flir Lepton on Raspberry Pi - Google グループ
- raspbian - How can you get video display using the FLIR thermal camera - Raspberry Pi Stack Exchange
- Pylepton Zero - Hackster.io
- Thermal Imaging Camera: 13 Steps
- FLIR_Lepton_with_FT232xx
- Flir_lepton
bot
LINE
- [|]
Machinekit (Linux CNC)
Estlcam
- Estlcam.de 2D / 3D CAM Software und CNC Steuerung...
- [|http://www.dokidoki.ne.jp/home2/iyoya/3dprint/estlcam.html]
- [|https://youtuber.byte.jp/pc/1207]
- [|https://qiita.com/GENM/items/5401117b8a710739520c]
- [|http://ohkin.mydns.jp/archives/367]
RT-Preempt カーネル
- #Rapberry Pi: Preempt-RT Kernel Performance on Rasbperry PI 3 Model B+ | LeMaRiva
- GitHub - lemariva/RT-Tools-RPi: Tools for Patching the Rasbian kernel with RT-Preempt.
- 秋の夜長の Raspberry Pi 3 カーネル・セルフ・ビルド: new_western_elec
- notro/rpi-source: Raspberry Pi kernel source installer
- RealtimePi – out of the box real-time RaspberryPi Raspbian | Guysoft's Weblog
- GitHub - guysoft/CustomPiOS: A Raspberry Pi and other ARM devices distribution builder
- [|]
Xenomai
PICnc
- Home · kinsamanka/PICnc-V2 Wiki · GitHub
- GitHub - kinsamanka/PICnc-V2: PICnc V2 is a PIC32 based hardware step generator board that is designed for MachineKit
- GitHub - Wireb/PICnc-5axis: PICnc V2 is a PIC32 based hardware step generator board that is designed for MachineKit