Kaffeine is a general purpose media player oriented towards supporting TV playing and recording. It has a very clear Electronic Program Guide which allows you to schedule any program to be recorded in the future and provides a guard band of -5 and +10 minutes by default. It is easy to search for channels and chose the ones you want. It will use any DVB-T USB stick which is loaded by the kernel or custom drivers.

Kaffeine is installed by the Synaptic Package Manager and searching for kaffeine – it is not in the Ubuntu Software Center as it is optimised for the KDE desktop but I prefer it to the simpler Me TV

You should also install dvb-apps using the Synaptic Package Manager or you will not have a list of local transmitters available for you to scan. There are 100 Digital Transmitters in the UK.

Kaffeine needs to have some configuration information before you can scan for channels and watch TV – you have to:

  • Plug in device so kaffeine knows there is a TV tuner available.
  • Run kaffeine
  • Select TV on right hand vertical tabs
    • Select Configure on horizontal tabs – it looks like a spanner
      • On general tab – update scan over internet
      • On Device tab – Select Autoscan from source or from the drop down list if you know the transmitter you are using.
    • OK
    • Select the Channels tab on bottom (looks like a screen)
      • Click Start Scan
      • When scan has finished you should have channels on the right
      • Use the buttons and check boxes to copy your selected channels to the left
      • OK
  • You should now be able to select a channel your channel to watch by clicking it

You need to install dvb-apps using the Synaptic Package Manager if you do not have a list of transmitters as noted above.

Kaffeine is reluctant to do another automatic scan if you change region often like we do on the boat. I have found you need to:

  • Plug in device
  • Run kaffeine
  • Select TV on right hand vertical tabs
    • Select the Channels tab on bottom (looks like a screen)
      • Click Clear at top of right panel (you must remove all the channels if you want to rescan)
      • OK
    • Select Configure on horizontal tabs – it looks like a spanner
      • On Device tab – Click Reset
      • On Device tab – Select Autoscan from source from the drop down list
      • OK
  • Quit kaffeine (this closing and opening is important if you want to rescan)
  • Open kaffeine
    • Select the Channels tab on bottom (looks like a screen)
      • Click Start Scan
      • When scan has finished you should have channels on the right
      • Use the buttons and check boxes to copy your selected channels to the left
      • OK
  • You should now be able to select a channel your channel to watch

If you do not carry out the procedure you can only update channels corresponding to the transmitter you are using. There may be several transmitters in you list and you have to tune to each one.

Mostly you can control Kaffeine by hot keys as well as the drop down menus and control icons under the channel list. F is important as it toggles in and out of full screen. G gives the Onscreen Guide which also allows you to schedule recording with a guard band either end.

The best way to find the nearest transmitter and its direction from an OS map Reference is Wolfbane’s UK digital TV reception predictor

You can also use a program called w-scan which can be installed by the Synaptic Package Manager to create a scan list suitable for Kaffeine – enough details to get one going are on the Kaffeine Forum at http://hftom.free.fr/phpBB2/viewtopic.php?t=178

I set up my two WordPress Blogs some time ago, one as a potential replacement for my ‘Diary of a Homepage‘ on the web site and the other for a ‘Club’ I belong to which needed a discussion area. Unfortunately I never documented what I did very well and I am now having to face up to updating from WordPress version 2.5.1 to version 3.0 . The newer versions have an automated update system but not going back far enough for me. WordPress is actually very well documented but it is lengthy and it is often difficult to see the wood for the trees. I had spent some time customising my blog with a theme and some custom styles to match the web site so I needed to get it right.

I followed their instructions on how to back up the databases on the server which use MySQL – they covered many of the common sorts of server software including Plesk which is used by by ISP Freezone. I have no idea if it is a valid backup without reloading it but at least I have a file.

I then backed up the rest of the files which reside in a single folder which, by default, is called wordpress. My own diary is all in a folder called diary. I renamed my local folder and used ftp to download a new copy with all my previous customisation carried out through WordPress.

I now downloaded the new WordPress version 3 as an archive and extracted it to replace the local folders (diary and wordpress).

You now need to replace parts of the new version before uploading otherwise you will lose everything you have done. This is all in the folder wp-content and the file wp-config.php so rename them in the new folder and copy in your old versions of the folder wp-content and the file wp-config.php. Unfortunately this also copies in some plugins which no longer work in the new version so you need to copy the new versions across now you know why you renamed the folder rather than deleted it! The folder you need to have the new version of is wp-content/plugins.

Before you upload the new version you need to log in as an administrator and remove all your existing plugins (in case they do not work) and I also went back to the default theme just in case. Standard widgets should be OK.

I deleted the on-line folder and uploaded the new one using gFTP and it all worked – the first time I logged in as an administrator it updated the MySQL database to a new format. I then changed back to my selected theme which was called Evanescence. I was lucky, some themes do not work under version 3 or need to be replaced by updated versions.

I then spent some time trying to find out how I had set up to use some of my existing css so the format matched my web site and found that I had added a lot of custom styles into the Evanescence Theme. You can edit the theme from within WordPress 3 when logged in as an administrator by expanding the left hand menu on the dashboard to reach Appearance -> Themes -> Editor and then Right Menu -> Styles and editing styles.css and print.css. I have added custom styles at the end of both to give my blocks of terminal code, terminal output, script code etc. The idea of duplicating these styles from my web site was to allow interchange of blocks of HTML without losing formatting.

This post is a check that everything still works

This Howto describes the steps necessary to use the Epson Perfection V200 Photo scanner with Ubuntu Hardy Heron. It is closely based on an excellent Howto in Uellue’s Blog.

Other Epson scanners should work in a similar way, there is a list of supported devices on the Epson web site below. The driver provides support for 8 bit and 16 bit color depth and 300, 2400 and 4800 dpi resolution when used by GIMP through Sane .

Firstly a number of Ubuntu packages need to be added via System -> Administration -> Synaptic package manager and Search for each package and Install it. The packages are:

  • sane
  • sane-utils
  • xsane
  • alien (a tool to convert the .rpm packages available to .deb packages for Debian and Ubuntu)

The drivers are available on the Epson Japanese vendor’s site. Choose your scanner and your distribution, fill out the small questionnaire and submit the form. You are directed to a download page. There are no Debian (.deb) packages but if you get the RPM packages for “gcc 3.4 or later” you can use utility called Alien to convert the packages to the .deb format in order to install them. In a terminal:

sudo alien –scripts iscan-2.8.0-1.c2.i386.rpm
sudo alien –scripts iscan-plugin-gt-f670-2.0.0-1.c2.i386.rpm

To install the generated .deb packages use dpkg:

sudo dpkg -i iscan_2.8.0-2_i386.deb
sudo dpkg -i iscan-plugin-gt-f670_2.0.0-2_i386.deb

Now plug in and switch on the scanner and use lsusb in a terminal which should show the scanner. The output will look like:

pcurtis@triton-ubuntu:~$ lsusb
Bus 004 Device 003: ID 04b8:012e Seiko Epson Corp.
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
pcurtis@triton-ubuntu:~$ ]

Now use the utilities from sane-utils in a terminal. First use sane-find-scanner to check whether Sane finds the device. With scanimage -L you can find out if the driver is properly installed. The output looked like this:

pcurtis@triton-ubuntu:~$ sudo sane-find-scanner

# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.

# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x04b8 [EPSON], product=0x012e [EPSON Scanner]) at libusb:004:003
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend’s manpage.

# Not checking for parallel port scanners.

# Most Scanners connected to the parallel port or other proprietary ports
# can’t be detected by this program.
pcurtis@triton-ubuntu:~$ sudo scanimage -L
device `epkowa:libusb:004:003′ is a Epson Perfection V200 flatbed scanner

Depending on your exact installation only root may have access to the scanner although my original user was already in the scanner group. To allow other users to access the scanner, they must be members of the scanner group. You then either need to reboot or restart udev after adding the extra members. The terminal output looks like this:

pcurtis@triton-ubuntu:~$ sudo adduser peter scanner
Adding user `peter’ to group `scanner’ …
Adding user peter to group scanner
Done.
pcurtis@triton-ubuntu:~$ sudo /etc/init.d/udev restart
Stopping the hotplug events dispatcher: udevd.
Starting the hotplug events dispatcher: udevd

It has also been reported by some users that a line has to be added to a sane configuration file – mine was OK and the line had been appended automatically but for completeness check and add a line containg epkowa to the end of /etc/sane.d/dll.conf if you have a problem.

After that my scanner works fine and can be accessed most easily via GIMP but can also be accessed directly by xscanimage or xsane.

The Medibuntu Repository is a third-party repository contains many useful programs which are not true open source, allows one to enable DVD playback and to add the codecs for MP3 playing and ripping etc. It can be included by way of a few quick commands in a terminal.

It is often much easier and quicker to use text input rather than a Graphical User Interface and even in Windows one has to resort to it for complex system work. A terminal is opened by Applications -> Accessories -> Terminal. The terminal is very basic, for example Ctrl C and Ctrl V do not work for cut and paste but unusually clicking the center button of a three button mouse will paste. Up and down arrows scroll through the last commands used. Do not try to type any of the commands just cut and paste in turn from this web page and then hit enter. If they start with Sudo you will be asked to enter your password. Try it on the following.

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

This will add the Medibuntu repository, import the Medibuntu GPG key and make the new packages available for installing using the Synaptic Package Manager access by System -> Administration -> Synaptic Package Manager.

Using the Synaptic Package Manager to add programs including those from the Medibuntu Repository:

The Synaptic package manager is similar to Add/Remove but at a lower level and used more for adding services than main stream programs although it will do so just as well – we could have used it for Thunderbird we are gong to be adding a number of library routines to for playing and ripping media files. The package manager is clever and every program in Ubuntu carries the information on its dependence on any other services and automatically downloads them, if required.

Open the Synaptic Package Manager by System -> Administration -> Synaptic Package Manage.

When the Synaptic Package Manager has opened use Search to find the package/program you want, click the box and click Mark for Installation each one. When they are all marked, click Apply. The following is the list I use whe setting up a machine.

List of packages to install using the Synaptic PackageManager for a versatile Home PC

  • You should enable DVD Playback by installing the following libdvdcss2 libdvdread3 libdvdnav4
  • You should add the non-free Media Codecs for mp3 etc by installing w32codecs and ubuntu-restricted-extras
  • You should add support for UDF format CD/DVDs used by some Windows programs by installing libudf0 libudf-dev udftools
  • It is worth installing the gxine DVD player as it has DVD menu support gxine
  • There are other Media Players without stripped codecs but read about them first to see if you need them (amarok, mplayer, ffmpeg)
  • Whilst you are in the Synaptic Package Manager you should also add Microsoft True Type Core Fonts for the Web by installing msttcorefonts
  • You should also install the Simple Backup Program and you might as well do it here as go back to Add/Remove sbackup
  • If you are on a network you may want to add command line utilities for synchronisation and secure archiving for the distant future unison-gtk ssh rsync

If you want to play commercial encrypted DVDs using the Totem Movie Player there is more information in Ubuntu documentation on Movies, DVDs and Videos

Installing proprietary Programs using the Medibuntu Repository in Hardy Heron

Medibuntu can not only be used to add music and video codecs but also to load commercial/proprietary programs which can not be made available directly in Ubuntu due to legal restrictions in some countries. Use the Synaptic Package Manager and Search for the program you want. The list of programs possible includes:

  • Adobe reader acroread and mozilla-acroread
  • Google Earth googleearth-4.2 or googleearth-4.3
  • Skype skype
  • Real Player realplay

In most cases they will be added to your “Applications” menu.

If you load GoogleEarth its performance may be improved if one disables the atmosphere rendering by: View -> Atmosphere -> untick

If we are going to use a shared drive for data then we must ensure that it is permanently mounted. The mounting points in all major flavours of Linux are defined in /etc/fstab and and the convention is that the mount points are in /media. We therefore need to set modify /etc/fstab to set up to mount points in /media and we must also create the directories for them using sudo to make them owned by root and set the permissions so they are accessible to all users – I cheat and open the file manager in a terminal by using gksudo nautilus to allow be to use a GUI to create the directories and set permissions. It is best to make these directories identical to those created by mounting from ‘Places’ which is derived from the partition label if it is set – see below. The procedure for modifying /etc/fstab is the same as it was for Dapper except that it is now recommended to use the drives UUID rather than the device’s location ie append lines to /etc/fstab looking like:

# /dev/sda1
UUID=F006-E8EA /media/SYSTEM vfat iocharset=utf8,umask=000 0 0
# /dev/sda5
UUID=706B-4EE3 /media/DATA vfat iocharset=utf8,umask=000 0 0
# /dev/sdb7
UUID=EEC0-FA2D /media/SHARED vfat iocharset=utf8,umask=000 0 0

Note – these strings are for FAT32 partitions and differ for NTFS partitions for which two examples follow, the first of which I have used:

# /dev/sda7
UUID=ABCD-EFGH /media/VIDEO ntfs nls=utf8,umask=0222 0 0
# /dev/hda8
UUID=ABEF-CDGH /media/VIDEO2 ntfs defaults,locale=en_GB.utf8 0 0

The UUID can be found by typing sudo blkid in a terminal – typical output looks like:

pcurtis@dimension-ubuntu:~$ sudo blkid
/dev/sda1: LABEL=”SYSTEM” UUID=”F006-E8EA” TYPE=”vfat”
/dev/sda5: LABEL=”DATA” UUID=”706B-4EE3″ TYPE=”vfat”
/dev/sdb5: TYPE=”swap” UUID=”b7c865a1-e4b6-447f-a89b-0b4deb3ba302″
/dev/sdb6: UUID=”731adef2-0cdf-44c0-b6e1-006a90a14949″ TYPE=”ext3″
/dev/sdb7: UUID=”EEC0-FA2D” TYPE=”vfat” LABEL=”SHARED”
pcurtis@dimension-ubuntu:~$

After modifying /etc/fstab and rebooting the three Windows Drives are mounted and appear on the desktop in addition to being in ‘Places’ – they can not be unmounted without root privileges which is just what we want.

The Trackpad fitted to most of the MSI Wind U100s is from Sentelic and there are no dedicated drivers available within the kernel – it is in theory possible to take a driver available fro Sentelic, recompile the kernel with a patch to include it and compile a control panel to give control over the pad but this is beyond most users and would have to be done every time a kernel update was available which would be a nightmare.

The Sentelic trackpad however offers most of the facilities normally expected and needed such as:

  • Curson movement
  • Tap to ‘click’
  • Tap and hold to drag
  • Tap at top right corner to scroll up
  • Tap at bottom right corner to scroll down

The main problems are:

  • The trackpad is very sensitive and there is no way to turn off tap to click so it is easy to moving ones typing point when entering text.
  • There is no scrolling by movement down the right side as on the Synaptics Track pad because Synaptics have patented that feature, the taping of sensitive areas is however a good substitute.

The simplest way round random movements when entering text is to use an external mouse and toggling the touchpad off by Fn F3.

I have however tamed the touch pad by use of a simple utility called mouseemu which was initially written for use of single button mice on the Apple. Mouseemu enables one to:

  • Inhibit the tap to click for a period after keyboard input which gets rid of the worst problems of accidental clicks.
  • Have a very smooth and controlled scroll by holding down the left or right Alt key (or any chosen key) whilst moving a finger up and down the pad

Mouseemu can be installed by Sytem – Applications -> Synaptic Package Manager and Searching for Mouseemu

It needs a file to be configured to enable the two features by

sudo gedit /etc/default/mouseemu

Remove the # in front of the SCROLL and TYPING_BLOCK entries

Set the delay before the tap becomes active in TYPING_BLOCK – I use 1500 for a 1.5 second block

Change the SCROLL value to 100 instead of 56 if you want to use the AltGr key instead of Alt. I prefer Alt as it can be held by a left finger whilst scrolling with a right finger but some programs such as Firefox use Alt

I have now quite got to like the Sentelic touch pad when using the Wind on my lap but I always prefer to also have a mouse available when I have the space to use one.

I tried the various suggestions in Ubuntu Hardy Heron 8.04 Installation and Post Installation Guide and Tweak which are otherwise very useful documents but I initially ended up with an almost unusable system which had no sound, froze on videos and would not mount USB drives at startup. I had to reloaded from scratch, 3 hours lost as it was an almost complete configuration. At the time I blamed this on the changes I had made to get sound back after a suspend but have since found it was probably a different cause related to pulse audio as I was using the exaple files for tests which also used video. This must be sorted out before proceeding to do a lot of audio and video tests.

Fixing freezes due to Pulse Audio

Disable pulse audio by Preferences -> Sessions and untick Pulse Audio Session Management

Fixing Suspend problems caused by power saving modes.

Next one should carry out the modifications to reduce the agression of the hard drive power management as are required to reduce drive clicking. That has already been covered and you may have done it. If you have not done so go back and do it – it seems to be essential to carry it out before any experimenting with Suspend. After the power management has been done suspend will probably work reliably but there will be no sound and possibly USB will be unreliable. Note I have turned off the advanced drive level power management completely (setting 255 rather than the recommended setting of 192 – I do not know if that is significant to Suspend)

Fixing Sound after a Suspend.

This is because the sound driver is set up to a default automatic mode which should pick up settings from the BIOS which does not work after a suspend. One therefore needs to add a parameter to the sound configuration file /etc/modprobe.d/alsa-base for snd-hda-intel to tell it what to use. The choice is not simple as there is no setting for the Wind and there are about 20 choices – two are given as Targa/MSI however and I tried both – the setting which worked was targa-2ch-dig

sudo gedit /etc/modprobe.d/alsa-base

At the end of the file, paste the following:

options snd-hda-intel model=targa-2ch-dig

This fixed sound but all the settings have to be set up again by double clicking the volume control. You may need to play to get all the levels right.

Fixing USB problems after a suspend

This change makes sure that all USB devices come up properly after a suspend. It is documented in the thread USB devices dead after sleep/hibernate and other places. This change makes sure that the ehci-hcd USB driver is handled correctly by adding to the list of modules covered during a suspend. The proceedure is to do the following in a termina for Hardy Heron isl:

echo SUSPEND_MODULES=”ehci-hcd” > /tmp/unload_modules
chmod +x /tmp/unload_modules
sudo mv /tmp/unload_modules

This only works if there is no /etc/pm/config.d/unload_modules file already – if it exists then it should be edited and

SUSPEND_MODULES=”ehci-hcd”
added to the file. Check using the file browser

End result

I now suspend all the time and have had no problems with sound or connected USB devices coming back up.

I initially got Wifi set up using a .deb file but in my messing around I broke it. I set it up on the earlier kernel the hard way by making a driver as per the Wind User Wiki but nothing I could do made it start automatically on the latest kernel and a dmesg showed dozens of errors. So back to building drivers the hard way again.

The reason we have to build the drivers is that they need information on the exact version of linux you are running and they need to be rebuilt for every version so when you get a new version in your updates which is significant enough to have a new Grub loader entry you will need to rebuild the drivers which is a pain – that is why most of the common drivers are already included in the kernel update. The drivers are written either by the device manufacturer or by enthusiasts if no linux version is available and are in a uniform format to make use easy. In some cases they may need so fine tuning for a particular machine and they are then refereed to as a fork as the basic updates are lost until a new ‘fork’ is created. That is the case for the Wind Wifi driver which needed a couple of minor changes to compile and run on the Wind hardware, for example, machines differ in how the Wifi is turned on and off (Fn Key versus switch etc) . The fork has been created in the last few weeks by Coffelius and is also the basis of the .deb file I first used initially.

The following is what I did on the older kernel version 2.6.24.19 where there was no .deb available – it worked perfectly and started every time the machine booted up. It assumes the driver download is called rtl8187se_coffee, this case it was a fork from the standard rtl8187 driver (‘fork’ version 4) by coffelius downloadable from http://code.google.com/p/msi-wind-linux/ – there is a lot of extra information on that page and has the links to debian installer and install scripts which are further discussed in the Wind Forums .

sudo apt-get install build-essential
sudo apt-get linux-headers-`uname -r`
tar zxf rtl8187se_coffee.tar.gz
cd rtl8187se_coffee
./makedrv
sudo cp -r ieee80211/*.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
sudo cp rtl8185/r8180.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/

sudo rm -rv /lib/modules/`uname -r`/kernel/drivers/net/wireless/rtl8187.ko
sudo rm -rv /lib/modules/`uname -r`/kernel/net/ieee80211
sudo rm -rv /lib/modules/`uname -r`/ubuntu/wireless/rtl8187-usb

sudo modprobe -r r8180
sudo depmod -a
sudo modprobe r8180

Now a brief explanation of what is being done.

The first line install two utilities into your system which are used in the building of the utilities. This is a once off activity but it will tell you if they already exist.

The second line fetches the information about your kernel so exactly matching drivers can be built. This is needed for each new kernel version but again it will not cause problems if you do it an extra time.

The driver comes as a compressed archive which is in a standard format and when extracted creates a subdirectory of where it is run with the same name which contains all the files needed to create the drivers and some scripts to help create and ‘install’ the drivers which assume they are run from within the same folder. That is why we needed to get the latest ‘headers which contain the information needed to build a driver specific to your version.

We now change to the directory containing the extracted files so we can run the script.

The script makedrv now compiles the actual drivers we need based on its own data and that in the linux kernel header file. What we end up with are local copies.

The next two lines copy them to the standard places on the machine. The `uname -r` is replaced by the current header when the line is used in a terminal. Note they are back quotes which are at the top left of the keyboard. You can find out the header by typing just uname -r in a terminal. [There is also a script which could be called by ./install with many drivers to do this but it assumes standard places and the original forum postings did not use it, perhaps because the positions are non standard. ]

The next block of lines of three lines should be used with caution – they remove all the other versions of similar drivers on the machine – see the footnote as to why this is required. I have included them in case I ever turn this into a script. An alternative way is to rename all the files ending in .ko in the folders above to .kop so that they can not be found by depmod -a when it is called below. You can use gksudo nautilus to run a GUI filehandler as root to make the destruction easy.

The next line makes sure that any existing versions are removed which prevent the new driver being installed.

The next line sets up the dependences for the automatic install every time the machine starts.

And the final line both loads the drive and makes the driver available for when the machine starts up.

As stated before this procedure should be adequate for a one off install on a fresh kernel version and worked perfectly on kernel version 2.6.24-21-generic for me without the file deletions. The equivalent via a .deb worked until I messed something up trying to sort out other drivers for the Webcam which must have changed the order that depmod picked up the files. I spent a long time experimenting and investigating and now know a lot more about the relevant terminal commands modprobe, lsmod, dmesg, modprobe -l and finally the one that gave the game away modinfo. Many produce a lot of output and piping to grep to filter it is useful to try dmesg | grep 81 which will find all lines in the main log with an 81 in them.

Whilst trying to sort out the problem which has been reported by many people I discovered that the folder with the drivers contains two scripts to start and stop Wifi from the terminal and I found I could start Wifi on the latest kernel by using the script wlan0up and stop it with wlan0down. Note they have to be run from within the same directory.

I initially did a quick and dirty fix to avoid having to run a terminal command as root every time by setting up a script to implement the above scripts and run it every time at startup. The system runs many system scripts at startup and on Ubuntu they are run by symbolic links in the /etc/rc2.d folder (for normal startup at run level 2) to scripts generally kept in the /etc/init.d folder. I did not put the script in the usual place nor arrange it to have standard startup and power down interfaces.

I adding an extra symbolic link to my own script WifiStart by opening a terminal window and typing

sudo ln -s /home/pcurtis/bin/StartWifi /etc/rc2.d/S99wifi

The script file StartWifi, needs to be owned by root and with permissions set up for everyone, I found the easiest way to create this was to use the file browser nautilus but opened as root by typing

sudo nautilus

in a terminal window. I then right clicked in the home directory and created the folder bin, opened the folder and then created the file StartWifi and immediately right clicked to properties and the permissions tab where I set read write and execute for everyone. I then double clicked to open it and selected edit to add the contents and then saved it.

#!/bin/bash # Check that we are running under the correct kernel kernel=`uname -r`
driverkernel="2.6.24-21-generic"
if [ $kernel = $driverkernel ]
then
# change to directory where the driver was initially made
cd /home/pcurtis/rtl8187se_coffee
# Run script to stop wifi and unload drivers from the kernel in case they are still present
/home/pcurtis/rtl8187se_coffee/wlan0down
# Now install the drivers into the kernel and start the Wifi running
/home/pcurtis/rtl8187se_coffee/wlan0up
fi

Note that I have a check to make sure it is only run on the problematic kernel – it would insert the wrong drivers on other versions.

Note that this is going to be run by root at startup so the sudo is not needed. I chose ~/bin as the home as this was a quick fix and ~/bin is the normal home for user scripts. If you do it properly and use /etc/init.d as the directory the script ought to implement start, stop and resume parameters which is extra work. One last thing to remember is that the file must be given permissions for execution by everyone including root by

chmod x ~/bin/StartWifi

I hope all this will not be needed by anybody but it may give hints as to how to get round problems as well as an insight into the need and implementation of building drivers. You can see basically the same initial job was needed in my posting on Webcam drivers.

Then I found the solution which has been fed back into the above but the following cautionary note gives an understanding of such problems may be useful to others

A cautionary footnote on Wifi and other drivers.

I am begriming to understand how the driver installation has been going pear shaped. First one needs to know that all the modules which are available are .ko files and depmod -a is run every time the machine boots up. This recreates the dependency tree and satisfies it by searching all the standard areas for .ko files. So we have great scope for problems if the system has a driver in place as well as the driver we are loading and they use the same file names because they come from the same original source – this means that we can have our new driver having its dependencies satisfied by an old file if depmod finds it first. I have been trying out modinfo which I had read about and found that at least on of the new drivers dependencies is being satisfied by a similar file in an ubuntu folder – this crossing of files must have been leading to all the error messages and I can now see why some of the scripts I have seen delete other folders, I had renamed some as a precaution but that did not stop the automated search. You will see the problem if you do a Find Files using the panel tool for ieee80211*.ko and you will find that versions exist in several places, there should be versions in each kernel but not two in any kernel.

I have not yet backed up and/or renamed all these files yet but it is nice to have found a likely source of the problem. The current solution works by forcing a new set of drivers every time by unloading the old ones from the kernel and reinstalling my new ones. If it aint broke don’t fix it! especially when we need the machine shortly.

In the longer term I wonder if one should install into the standard ubuntu locations. Either way I wonder what other devices depend on these files, I use a USB Wifi dongle at times which is more sensitive than the little built in ones and I do not want that to lose its drivers.

Footnote 2

I finally renamed all the duplicates in the ubuntu directories to .kop and everything seems to now be working as one would expect. I have fed the changes which are required back into the procedure. I have also verified that it has not stopped my USB dongle being detected and I can turn off the onboard wireless and plug in the dongle at which point the network manager gives me two Wifi interfaces to choose from which is perfect.

I have a further concern and that is that a kernel update or patch of a very minor type which would not require an update of the drivers ie 2.6.24-21.43 to 2.6.24-21.47 may mean that all the old driver files return to haunt us, I wonder if that is what initially killed my system? I will keep my startup script in place but doing nothing just in case, or perhaps do an automatic deletion of all the files at every re-boot – it would be quicker than unloading and loading all the wifi kernel modules!

This does not work at present on the Wind U100 as the driver in the Linux kernel 2.6.24.19.21 is an early version and nobody has provided a replacement in an easy to use form and that I understand what it is doing – I was not happy with the procedures in the Wind Wiki. I eventually found a write up on UVC Support in Ubuntu which made some sense and I used it to set up the Web Cam in the following way. It is not detected by Skype until I discovered that it has to be on when Skype is fired up rather than turned on latter. It also displays perfectly in a picture and photo grab program called ‘cream’ I found was recommended for tests.

UVC Stands for ‘USB Video Class’. It defines video streaming functionality on USB. UVC compliant peripherals should only need a generic driver. The GNU/Linux UVC Generic Driver Page is at http://linux-uvc.berlios.de/ and includes a list of supported devices including the Bison camera in my Wind U100 (but MSI change peripherals on occasion so check). There is a UVC module in Hardy Heron so some webcams ‘just work’ but most, like the Bison in Wind, need the latest version. This currently requires one to download a driver from the site above and build it. The procedure in detail is:

Install two utilities which are needed to build drivers if you do not have them – trying a second time does not cause a problem

sudo apt-get install build-essential

Install subversion if you do not already have it by:

sudo apt-get install subversion

Then get that latest source from the Berlios UVC subversion repository with:

svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

This will create a folder called ‘trunk’ containing the source in your current directory (/home/username)

You now need the kernel header files package specific to your CPU architecture, for example, linux-headers-2.6.24-43-generic . You can use uname -r to get the current version like this (Note they are back quotes, it is easiest to cut and paste otherwise they are at top left of keyboard):

sudo apt-get linux-headers-`uname -r`

Navigate to the ‘trunk’ directory containing the source and run make:

cd trunk
make uvcvideo

Ubuntu is non standard and keeps the kernel module for UVC in /lib/modules/your kernel/ubuntu/media/usbvideo and the makefile which has been created has to be edited slightly to install to the correct directory. Open the the makefile in a text editor:

sudo gedit Makefile

and search for and change

INSTALL_MOD_DIR := usb/media

to

INSTALL_MOD_DIR := ubuntu/media/usbvideo

then run

sudo make install

Update dependencies using depmod

sudo depmod -a

Unload the original modules by

sudo modprobe -r uvcvideo

Plug in your camera and enter the following command to insert the new modules:

sudo modprobe uvcvideo

and it should all be working. You can test it with cream and then Skype. Remember to turn on the Webcam before running skype otherwise it will not detect it. The red light only comes on when the camera is in use, not when it is turned on. You can use lsusb in a terminal to find out if it is on. If it is on you will see Bison in the list of devices – if not do Fn F6 and try again.

When you download CD and DVD images it is prudent to check that they have no errors before and after making the CDs. Parted Magic provides an md5sum checksum to enable one to determine if there is even a single bit error, I tend to check after the download and after burning a CD. This is very easy if one is using Linux as there is a command you can run a terminal to produce it. The following examples assume a CD and a file on the desktop.

md5sum -b /dev/cdrom
md5sum -b ~/Desktop/temp.iso

It is also very useful to be able to turn a CD/DVD into an ISO file which can be burnt back to make an exact copy of a CD rather especially for bootable CDs (LiveCds)

The following sequence of terminal commands does that:

sudo umount /dev/cdrom
dd if=/dev/cdrom of=/home/pcurtis/Desktop/temp.iso

The file temp.iso can be burnt by right clicking temp.iso on the desktop and choosing open with “Brasero Disk Burning” after inserting a blank CD or DVD. The CD should again be checked by

md5sum -b /dev/cdrom

The above cloning technique is ideal for making the single backup allowed of most proprietary systems and for distributing Open Source software.