Saturday, August 11, 2012

Importance of Using the Latest Wi-Fi Drivers

I've been working with some embedded devices implementing wireless solutions.  Initially I thought this process would be well known and easy to carry out.  It turns out that even today there are many challenges.

Wi-Fi has gone through a number of revisions of it's own ranging from 802.11g to n and lately extending to wireless mirroring: Mirracast.  Adopters of the Wi-Fi Alliance standards have had their challenges too.  You can find a list of supported wireless devices, such as USB, at linuxwireless.org.  But I haven't had much luck getting the one in my possession to work consistently on embedded.

Worse yet, OpenSSL is not working for me any more on strict secured corporate networks using PEAP authentication and MSCHAPv2 for inner authentication.  The problem is not limited to Ubuntu, a thread has been going on this year since April regarding the OpenSSL issue.  The latest Android 4.1 also shares this issue.

The Desktop Solution

Currently I back port my OpenSSL with the following:

After downloading the above you can run this script to install:

#!/bin/bash
echo "Replacing newer SSL libraries."
sudo dpkg -i libssl1.0.0_1.0.0e-2ubuntu4.2_i386.deb
sudo dpkg -i openssl_1.0.0e-2ubuntu4.2_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.0e-2ubuntu4.2_amd64.deb
sudo dpkg -i libssl-dev_1.0.0e-2ubuntu4.2_amd64.deb

Further Issues Crop Up...

Three months after solving this issue another one recently appeared where my wireless card connects to the corporate secured access point (mentioned above) but drops only a few seconds into browsing a page or when sharing a mouse with another computer using Synergy.  I can reset the connection like so:

sudo /etc/init.d/network-manager restart

However this just delays the inedible dropped connection.  I continue to check in on the latest OpenSSL issues but they still do not work.  As a result, I have decided to check out the latest work on linuxwireless.org and had some luck for a change (sort of).

I found that by installing the latest work from linuxwireless.org my connection appears to drop - just move that mouse around while on your Windows box - however this time the connection appears to reconnect immediately.  I can't say for sure what is going on other than Synergy breaks but there is no message about my wireless disconnecting and seconds later Synergy reconnects.

How to Build the Latest

Note: I offer no warranty to those who follow my steps.  You should probably know what you are doing.

First you will need to install the necessary libraries:

sudo apt-get install hostapd libnl1 libnl-dev python-m2crypto

Then download all sources:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git

git clone git://github.com/mcgrof/crda.git
git clone git://git.sipsolutions.net/iw.git
git clone git://git.sipsolutions.net/rfkill.git

The compat-wireless code may not be accessible from a direct link as it may be "anti-hotlinked".

wget http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless.tar.bz2

Then build each individual source code:

cd wireless-regdb
make
sudo mkdir /usr/lib/crda
sudo cp regulatory.bin /usr/lib/crda/regulatory.bin

cd ../crda
make USE_OPENSSL=1 clean

make USE_OPENSSL=1 all_noverify
sudo make USE_OPENSSL=1 install

cd ../iw
make
sudo make install

cd ../rfkill
make
sudo make install

cd ..
tar xf compat-wireless.tar.bz2
cd compat-wireless

You can view which wireless devices are supported by compat-wireless simple by following:

./scripts/driver-select

Then run the same script with your driver - in my case I used intel.

./scripts/driver-select [Your Wireless Device Here]
make
sudo make install

cd ..

It is recommended that you replace your old firmware with new firmware.  But before you do that make a backup!

# Backup your current firmware
tar jcf my-original-firmware.tar.bz2 /lib/firmware

Now override your old firmware with the latest firmware provided by the Linux git repositories.

# Out with the old and in with the new
sudo cp -r linux-firmware/* /lib/firmware

Restarting is probably the easiest way to make the changes take place.  Save everything and restart!

#sync; sudo shutdown -r now

Installing Lotus Notes for Ubuntu 12.04 x86_64

Bare in mind here that this is my first post using blogger.

Not too long ago I was working with my IT on installing Lotus Notes for Ubuntu.  The fact that they even had deb file was amazing.  Sadly, the targeted architecture was only 32 bit.  Doing some Goolging I found a few links with bits and pieces such as this one from IBM but the most help I found was from here.

Following the later link I have put together an installer script using the Lotus Notes deb package file which installs the package and installs the necessary 32 bit libraries.  You can find my script on Google Code.

There are still some occasions when the gtk decorator fails.  When this happens you loose the ability to move and resize all windows.  I know that it has something to do with menus being located on the top Ubuntu bar versus being located on the application window top bar.

The fix is simple for the gtk decorator.  Just run the following command:

compiz-decorator