Getting a Huawei EC159 USB Modem working on Ubuntu 11.04

The EC159 just like any USB modem gets detected as a USB mass storage or virtual CD-ROM when connected to Linux boxes. Yes, usb-modeswitch should take care of this and make it available as a GSM Modem. Unfortunately, the usb-modeswitch configuration skips this particular device, and that’s what I felt.

I decided to run usb-modeswitch to manually configure the modem by the following steps:

1. Get the latest release of usb-modeswitch

2. Build and install it.

3. Plug in the modem and run lsusb. Note down the vendor ID and Product ID.

For example:  Bus 002 Device 002: ID 8087:0020 Huawei

The vendor ID is 0x8087 and Product ID 0x0020

4. Run usb_modeswitch -H -v <vendor ID> -p <product ID>

5. Now modeprobe using the same vendor and product ID

sudo modprobe usbserial vendor=<your’s here> product=<your’s here>

6. Your device will start working like a charm!

Do let me know in the comments if you are stuck.

The weird behavior of Pidgin!

This is not the first time I’m using Pidgin. But this is for the first time it behaves pretty weirdly. The reason goes like this:

Whenever I login to my google account via xmpp using the Pidgin, I can see myself online in the buddy list! Whao! What more? During logging in, it pings libnotify and notifies me that “Sajjad is Online”, with a nice pic of mine, smiling at me!

pidgin1 pidgin2

Problem started after a recent upgrade. For the sake of account, the pidgin version is 2.6.6

Create a list of installed packages and install them later.

I was about to run a wipe out of my Ubuntu Karmic and fix Lucid into it. Really wanted to backup the list of installed packages and found this damn cool feature from dpkg.
Just type

dpkg --get-selections > filename

All the installed pacakges will be listed in the file.
Later, you can do

dpkg --set-selections < filename

and run dselect to install all the packages back.

ICS Ubuntu, Simplified.

We have a good WiFi enabled Internet campus. Unfortunately, one of the Ubuntu Lucid installations in a Dell Inspiron did not detect the WiFi controller. The last resort was to get an ethernet cable with Internet connection to activate the driver. We asked google and found out perhaps the best solutions to do ICS (Internet Connection Sharing) with Ubuntu here.

I would brief the steps taken so that anybody can get this done very quickly.

Our situation is different from that described in the above document.

Server connected to Internet via wlan0.

Client connected to server via eth0.

You have to make sure no changes to networking has been done since turning on both the computers. If any, you would have to restart both of them.

Server side configuration.

  • Connect the computer to wlan0 and make sure the Internet access is available.

Start a terminal and do the following to configure your network card and NAT.

  • sudo ifconfig eth0 192.168.0.1
  • sudo iptables -A FORWARD -i wlan0 -o eth0 -s 192.168.0.0/24 -m conntrack –ctstate NEW -j ACCEPT
  • sudo iptables -A FORWARD -m conntrack –ctstate ESTABLISHED,RELATED -j ACCEPT
  • sudo iptables -A POSTROUTING -t nat -j MASQUERADE

These settings will be cleared when you reboot the system. If you want to set it up permanently then:

  • sudo iptables-save | sudo tee /etc/iptables.sav

Edit /etc/rc.local and add the following lines before the “exit 0” line:

  • iptables-restore < /etc/iptables.sav

Enable routing:

  • sudo sh -c “echo 1 > /proc/sys/net/ipv4/ip_forward”

Edit /etc/sysctl.conf and add these lines:

  • net.ipv4.conf.default.forwarding=1
  • net.ipv4.conf.all.forwarding=1

Client setup:

Disable networking

  • sudo /etc/init.d/networking stop

Give static IP address.

  • sudo ifconfig eth0 192.168.0.100

Configure routing.

  • sudo route add default gw 192.168.0.1

Configure DNS Servers.

  • Open /etc/resolv.conf in the server and add the contents to resolv.conf of the client.

Open /etc/dhcp3/dhclient.conf and add:

  • prepend domain-name-servers 208.67.222.222,208.67.220.220;

Restart Networking:

  • sudo /etc/init.d/networking restart

You are good to go!

Note: If you are in a proxy network make sure to apply the proxy settings to the client also.

My first bug report on Ubuntu Lucid

Last day while me and Arky were fixing Ubuntu Lucid into some computers to be used by blind people, it came into our notice a very simple bug. These people depend on Orca Screen reader to make their way into computing. Unfortunately, at times, Orca crashes and they require to restart the X server to get in place. This was easy for them to press Ctrl + Alt + Backspace and then come back to the working environment.  But, in Lucid, after killing and restarting X server, gdm prompts for password to be keyed in, which is not desirable for these differently abled people.

The bug report is here

HP LaserJet P1505 on Ubuntu Karmic

We recently bought a HP LaserJet P1505 printer and I was eager to try it out in my Ubuntu Machine. When I plugged in, a simple pop-up came in asking for my permission to download the hp plugin for the printer. I hit the yes button and, there you go the printer is ready. But neither of the prints came out. I was confused and ran a google search. After some hacks I got it working.

Follow these steps :

  1. Remove the currently installed foo2xqx driver from your ubuntu synaptic manager
  2. Do:  wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
  3. Unpack:  tar zxf foo2zjs.tar.gz
  4. cd foo2zjs
  5. Compile: run make
  6. Get extra device dependent driver ./getweb P1505
  7. Install: sudo make install
  8. Restart cups: sudo make cups
  9. Plugin the printer to USB and turn it ON.
  10. You are now good to go.

Rendering Maps: A quick how-to

After a bit of mapping at the Technopark, we planned to render the map offline. This being a step towards the Fort Cochin Heritage Walk Mapping. So, I banged into the #osm channel on irc.oftc.net with the question, the first answer was Mapnik. But Mapnik, essentially, requires you to generate the Postgresql database instance out of the .osm file using osm2pqgsql or osmosis.
But, the quick method is to use Osmarender. The following steps would let you render a good .osm file into a map.

  1. Dowload the xml or .osm data subset of your area of interest.
  2. If you do not have installed subversion system, type sudo apt-get install subversion
  3. Now, you need to get the latest source files of Osmarender, for that type  svn checkout http://svn.openstreetmap.org/applications/rendering/osmarender/
  4. cd to the directory. Probably cd /home/<user_name>/osmarender/
  5. Type  apt-get install xmlstarlet
  6. Now, call the magic!
  7. Type xmlstarlet tr ~/osmarender/xslt/osmarender.xsl  -s osmfile=<file_name>.osm  ~/osmarender/stylesheets/osm-map-features-z17.xml  > <destination_file_name.svg>
  8. You’re done!

Now you should get an svg of the map. I got something like this by tweeking the stylesheets a bit

Map
Map

You can further make additions to the stylesheet files and adjust the parameters to suit your needs. More information is available at the Osmarender wiki.

The “Weird” problem in Ubuntu Karmic.

Despite of the pulling head ache, I am sitting down to brief the “Weird” problem in Ubuntu Karmic. The key icon of this story is a Dell Studio 14 laptop. My friend recently bought it, and on our special interests, agreed to change over to Ubuntu Karmic. Well, the installation went very well, happy, all well. Installed required packages. But unfortunately, no sound.
But I had similar experiences with an HP Pavillion and Toshiba laptops, hence thought, few simple hacks might get the audio up.
Started with trying volume levels of ALSA. Checked for any conflicts between ALSA and Pulseaudio. Upgraded ALSA. Still, no sound. Edited alsa-conf as per a how-to from help.ubuntu.com. But still could not get the sound up. Switched to #ubuntu and #alsa on freenode. Resorted to their help. After 6 hours, #ubuntu defined as the “weird” problem. Test, diagnostics, everything seemed to be positive. But still, no sound. Would update more regarding this here.

Wired Networks not managed in your Ubuntu?

I have been having this trouble since I started to use my Internet connection using pppoeconf package. The thing is that, pppoeconf turns out to disable or override all other wired network.
This is the way to get it back in place:

1. Fire a terminal.
2. Type sudo gedit /etc/NetworkManager/nm-system-settings.conf
3. Now you should see something like this:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

4. Change ‘false’ to ‘true’
5. Restart.
6. Comment this post, whether this helped you or not.

You’re done!

Getting Pidgin voice video working on Karmic

Recently, I upgraded to the much awaited Karmic Koala from Jaunty. Experience with Jaunty was not so sweet. Anyways, thought to give a hand on Koala. Upgrade went successful. The only problem remaining was that I could not start voice or video chat using Pidgin. Koala comes with Empathy as the default client. But I never wanted to use that.
When ever I tried to start a voice chat I got the following error:

Error creating session: Could not create the rtp muxer element
Error adding stream.

This is just a trouble due to permissions to gstreamer and Farsight2. Follow the steps to get it right.

  1. Fire a terminal.
  2. Change directory to your home folder.
  3. Now type “mv .gstreamer .gstreamer.bak
  4. and “mv .farsight2 .farsight2.bak

We are moving the folders in order to be safe rather than deleting them, in case we need to restore them.