View Single Post
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#4
Just thought I'd add a note here on how I got the N900 working as a USB modem in Centos, since there didn't seem to be a better place.. It seems this "just works" on Ubuntu, but I thought I'd record it here for anyone doing things manually.

Overall I'd rather do this with usbnet and iptables/NAT on the phone, using it as a little router rather than a dongle, but this will work for now.

I'm in the UK on a t-mobile PAYG sim.

I plugged the usb cable in and select pc-suite mode on the N900

dmesg on my laptop says:
...
usb-storage: device scan complete
usb 1-5: USB disconnect, address 3
usb 1-5: new high speed USB device using ehci_hcd and address 4
usb 1-5: configuration #1 chosen from 2 choices
drivers/usb/class/cdc-acm.c: This device cannot do calls on its own. It is no modem.
cdc_acm 1-5:1.6: ttyACM0: USB ACM device
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
usb0: register 'cdc_ether' at usb-0000:00:1d.7-5, CDC Ethernet Device, 32:9e:46:5a:de:33
usbcore: registered new driver cdc_ether
I ran:

wvdialconf /etc/tmob.wvdial.conf

which creates the file /etc/tmob.wvdial.conf

I then edited /etc/tmob.wvdialconf to put in values for the Phone, Username and Password settings (which I just got from a bit of googling)

after this, /etc/tmob.wvdial.conf shows:

[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = USB Modem
Phone = *99#
Username = t-mobile
Password = tm
I verified the contents of /etc/ppp/peers/wvdial

# cat /etc/ppp/peers/wvdial
noauth
name wvdial
usepeerdns
Finally, since I was still plugged into the local ethernet LAN, I did

ifconfig eth0 down


to get rid of the existing default route and IP. (If I hadn't done this, wvdial would have not overwritten the existing default route. This could be fixed by adding the setting "defaultroute" in /etc/ppp/peers/wvdial, most likely.)

I then started the connection with:

wvdial --config /etc/tmob.wvdial.conf


which gave the output:


--> WvDial: Internet dialer version 1.54.0
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: 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*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> PPP negotiation detected.
--> Starting pppd at Sun Dec 13 23:44:29 2009
--> pid of pppd: 6145
--> Using interface ppp0
--> Authentication (PAP) started
--> Authentication (PAP) successful
--> local IP address xx.xxx.xxx.xxx
--> remote IP address 10.6.6.6 [<- oo-er!]
--> primary DNS address 149.254.192.126
--> secondary DNS address 149.254.201.126

(... at this point, after checking a couple of pages loaded ok, I hit ctrl-C)

Caught signal #2! Attempting to exit gracefully...
--> Terminating on signal 15
--> Connect time 1.5 minutes.
--> Terminate Request (Message: "User request" )
--> Disconnecting at Sun Dec 13 23:45:56 2009