6 Software
User Manual 49/374
6.4.1.1 GPRS / Peer-To-Peer
The easiest way to establish an internet connection via the GPRS interface is to activate and configure the
network daemon.
Network daemon configuration file (see "Network daemon" on page 100)
High Level Hardware Access
This chapter describes the user space interfaces for the Peer-To-Peer connection that can be established over
the GPRS modem.
Linux provides the Point-to-Point Protocol daemon (pppd) to manage internet links that can be established over
dial-up modems, DSL connections, and other types of point-to-point links.
Automatically detection of the correct provider settings.
After starting the modem, the TC1 tries to detect the correct provider settings automatically. In order to do this,
the mobile country code (MCC) and the mobile network code (MNC) are requested from the modem. The
combination of both results in a unique number which identifies your mobile provider.
In the next step, the daemon searches for the received provider identification number in the /etc/apns-conf.xml
file. This file contains a list of well known mobile providers around the world. If the corresponding provider is
found in the list, then the configuration data are written to /tmp/apn.setting. The modem is ready to use now.
Since network providers change their access point configuration from time to time, the list might not always
have the latest configuration information. In that case, the generated /tmp/apn.setting file provides an incorrect
configuration too and the ppp connection fails.
There are two options to handle that issue:
Set GPRS parameters manually in the file /etc/init.d/rc.conf
If you never want to change your mobile provider, than set the necessary provider informations. This
mechanism disables the automatically detection of the provider settings.
Disadvantage: After changing the SIM card, for example you use a different provider, the settings from the file
/etc/init.d/rc.conf do not fit and the ppp connection will fail.
# Access Point Name from provider
export GSM_APN="ProviderAPN"
# User name from provider
export GSM_User="ProviderUser"
# Password from provider
export GSM_Password="ProviderPass"
# Service Center Address, i.e. your SIM card number from provider
export GSM_SCA="00491710760000"
# DNS you want to connect to from provider, if needed.
export GSM_DNS=""
Create your own apns-conf.xml file in the NAND dataflash
The much more convenient way is to create your own apns-conf.xml file and store it in the NAND dataflash. If
the NAND dataflash is mounted (typically behavior of the TC1), then the daemon checks if the
"/mnt/dataflash/stw/modem" directory structure is available.
Place your own "apns-conf.xml" file into the "/mnt/dataflash/stw/modem" directory. Also place a "apn-
default.xml" file into this directory.
Search mechanism of the daemon:
The daemon searches the received provider identification number in the customer xml file
"/mnt/dataflash/stw/modem/apns-conf.xml".
If the correct ID is not found, then the daemon parses the "etc/apns-conf.xml" file.
If there is also no entry found that contains to the received ID, the daemon looks for the
"mnt/dataflash/stw/modem/apn-default.xml" file.