GPRS, CDPD HowTo
- Introduction
- Using a General Packet Radio Service (GPRS) card
- Using a SonyEricsson t200
- Using a Cellular Digital Packet Data (CDPD) card
Introduction
In GPRS/CDPD, the cards are modems in the true technical sense, but not in the popular sense. ie: they don't dial a PSTN phone number, receive a carrier, negotiate a speed, and pass serial data back and forth.
The cards talk to a cellular base station using cellular packets. Inside those packets are IP datagrams and the base stations route those datagrams onto the Internet. The client does not speak 'ppp' to the base station. The client speaks ppp only to the card. The card de-ppp's the packets, re-wraps them into either CDPD or GPRS packets, and transmits them out the antenna to the base-station. The cards present a PPP interface to the client so as to make it easier to configure drivers for client operating systems. As you see, there are no modifications required to NetBSD utilities, just configurations.
In the case of GPRS, the modem has (I think) 5 provider configurations. You configure one of those configurations for each service provider you are signed up with. There are some parameters you specify using "AT" commands.
CDPD also is setup using AT commands but there is only one configuration for each provider.
'kermit' can be used to send the initial AT configuration commands to the modem (once, after receiving the modem from the manufacturer). Once the modem is configured, you never need to use 'kermit' again. Supposedly a person could use 'tip' since it's part of the distribution but it's more difficult to explain how to set it up and how to use it in a document. The configuration of the modems themselves is beyond the scope of this document, please check your vendor's documentation. With GPRS etc. evolving, it's possible the provider will pre-configure the cards for their customers or provide them with a cheat-sheet. In all likelihood, just like a cellphone, when you buy it from a provider, they will do the setup for you.
In any case, the command which initiates PPP is model specific.
Using a General Packet Radio Service (GPRS) card
To use the NovatelWireless GPRS wireless data card, you must first configure the card according to the manufacturer and provider settings. Please contact your provider. Tested GPRS cards include NovatelWireless Merlin G100 and NovatelWireless Merlin G201.
Once you have done this, a few files need to be edited. These are:
After that, start with the following commandline:
pppd file /etc/ppp/options.gprs
This will cause the card to attach to the default provider as configured into your card. To connect to a different provider configured into a different config slot in the card, you will have to modify the "ATDT" string in /etc/ppp/chatscript.gprs according to the documentation provided by NovatelWireless.
As documentation for these cards is not easily found anymore, these are typically the only settings you will ever need to do, where 'apn' is the APN (Access Point Name) supplied to you by your mobile operator and 1234 is the PIN number for your SIM card:
at+cgdcont=1,"IP","apn" at+cpin=1234
Modify the tty in /etc/ppp/options.gprs as appropriate. For a typical laptop with a builtin modem, com port and IR port, the NovatelWireless modem will appear as tty03. If your provider doesn't automatically send you DNS configuration upon connection you will have to remove the `usepeerdns` option to be able to connect.
Also, make sure to modify /etc/ppp/chap-secrets with your username and password as supplied to you by your provider.
See the networking documentation for more information on using PPP networking with NetBSD.
-
/dev/tty03 115200 defaultroute ipcp-accept-local ipcp-accept-remote noauth novj connect 'chat -v -f /etc/ppp/chatscript.gprs' user dummy usepeerdns mru 1500 mtu 1500
-
ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR '' AT OK 'ATDT*99#' CONNECT
-
* * "dummy"
Using a SonyEricsson t200
The following information was provided by Andrew Cagney:The SonyEricsson t200 GPRS phone has it's serial baud rate wired to 9600. It doesn't drop the GPRS connection when pppd disconnects, and finally the USB phone cable provided doesn't appear to work under Netbsd at this point in time.
The last problem can be worked around by using a USB<->serial cable and connecting that to the SonyEricsson. The first two problems can be worked around/solved by including an init, connect and disconnect script in the options or peers file:
115200 init "/etc/ppp/chat/t200.sh" connect "chat -v -f /etc/ppp/chat/t200" disconnect "chat -v -f /etc/ppp/chat/hup"
Then, t200.sh should contain:
#!/bin/sh # Find out the intended baud rate b=`stty -g | sed -e 's/.*ispeed=//' -e 's/:.*//'` # Force the serial line to 9600 baud so that it can be re-configured stty 9600 # Ask for the modem to list all baud rates, and the current one. Then # force it to the rate the line was originally set to. if chat -v \ TIMEOUT 5 '' \ +++AT OK \ AT+IPR=? OK \ AT+IPR? OK \ AT+IPR=${b} OK then stty ${b} exit 0 else exit 1 fiThe file t200 should contain:
ABORT BUSY ABORT ERROR ABORT 'NO CARRIER' ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' TIMEOUT 10 '' AT OK--AT--OK # Ask the modem its baud rate - a sanity check AT+IPR=? OK AT+IPR? OK # connect ATDT*99# CONNECT
And, finally, the hup file should read:
TIMEOUT 2 '' +++ATH OK
Using a Cellular Digital Packet Data (CDPD) card
Using the NovatelWireless CDPD wireless data card, you must first configure the card according to the manufacturer and provider settings. Please contact your provider. The only card tested so far is the NovatelWireless Merlin CDPD.
Again, a few files need configuration. These are:
Once this is done, call the following commandline:
pppd file /etc/ppp/options.cdpd
Modify the tty in /etc/ppp/options.cdpd as appropriate. For a typical laptop with a builtin modem, com port and IR port, the NovatelWireless modem will appear as tty03.
See the networking documentation for more information on using PPP networking with NetBSD.
-
/dev/tty03 115200 defaultroute ipcp-accept-local ipcp-accept-remote noipdefault novj noauth connect 'chat -v -f /etc/ppp/chatscript.cdpd' mru 1500 mtu 1500
-
ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR '' AT OK 'AT\\APPP' CONNECT