Showing posts with label Ralink. Show all posts
Showing posts with label Ralink. Show all posts

Thursday, 10 May 2012

RT5370 - Cheap micro usb wireless dongle on R-Pi

(N.B. - Note @ 27/July/2012. - I just downloaded and burned the 'Wheezy' image from the Raspberry Pi site.  This works with the below dongle out of the box - you don't need to install the firmware, so you can start at step 6.  Image used 2012-07-15-wheezy-raspbian.zip)

I took a chance on the cheapest micro wireless dongle I could find on ebay (£4.50) (3/2/13 - Just got one of these for £3.89, and can confirm it works fine - seems to be the same as the one I originally used.   - The original supplier on Ebay put price up to something stupid! http://www.ebay.co.uk/itm/310574944823)  -  It worked very well in windows, but I really wanted it for the Pi.  It was relatively straightforward to setup.  Obviously you need a working connection of some sort to download the required files. - I did this by bridging my wireless connection on windows7 with the (otherwise unused) wired connection and plugging the Pi.

1. - The package firmware-ralink from the Debian Squeeze install doesn't work - it doesn't contain the right firmware.
2. -  edit /etc/sources - add in wheezy as a source instead of squeeze.

deb http://ftp.uk.debian.org/debian/ wheezy main non-free
###deb http://www.debian-multimedia.org squeeze main non-free

3. - sudo apt-get update

4. - sudo apt-get install firmware-ralink

5. - Before you forget, reverse the comments in sources.list so that you put it back to squeeze and run apt-get update for good measure.

6. - Plug in the wireless dongle.

7. - Should be able to see it in lsusb:-


Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter


8. - edit /etc/network/interfaces


auto wlan0
iface wlan0 inet dhcp
   wireless-essid YourEssID
   wireless-mode managed
   wireless-key xxxxx

9. - sudo ifup wlan0

If all has worked, we should now be assigned a wireless IP address, and can unplug the ethernet. - Reboot to test.

10. - I then wanted a static IP for this. - This is simply configured in interfaces:-


auto wlan0
iface wlan0 inet static
    wireless-essid YourEssID
    wireless-mode managed
    wireless-key xxxxx
    address 192.168.2.75
    netmask 255.255.255.0
    network 192.168.2.0
    broadcast 192.168.2.255
    gateway 192.168.2.1

Note that I'm using WEP here (because some legacy kit doesn't support WPA) - might be slightly different for WPA.