Table of Contents
I connected my Raspberry Pi to WiFi (Wireless LAN).
Environment
I used Raspberry Pi B+, but almost of all Raspberry Pi may work in the same way.
- Raspberry Pi MODEL B (PLUS) & 専用ケ-ス
- PLANEX Wireless LAN子機 (USB Adapter Type) 11n/g/b 150Mbps MacOS X10.10対応 GW-USNANO2A (FFP)
Raspberry Pi には OS が既にインストールされているものとして話を進めます。 私が OS をインストールしたときの手順は Raspberry Pi B+ に RASPBIAN JESSIE LITE をインストールした方法 に記載しています。
And, USB keyboard and HDMI display are necessary. (クロスケーブルでPCと直接つないで作業することもできると思いますが、 I connected USB keyboard and display directly.)
Wireless LAN Adapter の決め手
Why I used PLANEX GW-USNANO2A.
This product is over 1000 yen, and not the lowest price, but power consumption is really low, 1.3 W. And Amazon reviews describe that it is stable than other products. And other web site also say so.
wireless LAN Configuration
Connect PLANEX GW-USNANO2A to Raspberry Pi USB socket and turn on Raspberry Pi.
First, switch to root user.
1 |
sudo su - |
And execute the following command. Change YOUR_SSID
and YOUR_PASSPHRASE
to yours. If the SSID contains bracket, surround it by double quotes (“).
1 |
wpa_passphrase SSID KEY > /etc/wpa_supplicant/wpa_supplicant.conf |
Then, it will work. 他のサイトには他の手続きも書かれていますが、これだけでつながります。
Now, let’s reboot with the following command. It will connect to wireless LAN automatically, if wireless router is working and the Raspberry Pi is in the wireless LAN range.
1 |
sudo shutdown -r now |
Check Configuration
you can check configuration with the following command.
1 |
ping google.co.jp |
If google server respond it, the configuration is completed. Exit with Ctrl + C.
At last, execute the following command and shutdown the Raspberry Pi.
1 |
sudo shutdown -h now |