mark_p n00b
Joined: 03 Nov 2002 Posts: 24
|
Posted: Sat Sep 13, 2003 6:47 pm Post subject: GPRS |
|
|
Hi,
I have a Siemens C55 phone with GPRS. I have subscribed to GPRS service with
EuroTel here in Prague. I can sucessfully use GPRS on the handset to access
WAP sites.
My previous experience with modems and connections is limited to using wvdial
so I began by trying to get it to work with wvdial.
I have confirmed with eurotel that I should use the number *99***1# to
connect with and that the string AT+CGDCONT=1,"IP","internet" is also
necessary.
######################################################################
# File:
# wvdial.conf
#
[Dialer Defaults]
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet"
SetVolume = 1
Dial Command = ATD
Phone = *99***1#
Username = test
Password = test
#######################################################################
[14:31:13 ~]# wvdial --config wvdial.conf
--> WvDial: Internet dialer version 1.53
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> 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.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT
--> Carrier detected. Waiting for prompt.
--> Connected, but carrier signal lost! Retrying...
--> Sending: ATD*99***1#
--> Waiting for carrier.
NO CARRIER
ATD*99***1#
--> No Carrier! Trying again.
--> Sending: ATD*99***1#
--> Waiting for carrier.
CONNECT
--> Carrier detected. Waiting for prompt.
--> Connected, but carrier signal lost! Retrying...
--> Sending: ATD*99***1#
--> Waiting for carrier.
NO CARRIER
...
Next I had a look around the net to see if I could find some more info on it
and I found some scripts for use with pppd and chat. I tried them both
(there was one chat script and another script for wvdial) unsucessfully.
###############################################################################
# File:
# gprs
#
# Description:
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones.
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
connect /etc/ppp/peers/gprs-connect-chat
#connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-wvdial.conf myconnection"
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/peers/gprs-disconnect-chat
# Serial device to which the GPRS phone is connected:
# /dev/ttyS0 for serial port (COM1 in Windows),
# /dev/ircomm0 for IrDA,
# /dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and
# /dev/ttyUSB0 for USB
/dev/ttyS0 # serial port one
#/dev/ttyS1 # serial port two
#/dev/ircomm0 # IrDA serial port one
#/dev/rfcomm0 # Bluetooth serial port one
#/dev/ttyUSB0 # USB serial device, for example Orange SPV
# Serial port line speed
115200 # fast enough
#57600 # perhaps usefull with IrDA
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts # serial cable, Bluetooth and USB
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
:10.0.0.1
# pppd must not propose any IP address to the peer!
noipdefault
# Accept peers idea of our local address
ipcp-accept-local
# Add the ppp interface as default route to the IP routing table
defaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
# Example, Radiolinja operator pap-secrets:
# "rlnet" * "internet" *
#user "test"
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
# No magic:
# some phones may require this option.
#nomagic
# Require PAP authentication:
# some phones may require this option.
#require-pap
############################################################################
# File:
# gprs-wvdial.conf
#
# Description:
# Wvdial settings for different GPRS phones and operators. See wvdial man pages
# for more help. Below are the service specific settings, which should be given
# by the operator - at least the
#
# Set PDP (Packet Data Protocol) context CID (Context ID) = 1 (an index sort of
# since a phone may have many different GPRS settings), protocol = IP,
# APN (Access Point Name) = "internet":
# AT+CGDCONT=1,"IP","internet","",0,0
#
# Set CID=1 QoS (Quality of Service) requirements from the network, not
# supported by Nokia phones:
# AT+CGQREQ=1,0,0,0,0,0
#
# Set CID=1 minimum acceptable QoS parameters, not supported by Nokia phones:
# AT+CGQMIN=1,0,0,0,0,0
#
# Call CID=1 which activate PDP context one and perform GPRS attach:
# ATD*99***1#
#
# Some phones seem to have only one CID, in which case the CID can be omitted
# when calling:
# ATD*99#
#
# Init4 = AT+CGQREQ=1,0,0,0,0,0
# Init5 = AT+CGQMIN=1,0,0,0,0,0
[Dialer myconnection]
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","internet"
#Init4 = AT+CGQREQ=1,0,0,0,0,0
#Init5 = AT+CGQMIN=1,0,0,0,0,0
Dial Command = ATD
Phone = *99***1#
# Keep wvdial happy
Username = internet
Password = internet
######################################################################
#!/bin/sh
#
# File:
# gprs-connect-chat
#
# Description:
# chat script to open Radiolinjas GPRS service with GPRS phones. If ppp
# negotiation stalls, try restarting the phone. To try with other GPRS
# operator setting, change the PDP contex setting. The settings work with
# most Ericsson models, but Nokia 8310 and 30 do not support QoS parameters
# with AT commands, so just delete those lines and it'll work.
#
# Set PDP context CID=1, protocol=IP, APN=internet:
# AT+CGDCONT=1,"IP","internet","",0,0
#
# Set CID=1 QoS requirements from the network, not supported by Nokia:
# AT+CGQREQ=1,0,0,0,0,0
#
# Set CID=1 minimum acceptable QoS parameters, not supported by Nokia:
# AT+CGQMIN=1,0,0,0,0,0
#
# 'Call' CID=1 (activate PDP context one, perform GPRS attach):
# ATD*99***1#
#
# Some phones like the Orange SPV (yes, the Microsoft Smartphone) use this
# dial string to start GPRS connection:
#ATDT*99#
#
# The actual chat script:
exec chat \
TIMEOUT 5 \
ECHO ON \
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 \
SAY "Press CTRL-C to close the connection at any stage!" \
SAY "\ndefining PDP context..\n" \
OK ATZ \
SAY "Sent ATZ" \
OK ATE1 \
SAY "Sent ATE1" \
OK 'AT+CGDCONT=1,"IP","internet"' \
SAY "Sent AT+CGDCONT=1,IP,internet" \
OK ATD*99***1# \
SAY "Dialing with ATD*99***#" \
TIMEOUT 22 \
SAY "\nwaiting for connect...\n" \
CONNECT "" \
SAY "\nConnected." \
SAY "\nIf the following ppp negotiations fail,\n" \
SAY "try restarting the phone.\n"
Here is what happened with the wvdial script.
[12:44:10 /etc/ppp/peers]# pppd call gprs
--> WvDial: Internet dialer version 1.53
--> Initializing modem.
--> Sending: ATH
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATH
ATH
OK
--> Initializing modem.
--> Sending: ATH
ATH
OK
--> Sending: ATE1
ATE1
OK
--> Sending: AT+CGDCONT=1,"IP","internet"
AT+CGDCONT=1,"IP","internet"
OK
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT
--> Carrier detected. Waiting for prompt.
NO CARRIER
--> Don't know what to do! Starting pppd and hoping for the best.
Serial connection established.
using channel 6
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe304c522>]
LCP: timeout sending Config-Requests
Connection terminated.
Sending break to the modem
PDP context detached
Serial link disconnected.
Here is what happened with the chat script.
[12:48:42 /etc/ppp/peers]# pppd call gprs
Press CTRL-C to close the connection at any stage!
defining PDP context..
^@
Connect script failed
I also tried to send the AT commands straight to the modem
via kermit.
[14:42:41 ~]# kermit
C-Kermit 8.0.206, 24 Oct 2002, for Red Hat Linux 8.0
Copyright (C) 1985, 2002,
Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/root/) C-Kermit>set line /dev/ttyS0
Removing stale lock /var/lock/LCK..ttyS0 (pid 3067 terminated)
(/root/) C-Kermit>quit
Closing /dev/ttyS0...OK
[14:42:53 ~]# kermit
C-Kermit 8.0.206, 24 Oct 2002, for Red Hat Linux 8.0
Copyright (C) 1985, 2002,
Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/root/) C-Kermit>set line /dev/ttyS0
(/root/) C-Kermit>set speed 115200
/dev/ttyS0, 115200 bps
(/root/) C-Kermit>set carrier-watch off
(/root/) C-Kermit>c
Connecting to /dev/ttyS0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
atz
OK
AT+CGDCONT=1,"IP","internet"
OK
ATD*99***1#
CONNECT
NO CARRIER
The phone never creates a GPRS connection - or at least
it doesn't display that fact on the handset if it does.
I'm at a bit of a loss and would gladly persue any suggestions anyone
might have.
I'll probably try it with windows next (although its going to be
a lot of hassle!)
Thanks,
Mark. |
|