Manually using GPRS

From Openmoko

Revision as of 14:37, 19 March 2007 by Pavel (Talk | contribs)

Jump to: navigation, search

You need to have GSM parts already initialized, with modem logged in to the network, for this to work. It is best to test it by doing test call.

(Hmm, press 'edit' to see the files, unmangled).

You'll need /etc/ppp/chap-secrets: (I used tabs in this file, I hope that does not matter).

  1. Secrets for authentication using CHAP
  2. client server secret IP addresses

"gprs" * "gprs" *

You'll need /etc/ppp/gprs:

  1. File:
  2. gprs
  3. Description:
  4. This file holds the serial cable and IrDA pppd options for GPRS phones
  1. To give some debug info
  2. debug
  1. Serial device to which terminal is connected;

/dev/ttySAC0 holdoff 3

  1. Serial port line speed

115200

  1. Hardware flow control needs to be used with serial cable.
  2. With IrDA it should be disabled with nocrtscts option.

crtscts # serial cable

  1. nocrtscts # IrDA
  1. To keep pppd on the terminal

nodetach

  1. Connect script

connect /etc/ppp/gprs-connect-chat

  1. IP addresses:
  2. - accept peers idea of our local address and set address peer as 10.0.0.1
  3. (any address would do, since IPCP gives 0.0.0.0 to it)
  4. - if you use the 10. network at home or something and pppd rejects it,
  5. change the address to something else
160.218.160.218
  1. pppd must not propose any IP address to the peer!

noipdefault

  1. Accept peers idea of our local address

ipcp-accept-local

  1. Ignore carrier detect signal from the modem

local

  1. No ppp compression

novj novjccomp

  1. Disconnect script

disconnect /etc/ppp/gprs-disconnect-chat

  1. Add default route

defaultroute

  1. a neco pro udrzeni linky

lcp-echo-interval 300 lcp-echo-failure 40000

user "gprs"

  1. noauth
  2. auth login +chap -pap

And you'll need /etc/ppp/gprs-connect-chat, probably needs "x" bit.

  1. !/bin/sh
  2. File:
  3. chat-gprs-connect
  4. Description:
  5. chat script to open Sonera GPRS service with GPRS phones. If ppp
  6. negotiation stalls, try restarting the phone. To try with other GPRS
  7. operator setting, change the PDP contex setting. The settings work with
  8. all Ericsson models, but Nokia 8310 does not suppor QoS parameters with
  9. AT commands, so just delete those lines and it'll work.
  10. Set PDP context CID=1, protocol=IP, APN=internet:
  11. AT+CGDCONT=1,"IP","internet","",0,0
  12. Set CID=1 QoS requirements from the network, not supported by 8310:
  13. AT+CGQREQ=1,0,0,0,0,0
  14. Set CID=1 minimum acceptable QoS parameters, not supported by 8310:
  15. AT+CGQMIN=1,0,0,0,0,0
  16. 'Call' CID=1 (activate PDP context one, perform GPRS attach):
  17. ATD*99***1#
  18. was "internet.open.s"
  19. V connectu bylo "ip","internet"
  20. The actual chat script:

exec chat \ TIMEOUT 22 \ 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' \ SAY "Press CTRL-C to close the connection at any stage!" \ SAY "\ndefining PDP context...\n" \ "" "\d" \ "" "atz" \ OK "ate1" \ OK 'at+cgdcont=1,"ip","internet","0.0.0.0",0,0' \ TIMEOUT 22 \ OK ATDT*99***1# \ TIMEOUT 22 \ SAY "\nwaiting for connect...\n" \ CONNECT "" \ SAY "\nConnected." \ SAY "\nIf the following ppp negotiations fail,\n" \ SAY "try restarting the phone.\n"

You may need to adjust APN name in at+cgdcont line. Then, after initializing GSM, you should be to initialize GPRS by pppd file /etc/ppp/gprs. Good luck!

Personal tools

You need to have GSM parts already initialized, with modem logged in to the network, for this to work. It is best to test it by doing test call.

(Hmm, press 'edit' to see the files, unmangled).

You'll need /etc/ppp/chap-secrets: (I used tabs in this file, I hope that does not matter).

  1. Secrets for authentication using CHAP
  2. client server secret IP addresses

"gprs" * "gprs" *

You'll need /etc/ppp/gprs:

  1. File:
  2. gprs
  3. Description:
  4. This file holds the serial cable and IrDA pppd options for GPRS phones
  1. To give some debug info
  2. debug
  1. Serial device to which terminal is connected;

/dev/ttySAC0 holdoff 3

  1. Serial port line speed

115200

  1. Hardware flow control needs to be used with serial cable.
  2. With IrDA it should be disabled with nocrtscts option.

crtscts # serial cable

  1. nocrtscts # IrDA
  1. To keep pppd on the terminal

nodetach

  1. Connect script

connect /etc/ppp/gprs-connect-chat

  1. IP addresses:
  2. - accept peers idea of our local address and set address peer as 10.0.0.1
  3. (any address would do, since IPCP gives 0.0.0.0 to it)
  4. - if you use the 10. network at home or something and pppd rejects it,
  5. change the address to something else
160.218.160.218
  1. pppd must not propose any IP address to the peer!

noipdefault

  1. Accept peers idea of our local address

ipcp-accept-local

  1. Ignore carrier detect signal from the modem

local

  1. No ppp compression

novj novjccomp

  1. Disconnect script

disconnect /etc/ppp/gprs-disconnect-chat

  1. Add default route

defaultroute

  1. a neco pro udrzeni linky

lcp-echo-interval 300 lcp-echo-failure 40000

user "gprs"

  1. noauth
  2. auth login +chap -pap

And you'll need /etc/ppp/gprs-connect-chat, probably needs "x" bit.

  1. !/bin/sh
  2. File:
  3. chat-gprs-connect
  4. Description:
  5. chat script to open Sonera GPRS service with GPRS phones. If ppp
  6. negotiation stalls, try restarting the phone. To try with other GPRS
  7. operator setting, change the PDP contex setting. The settings work with
  8. all Ericsson models, but Nokia 8310 does not suppor QoS parameters with
  9. AT commands, so just delete those lines and it'll work.
  10. Set PDP context CID=1, protocol=IP, APN=internet:
  11. AT+CGDCONT=1,"IP","internet","",0,0
  12. Set CID=1 QoS requirements from the network, not supported by 8310:
  13. AT+CGQREQ=1,0,0,0,0,0
  14. Set CID=1 minimum acceptable QoS parameters, not supported by 8310:
  15. AT+CGQMIN=1,0,0,0,0,0
  16. 'Call' CID=1 (activate PDP context one, perform GPRS attach):
  17. ATD*99***1#
  18. was "internet.open.s"
  19. V connectu bylo "ip","internet"
  20. The actual chat script:

exec chat \ TIMEOUT 22 \ 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' \ SAY "Press CTRL-C to close the connection at any stage!" \ SAY "\ndefining PDP context...\n" \ "" "\d" \ "" "atz" \ OK "ate1" \ OK 'at+cgdcont=1,"ip","internet","0.0.0.0",0,0' \ TIMEOUT 22 \ OK ATDT*99***1# \ TIMEOUT 22 \ SAY "\nwaiting for connect...\n" \ CONNECT "" \ SAY "\nConnected." \ SAY "\nIf the following ppp negotiations fail,\n" \ SAY "try restarting the phone.\n"

You may need to adjust APN name in at+cgdcont line. Then, after initializing GSM, you should be to initialize GPRS by pppd file /etc/ppp/gprs. Good luck!