新闻  |   论坛  |   博客  |   在线研讨会
GPRS建立连接的过程
yanqin | 2009-04-17 10:18:39    阅读:2330   发布文章

1- Getting attached:
By default, the MS starts up in class CG (i.e. in GPRS mode and not in GSM mode).
So after entry of the PIN code (if any), it will attempt to attach to the GPRS network.

The user can check whether the MS is attached by entering:
AT+CGREG?

The response +CGREG:0,1 means the MS is successfully attached.
The response +CGREG:0,0 means the MS is trying to attach.
The response +CGREG:0,2 has failed to attach and stopped trying to attach. This occurs approx. within 2 min of powering up.

2- Defining a PDP (Packet Data Protocol) context:
Before setting up a session, a PDP context has to be defined.

This procedure has to be done only once (or after all objects in flash have been erased).
So even though a new firmware and w.e2p file are downloaded, the PDP contexts still remain.

The following command is used for that purpose:
AT+CGDCONT=1,"IP","apn"

whereby apn is a string parameter suppplied by the GPRS operator and specifies the gateway to be used between the GPRS network and the internet realm.

If no APN is provided, simply type in:
AT+CGDCONT=1,"IP"

"IP" means that all data exchanged between the MS and the network are IP packets. This is the only type supported rigth now.

Other optional parameters are not relevant for the time being.

In this step, no error should occur.

3- Defining a Quality of Service (QoS) profile
The QoS consists of a set of 5 parameters (delay, precedence, reliability, mean throughput, peak throughput), which allow the user to reach a trade-off between contradictory features.
For instance, depending on the application the user can favor a better reliability at the expense of the throughput.

For the moment, the QoS is usually ignored by the network, which provides a best-effort service.

However, one parameter matters more than the others: the reliability parameter, which determines whether the LLC and RLC layers offer acknowledged or un-acked service.
For the time being this firmware only supports LLC unacked mode and RLC acked mode.
So the QoS shall be defined as follows:
AT+CGQREQ=1,0,0,3,0,0

The first ‘1‘ is the number of the PDP for which the QoS is to be defined.
‘0‘ means the corresponding parameter will be set by the network upon session activation.
‘3‘ sets the reliability to LLC unacked and RLC acked.

Like AT+CGDCONT, this command has to be entered only once, just after defining a context.

In this step, no error should occur.

4- Activating a session w/o transferring data
For the first experiment, it could be useful to activate a session without entering the online mode. It is done with:
AT+CGACT=1,1

Which activates the context number 1.
If OK is returned then everything is fine.
if ERROR is returned, see Troubleshooting section

Try deactivating the session with
AT+CGACT=0,1

It‘s better a reboot the MS and perform again step 1- before moving on to step 5-.

5-  Activating a session and transferring data
At this point, things get a little bit more complicated.

But please, before going on further be sure that step 4- is successful. If not successful, it will be easier to investigate in step 4- than in step 5-.

Since the MS has no embedded applications, the transfert of data must be carried out using a PC hooked into the MS via a serial cable.

Defining a remote dial-up connection

On the PC side, a remote dial-up connection has first to be defined. Following instructions are only applicable with W95/W98:

a) Click on the MyComputer icon on the desktop
b) Select dial-up networking
c) Select Make New connection
d) Enter the name of the connection
e) Select a ‘standard 19200‘ and configure the max speed to 115200 (after clicking the ‘configure‘ button) and the COM according to your needs.
f) proceed to the next screen
g) leave the area code field blank, do not alter the country code field and type in the telephone number field : *98*1# (star 98 star 1 gate).
Note: enter 0 in the area code if Windows complains that it is empty.
h) Hit Next and Finish.
i) On the window displaying dialup connection icons, rigth-click on your brand new connection icon and select ‘properties‘.
h) On the ‘General‘ tab, be sure to uncheck the ‘Use country and area code‘ item.
g) On the ‘Server types‘ tab, uncheck everything except the last ‘TCP/IP‘ item.
i) Hit ‘TCP/IP settings‘ button
Activate ‘Click on ‘Server assigned IP address‘
Activate ‘Specify name server addresses‘ and then enter the DNS IP addresses supplied by the GPRS operator.
Uncheck ‘IP header compression‘
Be sure ‘Use default gateway‘ is checked.
j) Press OK and OK from the main menu.
k) You‘re done with your PPP connection

Activating your dialup connection
Before activating your connection, check that the MS is registered into the network.
For that purpose launch HyperTerminal and proceed as described in step 1-.
Also be sure the serial rate of MS is set to 115200 baud
If not, issue AT+IPR=115200;&W
Then close HyperTerminal.

Double-click on your dialup connection icon.
Leave the ‘user‘ and ‘password‘ field empty unless the GPRS operator supplies them.
Hit ‘Connect‘.

Normally, if everything‘s going smoothly the dialup window should go down to the task bar at bottom right corner of the screen as a deamon icon.

Browsing the Web
At this stage, you can fire your preferred web browser.
Just be sure to configure it to use a direct connection(ie no proxy):
With Netscape, it‘s done through the menu Edition -> Preferences -> advanced -> proxy.
With IE, get by yourself !

Using FTP
The vanilla FTP client from Window could be used to download files.
Just run it (ftp.exe) and enter open URL_of_my_site and then type in ‘cd‘, ‘dir‘ and ‘get‘ to navigate through the site and download files.

6- Troubleshooting
As already mentionned, this version is a beta version so expect some failures every so often or total failure on some networks!
So bear with us.

Unfortunalety, if you experience a failure (to attach, to activate a session, etc) , there aren‘t many workarounds you can try.

Failure to log onto the GPRS network.
See section ‘Making traces‘

Failure to activate a session
If you had entered AT+CGQREQ=1,0,0,3,0,0 then try with AT+CGQREQ=1,0,0,0,0,0 and vice-versa.
See section ‘Making traces‘

7) Making traces

Traces can be done using Moka or Hapc.

7a) During attachment and session activation
Traces are done as usual,
AT commands are entered through INCA.
Moka and Hapc could be used.

However with Moka, the init files containing the
trace definition have to be updated
for the new GPRS trace definitions.

To do so, copy the Moka/workspace/gprs_gsm directory
from the zip archive to the ‘workspace‘ directory
where Moka is installed and then update Moka
default profile to the ‘gprs_gsm‘ profile.

Useful trace level from Step 1) and step 4) are:
GMM: 3 4
SM: 3 4
RR: 3 4
SPV: 1
RLU:1
RLD:8
GRR: 3 4 7 8 13 19 20

7b) During data transfert
Much more touchy.

Tracing during data transfert can be done
by using the Moka‘s  "remote serial port" feature.
This feature requires two PCs: a trace PC, and a client PC.

Hapc cannot be used.
Get the latest  version of Moka.

The trace PC runs Moka suite, whereas
the client PC runs legacy applications (like the dialup
connection and web browser).

The MS is connected to the trace PC on, say, COM1.
Data, AT commands and traces are multiplexed over
the serial link using a proprietary protocol.
Then the trace PC extracts traces from that flow and handles them
as usual, while data, AT cmd/rsp are passed down to the
redirection port (named external port), say, COM2, but in plain V.25bis
format.
The client PC is simply hooked onto the COM2 of the trace PC through
a null-modem cable.

The redirection COM is configured by INCA, via the ‘external com‘ menu.

Before launching the dial-up connection on the client PC, just open the
COM in offline mode still via the INCA‘s ‘external com‘ menu.

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
推荐文章
最近访客