# USB modem not working

## chetan13

hi

i connect my computer to the internet using my cell phone with a usb data cable attaching it to the computer.i was able to connect to the net using this in mandrake linux 9.1 so i know it works.i am not able to do it in gentoo.here are the necessary script files.

/etc/ppp/options

lock

asyncmap 0

crtscts

modem

defaultroute

usepeerdns

name soman

noauth

/dev/rmodem 115200

/etc/ppp/ip-up.local

mv /etc/resolv.conf /etc/ppp/resolv.conf.org

chmod -w /etc/ppp/resolv.conf.org

cat /etc/ppp/resolv.conf /etc/ppp/resolv.conf.org > /etc/resolv.conf

chmod --reference=/etc/ppp/resolv.conf.org /etc/resolv.conf

/etc/ppp/ip-down.local

mv /etc/ppp/resolv.conf.org /etc/resolv.conf

i connect using the following script file

#!/bin/sh

route | grep default >/dev/null

if [ $? = 0 ]

then

set `route | grep default`

route del default

echo $2 >$HOME/.routedefault

fi

pppd /dev/rmodem 115200 debug usepeerdns defaultroute connect '/usr/sbin/chat -v "" at+cta=30 OK "atdt#777" CONNECT' mtu 264

/root/.ppprc

user ******** password ********

the /dev/rmodem is actually a link to /dev/usb/ttyUSB0

previously i had to do

mknod /dev/usb/ttyUSB0 c 188 0

to make it work.i did that this time too.but it still doesn't connect to the internet.should i have enabled some other option while compiling the kernel.i had posted this in the networking forum but got no reply.

please help me.

chetan

----------

## NeddySeagoon

chetan13,

Can you see your modem with usbview?

If not, you have some very basic problems at the hardware level.

If your modem is there, what does /sbin/lsmod show?

Are the right kernel modules for your USB chip set and modem loaded?

You should not need to use mknod with /devfs, since the device drivers are supposed to register themsleves and the nodes appear in /dev without any help. A few drivers are still not devfs aware though.

Regards,

Neddyseagoon

----------

## chetan13

here is what usbview shows me for my date cable.

USB <-> Serial

Manufacturer: FTDI

Serial Number: 12345678

Speed: 12Mb/s (full)

USB Version:  1.10

Device Class: 00(>ifc )

Device Subclass: 00

Device Protocol: 00

Maximum Default Endpoint Size: 8

Number of Configurations: 1

Vendor Id: 0403

Product Id: 6001

Revision Number:  2.00

Config Number: 1

	Number of Interfaces: 1

	Attributes: 80

	MaxPower Needed:  90mA

	Interface Number: 0

		Name: serial

		Alternate Number: 0

		Class: ff(vend.) 

		Sub Class: 0

		Protocol: 0

		Number of Endpoints: 2

			Endpoint Address: 81

			Direction: in

			Attribute: 2

			Type: Bulk

			Max Packet Size: 64

			Interval: 0ms

			Endpoint Address: 02

			Direction: out

			Attribute: 2

			Type: Bulk

			Max Packet Size: 64

			Interval: 0ms

lsmod doesn't show any loaded modules.

i recompiled my kernel with FTDI support and SLIP support.

yes /dev/usb/tts/0 was automatically created.i just linked my /dev/rmodem to it.now the lights on the cable(connecting my comp to the cellphoone) glow but it doesn't get connected.i think now the problem is with the daemons which connect me to the net.the files are in my first post.is there anything else i should do.like /etc/init.d/net.ppp0 start

thanking you for the help

chetan

----------

## NeddySeagoon

chetan13,

Gettling the lights on is a good sign. 

lsmod will only show modulles if you built your kernel that way. Monolithic kernels are OK if you get them right. I use modules, mostly becasue I'm not always sure of which bits I want.

Now you have the lights on you should be able to talk to the modem with minicom. This won't get you connected - it just talks to the device.  You may be able to launce PPP but I don't know how.

If your modem does Hayes commands, you should be able to make it dial by sending it 

ATDT<some phone number> 

Where AT=ATtention, D=Dial, T=Tones

The modem should respond OK.

Just sending it AT should get an OK response.

ATI0

ATI1

Should get you info about the modem. Most modems have at least 6 of these info commands.

If this all works the basics are there and its the higher level stuff thats brokem

Regards,

NeddySeagoon

----------

## chetan13

i dont know how to do that stuff but here is what i did.

cat /dev/usb/tts/0

then in another console i tried to connect.on the first screen i got

OK

that is all.

the command that is supposed to get me connected is

pppd /dev/rmodem 115200 debug usepeerdns defaultroute connect '/usr/sbin/chat -v "" at+cta=30 OK "atdt#777" CONNECT' mtu 264

(next time i will try to put it in the fancy code box)

pppd looks for /etc/ppp/options and ~/.ppprc both of which are perfect.(the same files got me connected in mandrake linux).is there something different in gentoo.is there any permissons i got to get right.it doesnt seem to be able to give the instructions correct.

thanks for taking the time

chetan

----------

## chetan13

can the problem be with route.anything extra to do for route to work

chetan

----------

## NeddySeagoon

chetan13,

That looks good - the OK must have come from the modem.

Your command pppd /dev/rmodem 115200 debug usepeerdns defaultroute connect '/usr/sbin/chat -v "" at+cta=30 OK "atdt#777" CONNECT'

Uses the programs pppd and chat. Have you actually got chat installed? I can't find an emerge for it.

Try 

whereis chat 

and 

whereis pppd 

to find out.

Normally pppd must be run by or as root. So you might try connectring as root.

The bit at the end is a chat script.

"" at+cta=30 

OK "atdt#777"

It means 'expect nothing' then send 'at+cta=30' to the modem.

Expect 'OK' then send "atdt#777", which tone dials 777.

Look in your log files in /var/log to see what chat had to say for itself. (If it ran).

When it works you can write your own chat script so you don't have to remember that long command.

Regards,

NeddySeagoon

----------

## chetan13

hi

chat comes with emerge pppd.

i always was trying to connect as root.i couldn't otherwise in mandrake linux.the command i typed was given in the script file i put up on my first posting.the manufacturer gives them to me.he gives very limited support(none till now) for linux.i will try and recompile my kernel without the devfs option.will search for a default mandrake linux kernel configuration file and try and cross check my options.

will let you know the results.anyway is there anyone else who connects to the net using their cell phone and a usb datacable.

thanks again

chetan.

----------

## chetan13

i get connected now.

i enabled four new options in the new kernel.i dont know which one did the trick.

they are all in "network device support".they are

PPP support for async serial ports

PPP support for sync tty ports

and the next two relating to ppp compression.

though it connects,it is putting up some funny behavior which i hope i can fix.i came across something else while recompiling.the kernel supports sound for i845 chipset.previously i used to have to recompile alsa everytime i recompiled and it gives a lot of extra modules all of which are loaded.i will search for which drivers are better and if i dont find anything i will post the question in a new thread.

anyway

thank you neddy seagoon for the help

regards

chetan

----------

