Category: Computers

Eject and the autamated cat feeder.

I was teaching a Linux system administration course last week at College of Engineering Chengannur. While  I was demonstrating openssh one of the participants logged on the my demo machine remotely and  ejected the cdrom drive with eject. He then asked me how to close the drive from command line. I said i don’t know. Today, I  searched the net for a solution and found out that eject -t can close the cd drive. ( eject has a couple of other interesting options . RTFM eject)

While searching for this information I landed on a funny project called automatic cat feeder. The cat feeder is built with ubuntu linux and this guy has made the most innovative use of eject utility. 😀
See the video.

Internet via BSNL WLL phone on Ubuntu

One of my students brought a BSNL WLL phone saying that it is not getting recognized on Ubuntu 8.04. The model of the phone was HTL Clarity ( I suspect it to be some Chinese phone). I plugged it into my ubuntu system and fonund out the usb id via the lsusb command. The id was 0x15eb:0x0001. This is what I did to get it working on Ubuntu 8.04.

a) Load the usb serial driver wiith the usb id parameters.

# /sbin/modprobe usbserial vendor=0x15eb product=0x0001

b) Load the ppp drive

# /sbin/modprobe ppp_generic

c) Check the dmesg output

#dmesg |tail

[  227.271459] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[  227.271485] usbserial_generic 2-1:1.0: generic converter detected
[  227.271616] usb 2-1: generic converter now attached to ttyUSB0
[  227.271627] usbserial_generic 2-1:1.1: generic converter detected
[  227.271687] usb 2-1: generic converter now attached to ttyUSB1
[  227.271697] usbcore: registered new interface driver usbserial_generic
[  227.271700] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial Driver core
[  276.412779] PPP generic driver version 2.4.2

d) run wvdialconf

#wvdialconf

This  will create a skeleton of /etc/wvdial.conf.

e) Edit the /etc/wvidal.conf so that it looks like the following
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = at+crm=1;+cmux=1;+cps=33;+cta=0
Modem Type = Analog Modem
ISDN = 0
Phone = #777
Modem = /dev/ttyUSB0
Username = #######
Password =  ####
Baud = 460800
Stupid Mode = 1
Auto DNS
Check Def Route

I have put # in the place of username and password inthe listing above. Generally, the username will be the phone number. If your phone no is 0471223344 putusername as 471223344 and the password as 3344  ( the last four digits of phone number).

f) Run wvdial  to connect  to Internet. Use Ctrl+C to colse the connection.

Installing OSS4 on Ubuntu 8.04

I have been provided with a new Lenovo ThinkCentre  M series machine  at my office. The machine has decent specs like Pentium dual core. 1GB RAM and 160GB  hdd.  It came preloaded with windows vista. As I use Linux , I partitioned the hard disk and installed  ubuntu8.04.  Unfortunately  sound is not working under Ubuntu.

I  looked at the  lspci output and found out   the following.

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
Subsystem: Lenovo Unknown device 100f
Flags: bus master, fast devsel, latency 0, IRQ 18
Memory at d0120000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Unknown type IRQ 0

A quick Google search for the card revealed several people reporting problems with ALSA, There are several workarounds reported. I thought of  installing OSS4. Here is what I did. ( I think OSS is gpl compliant now, I am not sure)

a)  I installed the following packages.

$  sudo apt-get install  oss-linux

You can also download the latest package from here

b) I use gnome desktop and for gnome utilises ESD for its sound interface.. I installed the following packages.

$ sudo apt-get install esound esound-clients esound-common libesd0 libesd0-dev gstreamer0.10-esd

c) Next  you have to prevent the default Alsa  modules from loading up. This  can be done via a file named

/etc/modprobe.d/blacklist

Execute the following on command line.

$ sudo chmod 776 /etc/modprobe.d/blacklist
$ sudo cat /lib/linux-sound-base/noALSA.modprobe.conf >> /etc/modprobe.d/blacklis

Please take a look at /lib/linux-sound-base/noALSA.modprobe.conf. It contains the modules to be blacklisted for ALSA.

d) I added the following additional lines to /etc/modeprobe.d/blacklist

blacklist snd_hda_intel
blacklist snd_mixer_oss
blacklist snd_pcm
blacklist snd_timer
blacklist snd_page_alloc
blacklist snd_hwdep
blacklist snd
blacklist soundcore

Now reconfigure the linux sound base.

sudo dpkg-reconfigure linux-sound-base

You will be prompted to select the sound system. Select OSS.
Now reboot the system. The system will load OSS drivers instead of ALSA

You can verify this with)

# ossdetect -v
Detected Intel High Definition Audio (ICH8)
Detected Generic USB audio device (BETA

The OSS  drivers can be loaded and unloaded using the commands

#soundon
#soundoff

You can launch a mixer with

$ ossxmix

If you are on gnome you can create a launcher with ossxmix.