Thursday 27 March 2014

How to use Wi-Fi On Your Raspberry Pi
supreethThursday 27 March 2014 0 comments

I think you must have configured your cute or cool little Raspberry Pi as we have discussed in the way you want so i have also!!, its fine and well and running slickly, once i wondered and also worried about changing the big preference of connection its Ethernet tether with a Wi-Fi unit( I had to choose wireless because my rpi is so fussy and wired). Wait, We are not going to make it back up to all the peripherals and quickly add in Wi-Fi support from the command line.
Why Wifi for it?
If you’re a DIY geek (or trying becoming one), you obviously would have known how annoying it can be to realize that your RPi project now needs yet another little tweak that likely necessitates pluging in a monitor and keyboard/mouse to the box.
The best way to avoid setting up things  tois connect your pc and control your rPi from it otherwise known as remote access(you can do it by downloadin team viewer from here and install in both servers). Once you have that setup,  you wiil obviously need to know how to control things out remotely that would formerly be automated by a interface (like turning on the Wi-Fi). we’re going to take you through the way to remotely connect to your Pi and activate a Wi-Fi dongle
What Do we need
·         Raspbian installed Raspberry Pi unit with ever thing ready
·         1internet connection to Pi unit (needed for activating the Wi-Fi functionality remotely)
·         Wi-Fi Dongle (as in india i have used tata photon+ obviously best in my country)
If this dongle is not available in your country we strongly recommend googling twice  for the model you have it in mind to purchase to see if it is well supported.
In addition to the above items, you need to take a moment to check the config of the Wi-Fi unit you have to connect your Raspberry Pi unit to: you’ll need to take a peek of the password, SSID and encryption method etc
Enabling the Wi-Fi Dongle through  the Terminal
Every things cool now lets start, boot your Raspberry Pi unit (without the Wi-Fi dongle pinned in). Now, o network device should be aboard Ethernet NIC
Connect to your R Pi via SSH connection  to get access  to a remote terminal prompt. (didn’t configure your device for remote access before?, do it now)
Back at the prompt, enter the following command line:
sudo nano /etc/network/interfaces
At the nano text editor, you’ll see something like this:
auto lo
iface lo inet loopback
iface eth0 inet dhcp

That’s the same old basic configuration that maintains your RPi’s Ethernet connection (you can see the eth0 part). We need to add a very tiny bit to enable the Wi-Fi dongle.  move down below the existing code by Using the arrow keys and add the following lines:
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Once you annotate the file,  save the file(shortcut ctrl +x) and exit the nano editor. At the command line again, enter the following command:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
contrast the contents of the file, to the following code. If the file is empty, you can use this code to manipulate it. Make a note of the commented lines (shown by the # ) to reference which variable you should use based on your current Wi-Fi node configuration.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID"
psk="PASSWORD"
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)
proto=WPA
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)
key_mgmt=WPA-PSK
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
pairwise=TKIP
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)
auth_alg=OPEN
}
 Then you’re done editing the file, press save and exit the document. Now is right the time to unplug the Ethernet cable and plug in the Wi-Fi dongle .
At the command line, enter the following command which will reboot the PI:
sudo reboot
When the device reboots completely, it should automatically connect to the Wi-Fi part. for some basis if it fails to emerge on the network, you can simple replug the Ethernet cable back into  it and check the two files and the variables you altered.
check the position of the Wifi if its working by command line ifconfig (this helps us to to see if wlan0 has got an IP address) and command iwconfig to check which network the wireless adapter is currently using.



Hell yeah finished now surf up the net on your raspberry pi with lesser wires and more enriched experience, if you still got a problem with it comment below, you can also request below for a tutorial on this by commenting below, happy DIYing, wish u a good luck
About The Author Ali Bajwa Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore. Magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Facebook and Twitter

0 comments

Post a Comment