Ralink RT 5370 Wi-Fi dongle on Raspberry Pi

June 18, 2013
Raspberry Pi


Please Note:
This post appears to be over 6 months old.

So as promised… How I got my Wi-Fi dongle to work with the Raspberry Pi.  I had a few requests off the back of my “Railo on Pi” post. This is bref, sorry.

I used a cheap £4.99 DIGITAZZ Wifi 802.11n WiFi dongle purchased from eBay. The adaptor uses the Ralink RT 5370 chipset. I found the firmware packages RT2800usb online and installed it.

Note: I was using Wheezy-Raspian image.

sudo apt-get install firmware-ralink

Once connected make sure you can see the device.

lsusb

Example output....

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
  Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
  Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
  Bus 001 Device 005: ID 04f3:0103 Elan Microelectronics Corp.
  

From this make sure you have installed the correct firmware package.

Next edit the following.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
  

I'm using WPA2 so your conf may look different. Appended/replace the configuration file as seen below.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  update_config=1
  
  network={
      ssid="YOUR SSID"
      proto=RSN
      key_mgmt=WPA-PSK
      pairwise=CCMP TKIP
      group=CCMP TKIP
      psk="YOUR PASSWORD"
  }
  
  

Now we need to include the above in network interfaces. Below is how my file looks in full. I added an internal IP address, I found this to be very important as my Pi did not auto assign one when on Wi-Fi. Maybe someone can clue me in on this?

sudo nano /etc/network/interfaces
  
# The loopback network interface
  auto lo
  iface lo inet loopback
  
  # allow-hotplug wlan0
  iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
  iface default inet static
      address 192.168.1.15
      netmask 255.255.255.0
  

Note: Wi-Fi does not start up automatically for you! When you restart you will need to type the following.

sudo ifup wlan0 
  

I know pain right? I use .SSH without a screen so its a hassle. You need to write a script! I'll blog on that another time.

That's all Folks!

Thanks for reading. Let's keep in Touch:
Follow me on GitHub or Twitter @glynjackson


Glyn Jackson is a Python Nerd, consultant and developer.


Find out more