Welcome! Log In Create A New Profile

Advanced

Usb tethering?

Posted by Silver 
Silver
Usb tethering?
January 14, 2011 10:51AM
So I had a random idea. I can tether with my sprint phone by dialing #777. When I connect the phone to the pogo it recognizes as a usb modem. From here i'm not sure how to actually dial the connection. I tried echo atdt#777 > /dev/ttyACM0 without any luck. Any ideas?
Re: Usb tethering?
January 14, 2011 04:48PM
I also have Sprint...

Setup:
apt-get install ppp
echo <<HERE > /etc/ppp/peers/sprint
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/sprint"
defaultroute
usepeerdns
/dev/ttyACM0
230400
local
novj
HERE
echo <<HERE > /etc/chatscripts/sprint
TIMEOUT         5
ABORT           '\nBUSY\r'
ABORT           '\nERROR\r'
ABORT           '\nNO ANSWER\r'
ABORT           '\nNO CARRIER\r'
ABORT           '\nNO DIALTONE\r'
ABORT           '\nRINGING\r\n\r\nRINGING\r'
''              \rAT
TIMEOUT         12
OK              ATD#777
TIMEOUT         22
CONNECT         ""

HERE
To connect:
pon sprint
To disconnect:
poff sprint
You may also have to do the following depending on your network setup. Bear in mind that removing the default route may drop your ssh connection to your dockstar unless there is a specific route.
# after connection...
route del -net default eth0
route add -net default ppp0
# before disconnection...
route del -net default eth0
route add -net default ppp0
-PG
Silver
Re: Usb tethering?
January 16, 2011 07:30AM
So using your setup it does connect through the phone and brings up ppp0. Checking /var/log/messages It shows a connection, ip & DNS servers. However once connected I am unable to access out, even pinging google fails. Sometimes it just fails, sometimes it gives me a host unreachable error. I have tested it with the route changes you posted, and without. Anymore ideas? If not i'll just keep tinkering till I figure something out.

Thanks
Re: Usb tethering?
January 16, 2011 08:12AM
Post the output from route -n before/after connection is active.

Its likely you just need to adjust your routing so ppp0 is the default route.

-PG
Silver
Re: Usb tethering?
January 16, 2011 10:29AM
Here is before
root@debian:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

Making the connection
root@debian:~# pon sprint

root@debian:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.23.6.1       0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0


Changing the routes
root@debian:~# route del -net default eth0
root@debian:~# route add -net default ppp0
root@debian:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.23.6.1       0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
Re: Usb tethering?
January 16, 2011 10:37AM
after connecting and changing routes try...
# reconnect...
poff
pon sprint
# check DNS
cat /etc/resolv.conf
# check connection...
ping news.bbc.co.uk
ping 212.58.244.60
-PG
Silver
Re: Usb tethering?
January 16, 2011 11:04AM
Here is what I get

root@debian:~# cat /etc/resolv.conf
nameserver 170.206.225.21
nameserver 170.206.225.22

root@debian:~# ping news.bbc.co.uk
^C
root@debian:~# ping 212.58.244.60
PING 212.58.244.60 (212.58.244.60) 56(84) bytes of data.
^C
--- 212.58.244.60 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5005ms
Re: Usb tethering?
January 16, 2011 11:19AM
I suspect its connecting fine but then disconnecting before you can use it. You may need to add options to persist/keep-alive/reconnect the session. My phone seems to drop/reconnect automatically.

Have a look at http://ubuntuforums.org/archive/index.php/t-600885.html

Update: The following web page is clearer: http://blog.samat.org/2007/01/28/sprints-evdo-mobile-broadband-on-ubuntu-linux

You may need some of the following in your /etc/ppp/peers/sprint file
crtscts # hardware flow control
lock # lock the serial port
noauth # don't expect the modem to authenticate itself
local # don't use Carrier Detect or Data Terminal Ready
persist # Redial if connection lost
holdoff 5 # Reconnect after 5s on connection loss
lcp-echo-failure 4 # prevent timeouts
lcp-echo-interval 65535 # prevent timeouts
It also shows how to create connect/disconnect chatscripts and fixup the routes automatically on connect/disconnect - but don't worry about this until you get your connection reliable.

-PG



Edited 1 time(s). Last edit at 01/16/2011 11:27AM by petergunn.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: