xor eax, eax

Change the world or go home !!

Installing reliance Broadband+ on fedora linux part three

September10

Welcome to chapter three of the Reliance Broadband+ installation. We ve done enough to make it work. Now we will iron out the changes and glue the changes to the system so that we dont have to run the flurry of commands over and over again and again.

First of all we will make the usb_modeswitch to do the job automatically everytime the usb is inserted.

You have followed the steps in http://navindutta.com/wordpress/2009/09/installing-reliance-broadband-on-fedora-linux-part-one/

Now lets continue make the usb cdrom to usb modem switch automagic ;) .. so all this is will be done when you insert the device in usb

#vim /etc/udev/rules.d/70-persistent-cd.rules

Append the following to the end of the file

ACTION==”add”, ATTRS{idVendor}==”19d2″, ATTRS{idProduct}==”fff5″,
RUN+=”/usr/bin/usb_modeswitch”

ACTION==”add”, ATTRS{idVendor}==”19d2″, ATTRS{idProduct}==”fff1″,
RUN+=”/sbin/modprobe
usbserial vendor=0×19d2 product=0xfff1 maxRSize=12288 maxWSize=8192

Once this has been done run the following and then plug your modem in and run this command to load the newly set rule.

#udevadm control –reload-rules

Now if you notice you dont have to run the usb_modeswitch everytime you plug in the modem. It is done automagically.. Cool !! :D aint it? as well as teh modprobe for high speed access.

Everytime you want to connect to the internet you just need to run the command

#wvdial

Thats it!!! There you go :D Have fun!!

Installing reliance Broadband+ on fedora linux part two

September8

Was fairly satisfied with 60kbps speed on average with the Reliance Broadband+ connection using Zte AC2726 modem, when I stumbled upon an article saying the usbserial kernel module isnt designed for high speed access and has a bottleneck which caps the speed to over 60 kpbs on an average.

(You can check how to set it up here at the link below)

http://navindutta.com/wordpress/2009/09/installing-reliance-broadband-on-fedora-linux-part-one/

Hmm… Not quiet what we want when we pay for 3.1MBpS.. This should be dealt with; but how.

After hours of toil I figured out how to do this. Lets setup the kernel compiling environment. We update our kernel; install kernel source packages and kernel header files for compiling the hacked usbserial kernel module.

(My kernel version was 2.6.27.30-170.2.82.fc10.i686)

Lets do this.

#yum update kernel
#yum install kernel-devel
#yum install kernel-headers

After this I tried to build a custom kernel but it kept failing. This was taken care of after I installed the ncurses dependency package for kernel compiling.

#yum install ncurses-devel

Okay..after installing ncurses-devel package lets see if we can build the kernel.

#cd /usr/src/kernels/`uname -r`/ && make menuconfig

Yes we can :D GEE …YUHOO … it gives a pretty menu like interface .. so we are ready to build our patched usbserial.ko ;)

Lets locate the source file

#locate usb-serial.c

Output
#########################
/usr/local/bin/ztemtApp/zteusbserial/2.6.27/usb-serial.c
#########################
End Output

Lets copy this file the kernel module compiler directory for usbserial

#cp /usr/local/bin/ztemtApp/zteusbserial/2.6.27/usb-serial.c /usr/src/kernels/`uname -r`/drivers/usb/serial/

Make a backup if something goes.

#cp /usr/src/kernels/`unname -r`/drivers/usb/serial/ /home/nick/Desktop/usbserial_emergency_backup

Copy the files from the running usbserial module to build directory
#cp /usr/local/bin/ztemtApp/zteusbserial/2.6.27/* /usr/src/kernels/`uname -r`/drivers/usb/serial/

Patch the current usbserial.c with added layer to accomodate highspeed access argumentss

The patch file should be like this
************************************
61a62
> static ushort maxRSize, maxWSize, maxISize;
841a843,844
>         if (buffer_size < maxRSize)
>         buffer_size = maxRSize;
865a869,870
>         if (buffer_size < maxWSize)
>         buffer_size = maxWSize;
891a897,898
>             if (buffer_size < maxISize)
>             buffer_size = maxISize;
1260a1268,1273
> module_param(maxRSize, ushort, 0);
> MODULE_PARM_DESC(maxRSize, “User specified USB input buffer size”);
> module_param(maxWSize, ushort, 0);
> MODULE_PARM_DESC(maxWSize, “User specified USB output buffer size”);
> module_param(maxISize, ushort, 0);
> MODULE_PARM_DESC(maxISize, “User specified USB interrupt buffer size”);
************************************

Or you can download this patched file
Instead of building the whole kernel, lets just build the usbserial.ko kernel module

#make -C /lib/modules/`uname -r`/build M=/usr/src/kernels/`uname -r`/drivers/usb/serial/

Create a backup for the current usbserial.ko

#cp /lib/modules/`uname -r`/kernel/drivers/usb/serial/usbserial.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial/usbserial.ko.backup

You will find a ztemt.ko in the /usr/src/kernels/`uname -r`/drivers/usb/serial/

copy this file to /lib/modules/`uname -r`/kernel/drivers/usb/serial/ and rename it to usbserial.ko

#cp /usr/src/kernels/`uname -r`/drivers/usb/serial/ztemt.ko /lib/modules/`uname -r`/kernel/drivers/usb/serial/usbserial.ko

Install the new usbserial kernel module like this

#depmod -a

Reboot to save changes.

#reboot

Now lets modprobe with added parameters

#modprobe usbserial vendor=0×19d2 product=0xfff1 maxRSize=12288 maxWSize=8192;sudo wvdial

Enjoy the highspeed access over 250 kbps ;)   Depending on the signal strength this goes upto 400kbps. Welcome hack!!

Have fun ;)

Installing reliance Broadband+ on fedora linux part one

September8

Recently I switched from (Zte MC 315+ )Reliance Netconnect connection to (Zte AC2726 ) Reliance Broadband+ plan. The transition was one of a bloggable experience hence the post.

The new device Zte AC2726 is a usb composite device which means at the same time it emulates as a usb cdrom device as well as usb evdo/cdma_1x(rtt_1x) modem. This is fairly simple to install in Windows Vista without the need of any cd. The device has the windows software listed in it and when plugged in prompts to install the setup needed else runs the application if already installed on the local syste. Quiet amazing.

Now lets put it back to older systems like Windows XP which dont have neccesary drivers for the usb composite device and go bananas trying to figure what it is. I tried updating my drivers through many available softwares Driver Detective, Driver Genius. All of em fail. Some which do recognize it ask for money. After spending Rs. 3500 on the device already. That was a no go. Bad bad support.

Now I wanted to try and make it work on Fedora. So I plugged in the device to see if it recognises it.

#lsusb

Output
**********************
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 005: ID 19d2:fff5 ONDA Communication S.p.A.
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
**********************
End Output
#dmesg

**********************
Lists no ttyUSBx device but shows it as a cdrom
**********************

Lets make a switch which changes the usb cdrom mode to usb modem mode. For this we require usb_modeswitch. Lets install it.

#yum install usb_modeswitch

**********************
usb_modeswitch is installed
**********************

We know what to look for. So lets add these lines in usb_modeswitch.conf and uncommented and comment all other lines.

#vim /etc/usb_modeswitch.conf

**********************

########################################################
# ZTE AC2726 (EVDO)
#
# Contributor: Navin Dutta

DefaultVendor=  0×19d2
DefaultProduct= 0xfff5

TargetVendor=   0×19d2
TargetProduct=  0xfff1

MessageEndpoint=0×0a
MessageContent=”5553424312345678c00000008000069f010000000000000000000000000000″

**********************

Now lets make it switch.

#usb_modeswitch

**********************
Successful… msg sent
**********************

now lsusb to see if it got changed

#lsusb

Output
**********************
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 005: ID 19d2:fff1 ONDA Communication S.p.A.
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
**********************
End Output

Yes it got changed from fff5 to fff1 which means from cdrom to modem mode

Now lets modprobe it

#modprobe usbserial vendor=0×19d2 product=0xfff1

Now lsusb or dmesg to see the if it gets detected

#dmesg

**********************

usbserial_generic: generic carrier detected
…..
…..
**********************

Now put ttyUSB0 in wvdial.conf

#vim /etc/wvdial.conf

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

**********************

#sudo wvdial

**********************
Gets connected. Voila!! I get an average speed of over 60kbps. Not bad.
**********************

Check the part two of this article for the kernel module hack for high speed access of over 250 kbps with the same device.

http://navindutta.com/wordpress/2009/09/installing-reliance-broadband-on-fedora-linux-part-two/