setting up a wifi connection on the raspberrypi

Upload: try-fajarman

Post on 13-Oct-2015

50 views

Category:

Documents


0 download

TRANSCRIPT

Setting up a WiFi connection on the RaspberryPi

Ive recently tried to setup a WiFi connection with the RaspberryPi and encountered some issues: the connection didnt start automatically and it wasnt stable. Im using an Edimax EW-7811Un USB dongle, which is supposed to be supported out of the box with Raspian Wheezy (2012-12-16).After researching the issue, I finally have a configuration that works reliably. Here are the steps Ive followed.Setting up the configurationEdit the/etc/network/interfaces file to look like this:auto lo

iface lo inet loopbackiface eth0 inet dhcp

#auto wlan0allow-hotplug wlan0iface wlan0 inet manualwpa-roam /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcpThen add your WiFi parameters to /etc/wpa_supplicant/wpa_supplicant.conf.Here are my parameters to connect to my freebox (French ISP router).network={ ssid="YOURSSID" scan_ssid=1 key_mgmt=WPA-PSK proto=WPA psk="YOURPASSWORD"}At this point, the you should be able to start the connection with this command:sudo ifup wlan0In some cases, you might need to dosudo ifup wlan0first.Connect automatically when bootingTo make the connection work when the RaspberryPi boots, I have added a few lines to/etc/rc.local (source) :echo "Starting WiFi..."wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.confsleep .5sdhclient wlan0echo "WiFi should be started"

exit 0Keep the connection aliveTo make sure that the connection stays up, Ive done two things.First, disable the power management of the WiFi dongle. Create a new/etc/modprobe.d/8192cu.conf file with this content (source):options 8192cu rtw_power_mgnt=0 rtw_enusbss=0Then, make the RaspberryPi ping the router every minute. Open your crontab:$ crontab -eand add this line at the end :*/1 * * * * ping -c 1 192.168.0.254Replace the IP address by the actual IP address of your router.It took me some time to get it right, but now the Pi connection seems to work

How to setup a USB wlan connection on a Raspberry Pi alternativemethod1 ReplyLast week I received a new Raspberry PI model B with 512MB ram. I tried to enable WLAN usingmy own instructionsfor theEdimax WLAN Hi-Speed USB 2.0 EW-7811Un Nanoand it didnt work!?!? Huh?Some how I got the following error message:wpa_supplicant: /sbin/wpa_supplicant daemon failed to startbut after some google-ing I found a solution for the problem. In many posts on the web, it is suggested that the problem relates to a lack of power issue on the RPi USB. I found out that it is really a configuration issue. Here is how I solved it:The setup assumes working from a clean Rasbian Wheezy image and applying the latest updates.Configure the network adapter interfacesudo nano /etc/network/interfacesyou have to make the content of/etc/network/interfaces look like this:auto loiface lo inet loopbackiface eth0 inet dhcpauto wlan0allow-hotplug wlan0iface wlan0 inet dhcpwpa-ssid YOUR NETWORK SSID HEREwpa-psk YOUR NETWORK PASWORD HEREctrl-x and Y to save the changesNow just restart your network connectionssudo /etc/init.d/networking restartor alternatively rebootsudo rebootThat is it!You dont have to use the/etc/wpa_supplicant/wpa_supplicant.conf with this setup.

This entry was posted inRaspberry,Wlan and Wifiand taggedEdimax,Edimax ew-7811un,Raspberry Pi,Rpi,USB,Wireless LAN,Wlan,wpa supplicant,wpa_supplicant: /sbin/wpa_supplicant daemon failed to startonApril 1, 2013.How to setup a USB wlan connection on a RaspberryPi2 RepliesA little while ago I got myself a Raspberry Pi to tinker around. I didnt know anything aboutLinux/Debian/ Wheezy but I was inspired by the many differentkind of applications of the Raspberry Pi that I read about on the internet.In the meantime Ive managed to turn the Raspberry into an Airpi. It took me some time to figure everything out, but I finally got there.Every time I want to change/add some functionality I find myself spending lots of timeGoogle-ing for the right solution. The solutions that work Ill share on this blog so you can save some time achieving the same.Today I figured out how to setup and enable the USB wlan connection on theRaspberry Piand make it connect to my wireless network.update, Ive also posted an alternative solution:How to setup a USB wlan connection on a Raspberry Pi alternativemethodI got two usb wlan adapters which I both tested and seemed to work with this method:Edimax WLAN Hi-Speed USB 2.0 EW-7811Un NanoWLAN 11n USB Micro Stick US300EX LiteFirst you need to configure the network adapter interfacesudo nano /etc/network/interfaces#-# This file describes the network interfaces available on your system# and how to activate them.# The loopback network interfaceauto loiface lo inet loopback# the LAN network interfaceauto eth0iface eth0 inet dhcp# the WLAN network interfaceauto wlan0allow-hotplug wlan0iface wlan0 inet manualwpa-roam /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcp#-Then you need to set the wlan parameterssudo nano /etc/wpa_supplicant/wpa_supplicant.conf#-network={ssid=put your SSID hereproto=RSNkey_mgmt=WPA-PSKpairwise=CCMP TKIPgroup=CCMP TKIPauth_alg=OPENpsk=put your psk here}#-Then you need to rebootsudo reboot

Konfigurasi koneksi Wireless WEP dan WPA pada Raspberry PiDiposkan olehRizky RusfadilahdiWednesday, April 17, 2013

Di tulisan sebelumnya telah saya bahas mengenai instalasiUSB WiFi Adapter menggunakan Edimax EW-7811Un. Agar Pi dapat terhubung ke jaringan atau internet diperlukan konfigurasi.

Konfigurasi yang akan saya sampaikan bersifat umum dan dapat digunakan oleh perangkat lain selain Edimax EW-7811Un. Konfigurasi Wireless akan saya jelaskan untuk 2 model yaitu yang menggunakan:

WEP WPAKedua konfigurasi diatas umumnya sering digunakan pada setiap wireless router. Mengingat dari tulisan sebelumnya Wifi adapter yang terdaftar pada Pi saya adalah wlan0, maka setiap konfigurasi yang dilakukan menggunakan wlan0.

1. Konfigurasi WEP pada Raspberry PiWEP dapat dikatakan sudah terlalu tua untuk sistem keamanan wireless namun masih banyak digunakan, karena banyak perangkat lama (laptop, PC) yang hanya memiliki kemampuan tersebut dan tidak dapat ditingkatkan ke WPA.

Agar Pi dapat menggunakan WEP, buka text editor dan buka fileetc/network/interfacesDengan perintah:sudo nano etc/network/interfaces

Lalu tambahkan baris wireless berikut:?12345auto wlan0allow-hotplug wlan0iface wlan0 inet dhcpwireless-essid"SSID_MU"wireless-key"WEP_KEY_MU"

Ganti kataSSID_MUdengan nama koneksi Wifi yang kamu gunakan tanpa tanda kutip.Ganti kataWEP_Key_MUdengan password Wifi yang kamu gunakan tanpa tanda kutip.

Dengan konfigurasi diatas maka, Pi akan mendapatkan ip dinamis dari Wireless Router.Untuk memastikan apakah konfigurasi sudah tepat, matikan service wireless Pi dengan perintah:sudo ifdown wlan0

Dan aktifkan kembali dengan perintah:sudo ifup wlan0

Untuk mengetahui apakah sudah mendapatkan ip, ketik:ifconfig -a

Akan tampil informasi jaringan wireless beserta ip yang digunakan.

2. Konfigurasi WPA pada Raspberry PiKonfigurasi WPA tidak jauh berbeda dengan WEP hanya ada beberapa kata yang harus diganti pada fileetc/network/interfacesKetik perintah:sudo nano etc/network/interfaces

Lalu tambahkan baris berikut:?12345auto wlan0allow-hotplug wlan0iface wlan0 inet dhcpwpa-ssid"SSID_MU"wpa-psk"WPA_KEY_MU"

Ganti kataSSID_MUdengan nama koneksi Wifi yang kamu gunakan tanpa tanda kutip.Ganti kataWPA_Key_MUdengan password Wifi yang kamu gunakan tanpa tanda kutip.

Untuk memastikan apakah konfigurasi sudah tepat, matikan service wireless Pi dengan perintah:sudo ifdown wlan0

Dan nyalakan kembali dengan perintah:sudo ifup wlan0

Untuk mengetahui apakah sudah mendapatkan ip, ketik:ifconfig -a

Akan tampil informasi jaringan wireless beserta ip yang digunakan.

Yup.. Mudah bukan konfigurasi wireless di Raspberry Pi :)

Referensi Tulisan:http://jeffskinnerbox.wordpress.comhttp://wiki.debian.org/WiFi/HowToUse