https://learn.adafruit.com/introducing-the-raspberry-pi-zero?view=all
の通り進めていけば良い。
基本的にRuspbianをダウンロードし、https://github.com/RayViljoen/Raspberry-PI-SD-Installer-OS-X でMicro SDに書き込めば起動できる状態になる。
Raspbianのオフィシャルダウンロードページが遅いのでミラーを使う。 https://www.raspbian.org/RaspbianMirrors
/etc/apt/sources.list もミラーを使うように直しておく。
#deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb-src http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian/ jessie main contrib non-free rpi
Planex GW-USNANO2AなどはRaspbianのデフォルトで認識するらしいが、アキバを数件見ても置いているところがなかった。(2015-12現在)
入手が容易だったIO-DATA WN-G150UM はデフォルトでは認識しない。
- http://blog.ryoana.com/entry/2014/03/18/223601
- http://marm.cocolog-nifty.com/jokanaan/2012/12/index.html
- http://volupis.blog46.fc2.com/blog-entry-48.html
を参考に以下のように書き換えることで利用できる。
/etc/udev/rules.d/network_drivers.rules
ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idVendor}=="04bb",ATTRS{idProduct}=="094c",RUN+="/sbin/modprobe -qba 8192cu"
/etc/modprobe.d/network_drivers.conf
install 8192cu /sbin/modprobe --ignore-install 8192cu $CMDLINE_OPTS; /bin/echo "04bb 094c" > /sys/bus/usb/drivers/rtl8192cu/new_id
/etc/modprobe.d/8192cu.conf
# Disable power management
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
2022-08現在 rtl8192cuドライバを使う。
/etc/udev/rules.d/network_drivers.rules
ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idVendor}=="04bb",ATTRS{idProduct}=="094c",RUN+="/sbin/modprobe -qba rtl8192cu"
/etc/modprobe.d/network_drivers.conf
install rtl8192cu /sbin/modprobe --ignore-install rtl8192cu $CMDLINE_OPTS; /bin/echo "04bb 094c" > /sys/bus/usb/drivers/rtl8192cu/new_id
wpa_passphrase コマンドを利用して、/etc/wpa_supplicant/wpa_supplicant.conf にパスフレーズを書き込む。 コメントで生パスワードが書かれるので消しておくこと。
$ sudo sh -c 'wpa_passphrase SSID PASSPHRASE >> /etc/wpa_supplicant/wpa_supplicant.conf'
デフォルトのavahi(Zeroconf,Bonjour)に任せて ruspberrypi.local
のホスト名で繋げられるようにした。
Raspbian各種設定をする時、オフィシャルなドキュメントではUSBキーボードとHDMIの映るディスプレイをつなげて、通常コンソールから行うように書かれている。
インストール時に作成するSDカードをLinuxマシンでマウントし、/etc以下のWi-Fi設定などのファイルを書き換えてから起動させればヘッドレスで初期設定ができる。 本当はMac上で完結させたかったが、調べたところではOSXからext4を書き込むのは難しいようだ。
vfat fsの/bootパーティションを利用することで、容易に設定変更できるのではないかと思っている。 -> 2022-08現在では、Raspberry PI Imagerを使って設定できるようになっている。
USBキーボードをつなげて101キーボードを使っているのに、2の上が@じゃない!おかしい!となったとき。
$ sudo dpkg-reconfigure keyboard-configuration
$ sudo service keyboard-setup restart
https://wiki.debian.org/Keyboard
https://www.raspbian.org/RaspbianMate
sudo apt-get install mate-core mate-desktop-environment
~/.xinitrc に追加
exec mate-session
apt-get install vnc4server
を入れて、~/.vnc/xstartupの以下をコメントに従ってコメントアウト。
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
vncserver
コマンドでサーバを立ち上げる。
OSXからはFinderの「サーバへ接続(Cmd+K)」でvnc://raspberrypi.local:5901
に接続すれば使える。
http://www.mztn.org/rpi/rpi34.html
- BT接続
- キーボード
- ネットワーク
- iOSからのアクセス
- 日本語
- BTキーボードのコントロールキー問題
- ケース、電源
- クロスコンパイル