Monday 7 October 2013

Set up raspberry pi wifi dongle wireless manually command line

Ralink RT5370 on Raspberry Pi wheezy linux

On terminal;

uname -a
3.6.11+

sudo dmesg
 Error - Invalid RF chipset / Error - Failed to allocate device -> go to "svay.com" link
sudo nano /etc/modprobe.d/blacklist.conf (check here on error)
sudo nano /etc/modprobe.d/raspi-blacklist.conf
then comment out(#) blacklist rt5370, blacklist rt2x00usb



 New USB device found, idVendor=xxxx
 usb 1-1.2.6: Product: 802.11 n WLAN -> good

lsusb
Bus 001 Device 006: ID 148f:5370 Ralink Technology, Corp. RT 5370 Wireless Adapter

check if the wifi usb dongle is recognized.

 ----------/etc/network/interfaces-----------------
auto lo
 
iface lo inet loopback
iface eth0 inet dhcp

#auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

------------------------------------------------------------------

---------/etc/wpa_supplicant/wpa_supplicant.conf-----------
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
 
network={
        ssid="SSID"
        psk="password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP WEP104 WEP40
        auth_alg=OPEN
} 

network={
        ssid="SSID"

        key_mgmt=NONE


        auth_alg=OPEN
        wep_key0=1234509876 

} 

 
network={
        ssid="YOURSSID"
        scan_ssid=1
        key_mgmt=WPA-PSK
        proto=WPA
        psk="YOURPASSWORD"
}

--------------------------------------------------------------------------------------

Now enable the modem.
sudo ifup wlan0

On boot connection ------------- /etc/rc.local-------------add--
echo "Starting Wifi.."
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
sleep .5s
dhclient wlan0
echo "Wifi started.."

exit 0
--------------------------------------------------------------------------------------
**file names used exactly, it may vary
Disable power management of usb wifi dongle -- /etc/modprobe.d/*8192cu.conf
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

Ping router every minute on cron
crontab -e ---------------------add
*/1 * * * * ping -c 1 192.168.0.1 #modify this address to router address
--------------------------------------------

------------------to skip rc.local---------- plastikman 20130216---------
auto lo wlan0

iface lo inet loopback
iface eth0 inet dhcp

#auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
-----------------------------------------------------------------------------------------------


Sources: raspberrypi.org/phpBB3/viewtopic.php?f=28&t=47830
http://svay.com/blog/setting-up-a-wifi-connection-on-the-raspberrypi/
above are direct sources (i.e. copy+paste)

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6256&p=189260
 this is supplementary

No comments:

Post a Comment