WiFi and USB Keyboard issues on the Pi

October 14, 2012 at 4:35 am 2 comments

So up until today, I’ve been running the Pi on a CAT5 connection to my LAN (and by extension, the interwebs). It works fine, but since the HDTV I have it hooked up to is in another room from the router, connecting the Pi means slinging cable across the floor. Needless to say, this is not a great solution. I’ve been wanting to get it on the WiFi anyway to make it a bit more mobile (more on that later), so today I went out and bought a Belkin N150 USB WiFi adapter which was on the list of supported hardware for Wheezy (the Raspbian distro I’m using currently).

On the plus side, the Pi booted up no problem and the kernel found the adapter just fine. However, there was a glitch in the network configuration, just in case anyone else comes across this. Wheezy comes with a WiFi Config icon on the desktop to conveniently assist in getting the connection up and running. On first boot, the program detected wlan0 without any problem and then a “Scan” found my local network. So far so good. I put in the WEP key, and it seemed to try to connect but couldn’t make it happen.

So a quick reboot to see if there was some state issues with the device driver, and then the WiFi config tool was unable to find wlan0, reporting an error message “Could not get status from wpa_supplicant”. When you get this message, it means wpa_supplicant is no longer running, and is most likely crashing because the config file in /etc/wpa_supplicant/wpa_supplicant.conf has some issue in it. The issue in my config file was that the WEP key stored there was completely bogus and not in a format that the wpa_supplicant program could parse and use… so it just crashed instead. Replacing the WEP key with the actual key fixed the issue, and rebooting brought the wifi up, no fuss no muss.

Except now my keyboard really doesn’t work very well.

While I had the occasional dropped keystroke before, now it’s dropping 25% of whatever I’m typing, and sometimes deciding to hold a key down for some extra fun. Which makes the system pretty useless for anything that needs keyboard input, and VERY frustrating when you’re trying to diagnose the problem using the command line!

This is apparently a known problem, and after digging through the threads, it appears to be an issue where USB 1.1 and USB 2.0 devices are being used together. The keyboard is a USB 1.1 device, but the WiFi adapter is USB2.0. NUTS! The solution for now seems to be throttling the USB port down to USB1.1 speeds. To do this, follow these steps:

  1. Update to the latest firmware using rpi-update. Follow the instructions here on how to get rpi-update installed and how to perform the firmware update.
  2. Edit /boot/cmdline.txt to add “dwc_otg.speed=1” before the console definition. My cmdline.txt now reads: “dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 dwc_otg.speed=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait”
  3. Reboot

For reference, this was bodged together from the following discussions:

Now my keyboard types smooth as can be, so I’m really happy with the outcome, though it’s too bad so many people had trouble with this issue before it was resolved. I think that’s just an outcome from a wider exposure to the hardware and more people trying to do challenging tasks with the kit.

 

Advertisements

Entry filed under: Uncategorized.

Stepper motors and the Raspberry Pi Posted using Chromium on the Pi

2 Comments Add your own

  • 1. Greg Smith  |  December 24, 2012 at 5:33 pm

    What USB keyboard are you using? I’ve got 3 different ones, all three of them won’t work at all with dwc_otg.speed=1, even when the keyboard is the only thing plugged in. I’m looking for just one that works… See http://raspberrypi.stackexchange.com/questions/4090/how-can-dwc-otg-speed-1-be-made-to-work

    Reply
    • 2. ttongue2012  |  February 23, 2013 at 4:06 am

      I’m using a Logitech K260, and also an old apple keyboard (which is identified on bootup as being manufactured by Mitsumi). I haven’t come across a keyboard yet that has failed, and I’ve tried quite a few that people have brought in to the Raspberry Pi workshops. So I’m surprised you’re having so much trouble!

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Flickr Photos


%d bloggers like this: