Saturday, November 15, 2008

Answering a Patent Lawyer

There is an interesting article/thread on Groklaw on software patents. Those interested should check it out here.

Friday, November 14, 2008

HP LaserJet M2727nf

Been a long time since I posted something. We had a HP 1020 Laser printer, but considering the fact that we print a lot in our lab, the limited capacity of its cartridge increased our printing costs. Moreover we tend to print duplex, hence printing would consume a lot of time. On top of it, any mistake in manual duplexing would cause us to lose paper, time and toner. So finally we settled in for the HP LaserJet M2727nf the successor to the HP Laserjet 3390. The only drawback was the lack of scanning support in Linux unlike the 3390. But hoping that sooner or later hplip would include support for it, we ended up buying it. For scanning we would use Windows XP running under VirtualBox. The only problem we discovered (after buying it of course) was that although it supported duplex printing and copying, it would not support duplex scanning. The ADF does indeed do duplex while copying. It was therefore surprising that duplex scanning was not supported. It did not seem logical at all. Moreover this is not documented at all in the specifications. Any sane mind would think duplex scanning is supported as well.

Some days back I decided to upgrade my laptop's HDD to something more than the 120GB I had. So after installing Ubuntu 8.10, I just decided to check for the latest version of hplip. (Ubuntu came with 2.8.7). I was presently suprised to find in the release notes of hplip 2.8.10 that scanning was (finally) supported in Linux (through a plugin). So downloaded it immediately and installed it. Was also suprised to find that scanning in Linux was much faster than it was on Windows XP through the network interface.

While going through the Ubuntu repository, (which I generally mirror on one of the lab systems) I discovered gscan2pdf, and application that scans documents to PDF. There was also a Duplex option listed along with Flatbed and ADF. Not expecting it to work, I just tried scanning with the scan mode set to Duplex. Well did it work? ...

... Actually it did. I was able to scan both sides of the sheet. Looks like SANE really brings some sanity to scanning. Considering the fact that I recommended this printer, that scanning and that too Duplex scanning works sort of gives me (finally) some (more) bragging rights.

Update: It seems xsane also lists the Duplex option, but I somehow missed it.

Friday, October 3, 2008

Rantings of Mindless Men and the Decadence of a Great Civilization

I really did not have any intention to write this article. But I had too.The India I was born in seems to be changing. And the great civilization that once was India, seems to be fading away into decadence. Barbarism seems to be the order of the day, and sound minds letting the unsound minds to rule.
To those who wonder what I am talking about, well I am talking about the recent violence against Christians in certain states of India, specifically Orissa. There is a difference between the terrorist attacks in some parts in India, and the concentrated efforts to terrorize people of a specific community. In the case of the latter, the terrorized lose their homes and are in constant fear. I could have just left it as such, justifying it as the actions of a few uncivilized, uneducated barbarians who just do not know right from wrong.
But reading through the comments of readers at news websites, and also the justifications of right-wing politicians over this issue, I really began to wonder how anyone in a right frame of mind can justify what has and still is happenning in Orissa. No one can justify driving away people from their homes, burning and pillaging villages, and killing those who could not escape, definitely not in the name of any religion whatsoever. That the governments we elected could even tolerate such lawlessness, is indeed a national shame.

To those who seem to have lost their voice I would like to quote something:

First they came for the Communists, - but I was not a communist so I did not speak out.
Then they came for the Socialists and the Trade Unionists,- but I was neither, so I did not speak out.
Then they came for the Jews,- but I was not a Jew so I did not speak out.
And when they came for me, there was no one left to speak out for me.

And to those who have no conscience whatsoever, I would like to leave them with this thought:
An eye for an eye would leave the whole world blind.

Friday, September 19, 2008

Improving Signal Strength - The Easy Way

Well I found a simpler way to increase the signal strength. Just get a long USB cable and keep the device outside the window. In my case, the window is facing the nearest tower (around 2kms away). I did happen to notice one thing though. Although AT+CSQ indicated 31 (the maximum value), the signal strength indicator in the MS-Windows dialer indicates 3 bars, and sometimes 4.

Friday, September 5, 2008

Improving signal strength of EvDO/CDMA

I found a simple technique to increase the signal strength/reception quality of my EvDO connection from BSNL. The first requirement for this is to be able to get a numerical measure of signal strength which is more reliable than the signal bars indicated on the connection manager. Since I use Linux, I really have no way to observe the signal bars. So instead I wrote a script in Python that gives me the signal strength (power) in dB. I'll put it up when I feel it looks good enough to not be embarrased. Anyway, one could always use the "at+csq" command to get the signal strength. For more information look at one of my posts below.
CDMA in India uses the 824-849MHz band for uplink (mobile to tower/base station), and the 869-894 Mhz band for downlink (tower/base station to mobile). So the ideal center frequency is is 850MHz. Frequency (F) and wavelength (L) of electromagnetic signals are related as follows:
where c is the speed of electromagnetic signals or light, which is 29,979,245,800 centimeters per second. So the wavelength in centimeters is approximately 35.3cm. At L/4 (quarter wavelength), this works out to approximately 8.8cm. So one should just keep a plate or sheet of metal roughly at this distance from the antenna of the EvDO modem. In my case I first adjusted the device to provide maximum gain and then place the sheet.
The advantage of placing the sheet at quarter wavelength is that it need not be too big in size. Note that the antenna should be perpendicular to the modem and the sheet parallel to the antenna. The sheet could also be grounded if required. Using this sheet gave me an increase of 12dB in the signal strength from -67dB to -55dB. Use of the metallic sheet will most likely cause the reception to be more directional than earlier. So one could further adjust the orientation of the entire setup to increase the signal strength.

Those who are really desperate to boost reception could try out a quarter dipole antenna design at Note however that the design is for 435MHz. Length of the dipole will have to be modified for 850MHz.

ps: I have also come across people using CDs. Did attempt using them, but did not get a good enough gain. There is also no simple way to ground CDs. I am assuming that the value returned by "at+csq" query is reasonably accurate.

Monday, September 1, 2008

KPPP confused about kbps and KBps

It has been a long time since I used kppp (used to during those dial-up (pre-2004) days). Looks like kppp statistics is confused about kbps (kilo bits per sec.) and KBps (kilo bytes per sec.). Shows KBps as kbps in the logs. Confirmed using ifstat that it is actually KBps and not kbps. Seemed that I had observed this similar problem during the dial-up days. Could someone maintaining kppp please explain why this has not been fixed for so many years.

Sunday, August 31, 2008

BSNL EvDO finally ... sorry nope ... oops yes ... well maybe

Seem to be getting EvDO intermittantly. The maximum data transfer reached was around 400kbps. Strangely though the moment I get EvDO only when the strength is low (2-3bars). If I re-position the device for better signal strength (3-4bars) I get transferred to 1xRTT. When it shifts to EvDO, the indicator for roaming mode is also enabled. So I am assuming it is connecting to some other tower where EvDO has been properly configured.

Saturday, August 30, 2008

3G Signal Strength Indicator on Linux

Have not been able to find any signal strength indicator for 3G devices on Linux. So unable to measure the signal strength. However the 'at+csq' command can be used to find the signal strength. It returns a number between 0 and 31 (0 being minimum and 31 being the maximum strength).
The problem was how to convert it to power measurements (dB). Fortunately I found a solution to convert the numbers to dB measurements at .

Planning to write a script for displaying the signal strength in python.

BSNL EvDO finally ... sorry nope

With internet connectivity at my campus being unreliable and unsuitable for voice/video chat thanks to the proxy not responding frequently, and introducing long delays, I finally got an EvDO connection from BSNL. When I went there to the exchange to get the device, I found that it was configured as 1xRTT and not 1xEvDO. So sat with the engineer till he checked with the higher officials who were giving confusing answers, with some saying that EvDO is not yet enabled in India etc. But the engineer did not take it and finally managed to get through the right officer to configure it. Strangely it refused to detect a network when I got to my place. After another visit to the exchange, was informed of some configuration problems with EvDO. So currently got it reconfigured to 1xRTT. At least it works now. Was told it would be configured for EvDO once it was functioning properly.

Was able to get it up and running on Ubuntu/Hardy using the airprime driver. However could not get the same done on Fedora 7 and Fedora 9. Not sure how it works on other Linux distros.

Friday, August 22, 2008

BSNL EvDO in Hyderabad

Just happened to know that BSNL is (finally) providing EvDO in Hyderabad (atleast in some areas). Wonder why EvDO is being so poorly advertised. Just check with BSNL's Customer Service Center in your area to enquire about it's availability. You could either pay Rs. 3500 to own the USB modem, and pay monthly amount of Rs. 550/month for unlimited internet access or pay Rs. 1000 (security deposit) and 200/month as rental for the device. Bandwidth (download) upto 2.4Mbps is supported. does not have the updated tariff. So for the current tariff check

Tuesday, June 24, 2008

Connecting to Internet using Huawei C5320 - Part 2

Added two lines to the option.c file to enable support for C5320. Also built a patch file:
*** /usr/src/linux-source-2.6.24/drivers/usb/serial/option.c 2008-06-18 19:35:04.000000000 +0530
--- option.c 2008-06-24 10:56:41.000000000 +0530
*** 109,114 ****
--- 109,115 ----
#define HUAWEI_PRODUCT_E600 0x1001
#define HUAWEI_PRODUCT_E220 0x1003
#define HUAWEI_PRODUCT_E220BIS 0x1004
+ #define HUAWEI_PRODUCT_C300 0x3197

#define DELL_VENDOR_ID 0x413C
*** 158,163 ****
--- 159,165 ----
{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
Now just need to create a hal rules for the device.

Connecting to Internet using Huawei C5320 - Part 1

Well some things do not last long. I had to give my Huawei C2900i to the service center as something was wrong with the headphones socket. I decided to get the Huawei C5320 (white, I could not get the black) and give the C2900i to someone else. While the C5320 is more than twice the price of the C2900i and comes with a microSD slot, a 1.3mp camera and a basic mp3/mp4 player, I actually preferred the C2900i. This is because firstly I do not need a 1.3mp camera, and I actually prefer using my Fuji Finepix S5200 for any photography. Secondly I do not need an mp3 player since I already have one. And thirdly I do not need an mp4 player since I have a laptop. The C5320 misses one feature from the low-end C2900i; it does not allow voice recording of conversations. But I needed a phone which I could backup my sms' and phone numbers, and yes customize ringtones (though this is optional). Anyway, I plugged it onto my laptop hoping that like my C2900i it would be automatically recognised on Linux. A lsusb -v lists the device as Huawei Technologies C300 USB modem with device id : 0x12d1:0x3197.

By installing the device on Windows, I had discovered that it adhers to the USB CDC-ACM. So tried getting it the cdc-acm module on linux to load. But my attempts to get it to work were futile. The phone supports three modes of operation, an USB disk mode for accessing the microSD card, a Phone Sync mode to sync data between the mobile and system, including phonebook and sms's, and a third mode the data sync mode which enables the data modem. Strangely the cdc-acm driver would get loaded in Phone Sync mode, but display that it is not a modem.

The kernel modules typically loaded for the C2900i are option.ko and usbserial.ko. The option module is required since the usbserial.ko does not work well with GSM modems. So I decided to try my luck with these modules.
A "sudo modprobe usbserial vendor=0x12d1 product=0x3197" worked. I finally got a /dev/ttyUSB0 device. Connecting to the internet worked, but was a bit slow.

Connecting to internet on Ubuntu/Linux using Huawei 2900i

After having got a Tata Indicom connection, I decided to go in for the Huawei 2900i mobile as it was the cheapest mobile I could find with a modem. I could not find the data cable anywhere, so ended up ordering it online. The modem was detected as a Huawei E220 modem in Feisty. However once I upgraded to Hardy, ended up with problems as sometimes the device would be recognised as a USB storage device. This is because it is sort of a 3-in-1 device, a usb modem, a usb storage device and a CDFS (virtual CDROM).

Adding the following rules to hal, /usr/share/hal/fdi/preprobe/10osvendor/20-broken-usb-sticks.fdi did fix the problem.

<!-- Ignore the Huawei E220 USBHSDPA modem -->

<match key="@storage.originating_device:usb.vendor_id" int="0x12d1"> <match key="@storage.originating_device:usb.product_id"int="0x1003"> <merge key="info.ignore" type="bool">true</merge> </match> </match>

Once the modem is detected, then just setup a ppp connection using any ppp dialer, either Gnome PPP, KPPP or wvdial, with the following settings:
Username: internet
Password: internet
Phone Number: #777

Changing mobile service providers

I recently changed mobile my mobile service provider from Vodafone to Tata Indicom. The primary reason was lower STD calls (now virtually free Tata2Tata) . Earlier I used to run huge bills on my Vodafone Postpaid (enough to buy a mobile each month). Thanks Tata ;).