Configuration of the pppd daemon
For months the mobile connection has been awful: incessant disconnections, loss of traffic after one minute of being connected.
However, by reading a little, something I should have done before, and modifying certain parameters of the configuration files of the PPP daemon (Point to Point protocol) I have managed to get a connection that can be called usable.
I read that they recommended reducing the MTU, which by default is 1500.
# ip link set ppp0 mtu 472
Since I did not have the ip command, and after consulting man pppd, the MTU value can be changed in the /etc/ppp/options file
# Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer
# requests a smaller value via MRU negotiation, pppd will request that
# the kernel networking code send data packets of no more than n bytes
# through the PPP network interface.
mtu 472
Configuration of the connection.
I make the connection with Yoigo or Simyo by connecting the mobile phone over USB:
To check that it has been detected by the operating system, we can look at the messages by running dmesg. We will see something like this if it has been detected.
dmesg
[...]
usb 4-1: USB disconnect, address 11
usb 4-1: new full speed USB device using uhci_hcd and address 12
usb 4-1: configuration #3 chosen from 1 choice
cdc_acm 4-1:3.1: ttyACM0: USB ACM device
cdc_acm 4-1:3.3: ttyACM1: USB ACM device
To connect we use wvdial, for that we configure .wvdialrc in our user folder ($HOME) or in /etc/wvdial.conf
[Dialer Yoigo]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”internet”
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Phone = *99***1#
Username = “internet”
Password = “internet”
Stupid Mode = 1
Ask Password = 0
Dial Command = ATDT
Compuserve = 0
Force Address =
Idle Seconds = 3000
DialMessage1 =
DialMessage2 =
Auto DNS = 1
[Dialer Simyo]
Modem = /dev/ttyACM0
Phone =*99***2#
Username=''
Password=''
We edit the /etc/ppp/peers/wvdial file and put the following:
noauth
debug
defaultroute
noipdefault
usepeerdns
Notes about the configuration
If we look in detail, the Yoigo configuration uses Phone =*99***1#, and the Simyo one uses Phone=*99***2#. Why is this? This could be different depending on your phone, and it is because those connections are defined in that order on the phone.
For example: for a Sony Ericsson K610i we go to its menu:
Settings, Connectivity, Data comm., Data accounts.
We create 2 accounts with these parameters.
InternetYoigo
APN: internet
InternetSimyo
APN: gprs-service.com
The other parameters are left blank.
We see that InternetYoigo has been assigned the external ID 1, and
InternetSimyo the 2 (in your case it could be different).
So, if we keep changing the SIM in our phone and sometimes we use the Yoigo one and sometimes the Simyo one, there has to be a way to specify which connection to use when we connect the mobile phone to the PC. The way to specify it is through the phone number that the computer will dial when making the connection, which will be different according to the external ID we talked about earlier.
Example for InternetYoigo (external ID 1):
Phone = \*99\*\*\*1#
Example for InternetSimyo (external ID 2):
Phone = \*99\*\*\*2#
Connecting
To connect it will be enough to run: wvdial Yoigo or wvdial Simyo
# wvdial Yoigo
--> WvDial: Internet dialer version 1.56
--> 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
--> Sending: AT+CGDCONT=1,"IP","internet"
AT+CGDCONT=1,"IP","internet"
OK
--> Modem initialized.
--> Idle Seconds = 3000, disabling automatic reconnect.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
~[7f]}#@!}!}!} }8}#}$@#}(}"}'}"}"}&} } } } }%}&_zl^[19]K~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Nov 4 00:20:31 2008
--> Pid of pppd: 17030
--> pppd: P™ð
--> Using interface ppp0
--> pppd: P™ð
--> Authentication (PAP) started
--> pppd: P™ð
--> Authentication (PAP) successful
--> pppd: P™ð
--> local IP address 10.9.128.15
--> pppd: P™ð
--> remote IP address 217.168.3.130
--> pppd: P™ð
--> primary DNS address 10.8.0.21
--> pppd: P™ð
--> secondary DNS address 10.8.0.20
--> pppd: P™ð
--> Script /etc/ppp/ip-up run successful
--> Default route Ok.
--> Nameserver (DNS) Ok.
--> Connected... Press Ctrl-C to disconnect
It is likely that we have other network interfaces on the computer; if we want to use the connection with the ppp0 interface, and not use the other interfaces, before running “wvdial Yoigo” it is advisable to run
# route del default
to delete the connection we had by default before.
Browsing with the internal browser of the mobile phone
To be able to use the browser you have on the mobile phone, the connection has to be configured.
Example for a Sony Ericsson K610i: in Settings, Connectivity, Internet settings, Internet profiles, New profile:
** simyo**
Connect using: InternetSimyo
Use proxy: Yes
Proxy address: 217.18.32.181
Port number: 8080