Thursday, June 25, 2009

Howto connect to the Internet using ZTE AC 8710 USB EVDO modem and Reliance Netconnect Plus service in Ubuntu

-------------Update on 26 Dec 09 ----------------------------------
Ive upgraded to Ubuntu Karmic Koala (9.10) and found to my pleasant surprise that I dont have to do the modeswitch as explained below... The kernel parameters are required to be passed at boot time but once you insert the modem, the switch happens automatically! Upon insertion, my dmesg shows this:
1781.557336] usb 4-1: new full speed USB device using uhci_hcd and address 7
[ 1781.728425] usb 4-1: configuration #1 chosen from 1 choice
[ 1781.733527] usbserial_generic 4-1:1.0: GSM modem (1-port) converter detected
[ 1781.733858] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1781.737839] usbserial_generic 4-1:1.1: GSM modem (1-port) converter detected
[ 1781.738124] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1781.739791] usbserial_generic 4-1:1.2: GSM modem (1-port) converter detected
[ 1781.740855] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1781.744782] usbserial_generic 4-1:1.3: GSM modem (1-port) converter detected
[ 1781.745112] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 1781.747243] usbserial_generic 4-1:1.4: GSM modem (1-port) converter detected
[ 1781.747527] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB4

So I directly run wvdial cdma and connect.
Ps. I am still not able to use Network Manager which now includes an entry for Reliance in the Mobile Broadband section.

-----------------------------------------End of Update------------------------------------------------


The prerequisites to achieve the above are:


1. An activated Reliance Netconnect Plus EVDO service with the ZTE AC8710 EVDO modem.

2. A laptop/desktop with Ubuntu Jaunty Jackalope (9.04); It could/should work with other flavors/versions too with minor tweaks.

3. The usb_modeswitch utility from here --> http://www.draisberghof.de/usb_modeswitch/

4. The wvdial package.

The steps:

1. First download the usb_modeswitch utility and either compile it or use the binary (this worked in my case).

2. This utility is required to switch the ZTE modem from mass storage mode to modem mode. This is because ZTE cleverly added a usb storage mode which could allow them to bundle the windows driver and utility along with the dongle thus ensuring that people using netbooks etc (those without CD-Rom drives) could install and work with the modem. Unfortunately in Linux (Ubuntu Jaunty in my case), this does not happen and the device shows up as a mass storage device always thus leading to an impasse.

3. The next interesting point to note is that with Jaunty, the usbserial module has got built into the kernel instead of being a loadable module (This is the primary difference when working with earlier flavors like Intrepid- 8.10 where this module has to be loaded with the modprobe command).

4. Hence the parameters to the usbserial module have to be passed at boot time. One needs to add the following two values (usbserial.vendor and usbserial.product) to the end of the kernel line in the /boot/grub/menu.lst for the default kernel. In my case it looks like this after modification ( I am making the assumption that people know how to edit files in Linux):-

kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=61f8e10e-6e9f-44c9-8e41-43deb8589139 ro quiet splash usbserial.vendor=0x19d2 usbserial.product=0xfff1

5. The next step is to unzip (optionally compile ) and install the usb_modeswitch tool. This puts a binary called usb_modeswitch in /usr/sbin/usb_modeswitch and the configuration file in /etc/usb_modeswitch.conf

6. Edit the /etc/usb_modeswitch.conf file to reflect the modem type and other settings. In my case the relevant line numbers (582 to 591) look so: -

   582 DefaultVendor=  0x19d2
583 DefaultProduct= 0xfff6
584
585 TargetVendor= 0x19d2
586 TargetProduct= 0xfff1
587
588 # only for reference
589 # MessageEndpoint=0x05
590
591 MessageContent="5553424312345678c00000008000069f030000000000000000000000000000"

7. The next step is to reboot after saving all changes to ensure that the usbserial module gets the required values.

8. After rebooting, we need to now switch mode. To do this, insert the USB modem, wait for it to get recognized as a mass storage device and then run the command (as root) usb_modeswitch. If one tails the messages file (tail -f /var/log/messages), one can see that new devices such as /dev/ttyUSB0 get created.

Before switch the log looks so: -

usb-storage: device scan complete

[ 2326.587996] scsi 6:0:0:0: CD-ROM ZTE USB Storage FFF1 2.31 PQ: 0 ANSI: 2

[ 2326.656896] sr0: scsi-1 drive

[ 2326.657023] sr 6:0:0:0: Attached scsi CD-ROM sr0

[ 2326.657121] sr 6:0:0:0: Attached scsi generic sg2 type 5


After switch it is:-

usb 2-2: new full speed USB device using uhci_hcd and address 10

[ 2328.646405] usb 2-2: configuration #1 chosen from 1 choice

[ 2328.649209] usbserial_generic 2-2:1.0: generic converter detected

[ 2328.649622] usb 2-2: generic converter now attached to ttyUSB0

[ 2328.652650] usbserial_generic 2-2:1.1: generic converter detected

[ 2328.653049] usb 2-2: generic converter now attached to ttyUSB1

[ 2328.655786] usbserial_generic 2-2:1.2: generic converter detected

[ 2328.656234] usb 2-2: generic converter now attached to ttyUSB2

[ 2328.658435] usbserial_generic 2-2:1.3: generic converter detected

[ 2328.658781] usb 2-2: generic converter now attached to ttyUSB3

[ 2328.661470] usbserial_generic 2-2:1.4: generic converter detected

[ 2328.661814] usb 2-2: generic converter now attached to ttyUSB4


9. Once this is done, we now need to run the wvdialconf tool to create the wvdial.conf file. In my case, it could detect the ZTE modem and detected a 9600 baud capable modem.

10. We can now edit the /etc/wvdial.conf file to add other values including the username and password (the reliance number associated with the EVDO service is both in this case). After it is done, my wvdial.conf looks so: -

     2 [Dialer cdma]
3 Stupid Mode = 1
4 Inherits = Modem0
5 Password = 93xxxxxxxx
6 Username = 93xxxxxxxx
7 Phone = #777
8
9 [Modem0]
10 Init1 = ATZ
11 Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
12 SetVolume = 0
13 Modem = /dev/ttyUSB0
14 Modem Type = Analog Modem
15 ;Baud = 9600
16 Baud = 115200
17 FlowControl = Hardware (CRTSCTS)
18 Dial Command = ATDT
19 ISDN = 0


Pl note that I added the [Dialer cdma] part and also changed line 15 from 9600 to 115200 and it works just fine!

11. Once this is done, just run the command wvdial cdma and if all goes well, you should be connected. my final output, once connected looks so:


--> WvDial: Internet dialer version 1.60

--> Cannot get information for serial port.

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

OK

--> Modem initialized.

--> Sending: ATDT#777

--> Waiting for carrier.

ATDT#777

CONNECT

--> Carrier detected. Starting PPP immediately.

--> Starting pppd at Thu Jun 25 09:52:01 2009

--> Pid of pppd: 11296

--> Using interface ppp0

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]

--> local IP address 115.240.46.196

--> pppd: ��[06][08]0�[06][08]

--> remote IP address 220.224.141.129

--> pppd: ��[06][08]0�[06][08]

--> primary DNS address 202.138.97.193

--> pppd: ��[06][08]0�[06][08]

--> secondary DNS address 202.138.96.2

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]

--> pppd: ��[06][08]0�[06][08]



12. Thats it!! Fire up your browser, email client etc etc and happy surfing. I am getting 500 Kbps in Chennai and Hyderabad.

ps. i found out that i hadnt had pppd installed so had to install that as well.

I know that there might be a more elegant GUI way of doing this but this is the best I could do after reading a lot of stuff that other people had done.

Saturday, August 23, 2008

Apple digs its own grave: The iPhone3G in India


I ha
ve been watching eagerly for the Apple iPhone3G in India. I was one of the millions who pre-booked on both Vodaphone and Airtel websites. I was disgusted to receive a mail on 20 Aug 08 from both Airtel and Vodaphone exhorting me to deposit Rs 5000 and Rs 10000 respectively to get my hands on the "iPhone that Ive been waiting for". The email also innocently mentioned that the iPhones are priced at Rs 31000 ($715) and Rs 36000 ($830) for the 8GB and 16GB models!!!
Now what kind of fools do they think we are? The questions that first occured to me were:-

Would I buy a phone that:

a) costs Rs 31000 and upwards

b) does not let you use Bluetooth for anything but headset

c) does not have any memory expansion slot

d) does not let you change the Battery

e) does not let you sync if you are on a Linux desktop?

f) Has 3G capability but wont be useful for about 2 years since there are no 3G networks in India.

g) Is network-locked to Airtel or Vodaphone

My response was a overwhelming NO to all of the above.

Why couldnt the so-called business brains at Vodaphone and Airtel use their brains for once? Every Marketing/Strategy person worth his salt knows that India is a volume-based market. Did Airtel not want to convert even .01% of their 60mn plus users?

Even more hilarious was the statement by a Vodaphone chappie who says that prices are expected to fall in the coming months!! Well Mr Vodaphone, who would then buy now?

Apple could have done well with retailing the phone through Reliance because, whatever said and done (mama-he-pinched-me style of corporate governance notwithstanding) , these guys have mastered the art of commoditising everything in India.

So I would never think of giving up my HTC-Touch/Nokia E71/Blackberry/Your-favorite-Phone for the iPhone unless it sells at 10-12k.

Saturday, February 16, 2008

my experiments with meraki

I had heard a lot about Meraki and how they were trying to change the way people build and use mesh networks. I called up meraki sales to find out more. surprisingly, the person on the phone wasn't very forthcoming with any answers. when I asked him whether anyone from india had bought the nodes, he said that they'd sold quite a few in the country. and then when I asked him to give me some references so I could go talk to these people and also see the meraki nodes in action, he tells me that information is confidential! the whole attitude was a take it or leave it.
however, being inquisitive, I just went ahead and placed an order for 3 outdoor nodes (standard) for $99 apiece which cost me Rs 6500 after customs and frieght.
the meraki's came in their own green boxes with a PoE injector and 2dbi antenna. assembly was quick and painless and we could register them on the dashboard.
the best part about them was the zero configuration required and auto config in gateway or repeater mode. we were able to see the merakis on google maps from the dashboard.
we took some readings and found that the range with the default antenna is dismal. it barely covers 50m in standard environment and around 75 m in open ground.
the captive portal is not configurable beyond the text and there is no user authentication at all!
we are now planning on trying them out with larger gain antennae.



Posted from moBlog – mobile blogging tool for Windows Mobile

blogging using moblog

just downloaded an application called moblog created by sampath dassanayake and installed on my windows mobile phone. this app lets you create blogs offline and then post them to your blog. I tried out blogger but I believe others are supported too.

Posted from moBlog – mobile blogging tool for Windows Mobile

Wednesday, September 26, 2007

Hotspot in a Box

Ive finally managed to put it all together! I believe I have managed to build the ultimate embedded hotspot-in-a-box solution.
What I have done is, put together Chillispot, FreeRadius and phpMyPrepaid on the same box. While this itself is not unique, what separates this from other such initiatives is that all of this comes on a 512MB Compact Flash Disk.
The basic platform is a Soekris Engineering net4801 appliance. This has a decent 128MB of RAM and three Ethernet Interfaces. More details on the Soekris box are here.
The challenge was to look for a Linux distribution that recognised all the hardware on the Soekris, and was small enough to fit on a CF Card. My search lead me to Voyage Linux which is a debian derived distribution with a 66 MB footprint in its basic avatar.
Since I didnt have a CF Card reader, I used my Nikon Coolpix n770 camera as the reader. Attached it to my Ubuntu laptop and the card showed up as a usb disk. Using the voyage installer was a trivial exercise. Once the basic OS was installed, I then plugged the CF Card into the Soekris and watched it boot beautifully over the serial console!!
Once this was done, I connected the Soekris to the Internet and ran apt-update to update the package list.
I then went about installing MySQL, PHP, Lighttpd (lighty) instead of Apache, FreeRadius, Chillispot and Phpmyprepaid.
After two days of fiddling around, I figured out why Chillispot wasnt working properly, rectified it (eth1 has to be 0.0.0.0).
I now have a full fledged hotspot controller which does not need to connect to any centralized Radius Server for authentication.
The Soekris box is currently undergoing burn-in.

The only problem I am facing is that of MySQL tables crashing! I live in an area where power outages are the norm. Thank you DLF for wonderful buildings and crappy infrastructure.
High on my to-do list is change over from MySQL to firebirdSQL (www.firebirdsql.org). Wonder how long will it take to modify phpmyprepaid to work on firebirdsql...

For all your uber-geeks out there, I can send you a copy of the CF card image if you feel a little adventurous. #free -m reports
124 M Total 59M Used 64M Free
The total size of software on CF card is around 370 MB.

Sunday, August 19, 2007

Wi-Fi in Trains

Wi-Fi Networking News reported here that Icomera, a Swedish company is rolling out Wi-Fi in UK Train Operator GNER's trains. I called up the Icomera people and spoke with a nice gentleman named Jan Lindberg who said he was in charge of International Business. I asked him whether Icomera was interested in coming to India to roll out Wi-Fi in Indian trains. His answer completely blew me off! He said very apologetically that Icomera was a very small company (about 20 people) and did not have enough bandwidth to go out of Europe. So they don't have any business anywhere except Europe in the "foreseeable future" as he put it.
I really wish some Indian giant takes cognizance of this and goes out and buys these guys out so that we can benefit from their technology. We have after all bought out Corus and Arcelor havent we?

Saturday, August 4, 2007

Campus WiFi Tenders: Realistically Speaking..

The other day, a prominent government lab put up a notice inviting tenders for Wi-Fi connectivity at their residential colony. We promptly downloaded the tender specs from their website. The tender appeared to be well written with a lot of care taken to ensure that only the best solution gets selected. On closer look, I was appalled to see some of the so-called specifications! It indicated an absolute lack of expertise in Wi-Fi network capabilities, and technologies. The most damaging spec read as follows:-
" Only one site (also called base station) to be used to install all access points/repeaters and antennae and provide access throughout the campus."
The campus consists of 50 odd buildings, each of 2-4 stories height and medium vegetation. The campus itself is about 1 sq km in size. I decided that the place was worth a visit and some discussions with the concerned people was definitely in order.
The laboratory (like most Indian government institutions) had an antiquated IT department. They even had a fancy name for it: "Computer Facility Center". We couldnt meet with the Head and instead two subordinate "Scientists" met with us.
I basically asked to be shown around the colony where coverage was desired. One of the gentlemen accompanied us to the Residential colony which was across the road from the lab. On seeing the largest building there (about 12 floors), I went up to the roof of this building to get a Bird's Eye view of the entire campus. What I saw wasnt very encouraging. The building was at one corner of the campus and there was thick tree cover all over. I quickly realized that there was no way that anyone could provide coverage to the entire area with just one "base station". We then went back to the IT department for discussions. I explained to the two people that they must release an addendum to the tender notification doing away with the requirement for a single base station. The explanation given by them for this totally blew me away! They said that they didnt want to be bothered with the maintenance of the Wi-Fi network and hence if a single base station were used, only one point would be required for maintaining the equipment.
This even after another requirement in the tender that the prospective bidder had to provide support services for 3 years!
I tried explaining to them the fallacy of the logic. Moreover, I tried to tell him that there was no technology that could provide access to laptops and PCs in the colony with just one base station mounted on one building at one corner of the area.
They just refused to listen to reason! They said that it was too late to change the tender and it would only involve additional paperwork and too much trouble and other such blah blah. They had not even heard of Mesh networking. They kept insisting that there were some experts who had assured them that they were in possession of such equipment which could fulfill this requirement.
After all this, I am left with the thought that woe be to the poor guy who does win the bid. How would he go about providing access?

All of the above just goes to say that the people/end users who have the grave responsibility of ensuring that the organisation gets the best solution based on sound technological inputs choose to behave immaturely. I really wish people would take the trouble of reading up on technologies instead of designing it for the system integrator! What they dont seem to understand is that every Wi-Fi vendor has his own architecture/philosophy of designing a wireless network. By specifying a particular approach, they have effectively ensured that only a couple of vendors can qualify. The least that could have been done was to have appoint a consulting organisation which would have helped the Laboratory make a technologically sound RFP which can be realistically delivered by the industry.

I'm off to hunt for a solution that can do all that they're asking for at the lowest cost!!