October 28, 2009

Reliance netconnect - check your usage

Update December 14, 2009: Self contained exe for windows with a GUI - see here.

I have been using netconnect from reliance without any complaints for two months now. One problem, though, has been that the reliance website is fairly bad and it is not at all easy to verify your usage until you get the bill. When you log in and check your usage, what is shown is a huge table with the usage in kb for each session along with the session start time. So, if like me, you have a plan with a separate limit for nighttime, you have to download the csv file and then add up the usage yourself for sessions starting in the 'nighttime' and similarly for those starting in the 'daytime'. Seeing that many people have complained of being over-billed, it seems prudent to keep a tab on usage. While vnstat can give you the usage on any machine, it is less helpful when you use the account from multiple machines and also it does not seem to be easy to get usage for specified time limits.

So here is a small python script I wrote to get the usage information from the reliance website, calculate the split usage for daytime (6am-10pm) and nighttime (10pm-6am) and present the results in a human readable form. You can download the script here.

Here is the script in action -

Any comments and suggestions are welcome.

October 3, 2009

Reliance Netconnect on Ubuntu

Note: These are specific instructions for using ZTE-AC2726 modem on Ubuntu Jaunty.
If you are using a different modem, instructions may vary.

I got one of the newer modems with my wireless broadband connection from Reliance. It is a model that I had not come across in other blog posts, but I was encouraged by seeing 'Linux OS' mentioned among the system requirements.

Step 1: Open box and first look
The linux support is in the form of a driver on the cd that comes in the package. There is a deb package, but an attempt to install it fails because it seems to support kernels upto 2.6.27 only. The modem looks nice though!

Step 2: Plug in modem
On plugging in the modem, it gets mounted and shows up in nautilus like any storage drive. 'lsusb' confirms the bad news - the device is listed as 'Bus 007 Device 006: ID 19d2:fff5'. The modem is being recognised as a storage device only.

PS: In Ubuntu 9.10 (Karmic), the device is recognized as a modem directly and the steps 3 and 4 are not required.

Step 3: usb_modeswitch to the rescue
usb_modeswitch is an application written specifically for this purpose.

wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-1.0.5.tar.bz2
tar -xjvf usb_modeswitch-1.0.5.tar.bz2
cd usb_modeswitch-1.0.5
sudo make install

If there were no errors, you can add this snippet to /etc/usb_modeswitch.conf. I have broken MessageContent into 2 lines so that it can be shown in entirety. You should put everything on one line.

# ZTE AC2726
DefaultVendor= 0x19d2
DefaultProduct= 0xfff5

TargetVendor= 0x19d2
TargetProduct= 0xfff1


Now run

sudo usb_modeswitch

You should see the success message and lsusb should show the product id is now fff1.

Step 4: Load the usbserial module

sudo mobdprobe usbserial vendor=0x19d2 product=0xfff1

Step 5: Connect using wvdial
If all has gone well, the modem should be recognised and ready to use.
'ls /dev/ttyUSB*' should show some USB devices

sudo apt-get install wvdial

You can run 'wvdialconf' to generate the initial configuration file and then edit it to enter your phone number and password.
This is my wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = #777
PPPP Path = /usr/sbin/pppd
New PPPD = 1
Stupid Mode = 1
Tonline = 0

Now you are all set to

sudo wvdial

and get connected.

1. I did the initial activation of the device from a windows pc. Not sure if it can be done with wvdial by using the phone number for that purpose.
2. Loading of the specific usbserial module can be automated by adding it to the kernel line in the boot menu. udev rules can be used for running usb_modeswitch on plugging in the modem - these are not covered here.