Raspberry Pi - How to connect Novatech Nano USB Wifi
Pre-requsites
- Raspberry Pi ( doh )
- working lan connection
- internet access to get and update packages
- Base RPI Debian image
So god knows if its going to work - let’s find out.
Hunting down the drivers
After hunting down the “User manual”(2) I found via a screen shot of a windows driver that it (apparently) uses a rtl8139 chipset and Debian supports that by default via the “realtek-firmware” package. Result! But no...
On plugging in the device and booting up the RPI it locked on the “Calling CRDA to update world regulatory domain” ( seems to be about a 3 min wait ) but then continues the boot up. But it doesn’t work.
So, I tried running
> lsusb
and the terminal hangs on the under the hood modprobe call - nice - not!
So, after killing the process I tried a different route via
> lsmod
rtl8192cu
rtl8192_common
rtlwifi
etc
…
and this told me that actually its a rtl8192c chipset not as per the manual - typical!
and
> dmesg
log proves that it is a realtek
usb 1-1-3: New USB device found, idVendor=0bda, idProduct=8176
...
usb 1-1-3: Product: 802.11n WLAN Adapter
usb 1-1-3: Manufacturer: Realtek
…
But
> sudo ifconfig wlan0 up
gives
wlan0: ERROR while getting interface flags: No such device
meaning driver has failed - damn.
Drivers don't work so get some new ones
After hunting around we find out that the realtek drivers in this Debian are out of date(3) so the way to fix this is as follows:
> sudo nano /etc/modprobe.d/blacklist.conf
and add a line to the file so:
blacklist rtl8192cu
Then, get a compiled version of the driver for ARM6 based processors from (4):
> wget http://www.electrictea.co.uk/rpi/8192cu.tar.gz
> tar xf 8192cu.tar.gz
> sudo install -p -m 644 8192cu.ko /lib/modules/3.1.9+/kernel/drivers/net/wireless/
> sudo depmod -a
Now reboot to for the settings to take effect:
> sudo shutdown -r now
wait for the magic...
Now, to confirm the new kernel driver has worked:
> lsmod - shows 8192cu working
> lsusb - also shows working and more importantly doesn’t fail and lock up anymore
> sudo ifconfig wlan0 up - to initialise the driver
> sudo iwlist wlan0 scanning - to check that the device can scan for local networks
now I get a list of local available networks - joy!
Working adapter - now to configure the connection
So, now working need to config to auto-magically reconnect to my locked down wifi each time it starts up, hence:> sudo iwconfig wlan0 essid <YOUR_SSID>
> sudo apt-get install dhcpcd - install a DHCP client daemon
> sudo dhcpcd wlan0
Now you can configure your interfaces file:
> sudo nano /etc/networks/interfaces
and add the following lines to auto start your wlan at startup as per (5):
auto wlan0
iface wlan0 inet dhcp
( for unsecured use )
wireless-essid <YOUR_SSID>
( fine for unsecured network but yours should be - if not WHY NOT!! )
wpa-ssid <YOUR_SSID>
wpa-psk <YOUR_KEY/PASSPHRASE>
> sudo ifup wlan0 - to bounce your configuration and now you should see a connection and an IP address
Success! We are connected wirelessly!
Hope this helps other people with the similar problems.
Additional - How to setup SSH access
Setting up an SSH daemon, RSA keys and connection is not as obvious as it could be so here goes...
> sudo bash
> ssh-keygen -t rsa
> <enter> <enter>
This will then save the required file and passphrase on you Raspberry Pi.
You’ll then be asked where you wish to save it, don’t type anything, just hit return
Do the same for the passphrase too, just hit enter.
A pattern will come up on the screen to confirm that a new key was successfully generated.
Your public RSA has now been created and we can activate the SSH.
To do this type this command to both enable SSH and configure to boot by default:
> sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc
Now shutdown and reboot to check its all worked.
> sudo shutdown -r now
At this point SSH is now ready to be used. To test first find out your current IP address using:
ifconfig -a
find IP address usually 192.16.1.X or 192.168.2.X
Connect with your favourite ssh client ( putty on windows )
And off you go!
References ( Correct as of 20120710 )
- http://elinux.org/index.php?title=RPi_VerifiedPeripherals
- http://www.addon-tech.com/new/system/uploads/USB_User%20Manual.pdf
- http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=5590&p=74678&hilit=realtek+rtl8192#p74678
- http://www.electrictea.co.uk/rpi/8192cu.tar.gz
- http://wiki.debian.org/WiFi/HowToUse