Home · All Classes · Annotated · Functions

Network Services

Introduction

Qtopia Network Services are defined by files that allow the configuration of Linux system networking services. Once the Network Service is defined the user customizes and starts the Network Service they require via using the Internet Settings application.

How it Works

Qtopia's network support can be configured via Network configuration files in $HOME/Applications/Network/config. The structure and type of these configuration files determines the type of the network.

The following keys are generic to all network types:

The QtopiaNetworkInterface class defines the general interface for plug-ins. Two plug-ins are provided with Qtopia:

  1. Dialup - allows the creation and configuration of network interfaces which require pppd
  2. (W)LAN - allows the creation and configuration of Ethernet and WLAN interfaces

Distribution specific configuration

Unfortunately there is no common way how Linux distributions handle the configuration of network devices. To accomodate for this case Qtopia's network configuration is split into two parts. Each network plug-in handles the generation of configuration parameters and then passes the information on to a network script called <type>-network. This script must be implementated by device integrators in order to enable Qtopia to write its configuration to device specific configuration files. By default, Qtopia provides network script for busybox and SuSE v9.3 systems. If none of the provided scripts is suitable for the target device the template scripts in the plug-in directories can be used as a starting point for new scripts.

The network scripts need root permissions. If Qtopia is started without root permissions a combination of sudo and setuid bit must be used.

The Dialup Plug-in

General configuration

The Dialup plug-in:

The Dialup plug-in makes use of keys in the Network Service configuration file. For further information refer to pppd documentation or the pppd man page.

In addition to the network configuration file each dial-up interface is associated with a couple of files which guide the dial-up process or give reports about the state of the connection.

GPRS

Introduction

General Packet Radio Service (GPRS) is a GSM data transmission technique that transmits and recieves data in packets rather than via a continuous channel.

Qtopia uses the Dialup network plug-in to establishing a connection see : $QPEDIR/src/plugins/networking/dialing/

In the ideal case

GPRS startup procedure

An outline of the mechanism to establish a GPRS connection is provided in the following section. It is assumed that the application Setting->Internet has been used to create a valid GPRS configuration. The following code walkthrough applies to connections which are established via the internal phone modem only. Any other type of serial connection (e.g. via PCMCIA modem cards) does not use the Qtopia phone library and hence uses a slightly different approach.

For detailed description of pppd, please refer to man pppd.

GPRS AT dial string

By default the Dialup plug-in uses the following minimal dial string for GPRS connections:

     dialstring = "AT+CGDCONT=1,\"IP\",\"" + <provider APN> + "\"" + " OK "
            "AT+CGATT=1 OK "
            "OK ATD*99***1#";

This string is not necessarily suitable for all modems. If a GPRS data connection cannot be started this string has to be adjusted to the requirements of the particular modem. It may be necessary to contact the modem manufacturer to determine the dial string that should be used. The dialstring can be customized in $QPEDIR/src/plugins/network/dialing/dialstring.cpp.

PPP network script

The dial-up plug-in uses the system dependent configuration script ppp-network. This script must be provided by system integrators. Whenever the dial-up plug-in requests a system dependent operation it calls ppp-network. It must support the following interface/command line options in order to allow interaction with Qtopia:

The LAN Plug-in

General configuration

The LAN plug-in:

If wireless support is not required the define NO_WIRELESS_LAN can be used to exclude the feature ( see Hardware Configuration ).

The LAN plug-in makes use of the following keys in the Network Service configuration file.

(W)LAN network script

The lan plug-in uses the system dependent network script lan-network. This script must be provided by system integrators. Whenever the lan plug-in requests a system dependent operation it calls ppp-network. It must support the following interface/command line options in order to allow interaction with Qtopia:

The Proxies page

The Dialup and LAN plug-ins share a proxies page. The settings for this page are defined in the configuration as:

Connectivity state of the device

Applications which are interested in the state of devices network interfaces should either use QtopiaNetwork::startOnline(). If more detailed information are required an application can either use the QNetworkState class or it can subscribe to the channel QPE/NetworkState. Please note that the QPE/NetworkState channel is obsolete and will be removed in future releases of Qtopia. The QPE/NetworkState channel supports the following messages which provide information about the state of each individual interface:

Please see $QPEDIR/src/libraries/qtopia/qtopianetwork.cpp for implementation details.

WAP

Qtopia stores WAP settings in $HOME/Applications/Network/wap. Every WAP related application must use these configuration settings. They have several groups, with the following keys:

OTA configuration

Qtopia can handle OTA network configuration messages. These messages contain details like WAP/MMS server and login details. Every received message is handled by the Internet Settings application and will eventually be stored as a WAP/Internet configuration file.

Troubleshooting

Example connect,disconnect scripts

The dial-up process uses chat files. These chat files may need some customization in order to work flawless with particular modems. The chat files are stored in $HOME/Applications/Network/chat. Each interface has a connect and a disconnect chat file. The following two chat files represent rather generic chat files for a GPRS connection.

Enabling Debugging

In order to activate Qtopia's internal network logging facilities you may have to edit $QPEDIR/etc/default/Trolltech/Log.conf or $HOME/Settings/Trolltech/Log.conf. For network debugging you may enable Network and AtChat logging.

Changing the GPRS Packet Size to Compensate for Poor Signal Quality

By default a packet size of 1500 will be used by pppd for GPRS traffic. In cases of poor signal quality it may be necessary to decrease the "mru" and "mtu" packet size being used by pppd, to for 512. See the pppd man page for details on setting mru and mtu values.

Configuration file elements to check/update

  1. check that /etc/ppp/options does not have papcrypt enabled
  2. check the password that may be specified : see /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
  3. check the contents of $HOME/Applications/Network/modules/DialUpGPRS*.conf
  4. check the contents of /etc/ppp/peers/*GPRS*
  5. check that GPRSDialString() in $QPEDIR/src/plugins/networking/dialing/dialstring.cpp suits your modem. For example you may need to use either
    1. AT+CGDCONT=1,"IP" ...
    2. AT+CGDCONT=1,"PPP" ...
  6. update the /etc/ppp/options file to enable debugging and record ALL traffic. eg add
        debug
        record /tmp/ppp-all-text.log
  7. modify the connect-chat, disconnect-chat and startpppd.sh to suit your modem and internet provider : at least

Dialing with the example GPRS Dial script

  1. Ensure that Qtopia and pppd are not running
  2. Start pppd via running startpppd.sh
  3. Ping an non-local address : eg
        ping 216.239.39.99
  4. Confirm that pppd attempts to start the link and review the content of /tmp/ppp-all-text.log
  5. If needed send the recorded traffic as setup in step 2 in a tar.gz to support

Network testing

The following can help to isolate any GPRS issues.

Run the following commands to ping local and non-local resources:

         ping <some IP address on your local network>

         ping 66.102.7.99

         ping <some host on your local network>

         ping www.google.com

It might be necessary to specify the network interface that the ping command should use. If you have more than one network interface and suspect routing issues use:

         ping -I <iface-name> <host>

If one or less of the above tests fail then provide the output of the following commands :

         /sbin/ifconfig -a

         /sbin/ifstatus eth0

         /sbin/route

         cat /etc/resolv.conf

         cat /etc/ppp/resolv.conf

If you have a firewall in use, check that the route uses the correct gateway address and that the firewall is not blocking IP traffic from the device. Lastly it may helpful to compare the results of running the above commands with results given by running the same commands on a development machine.

Requesting Support

If support is needed please ensure that your support request contains the following items:

  1. the peer file ( see /etc/ppp/peers )
  2. the network configuration file ( $HOME/Applications/Network/config/GPRS<peerID>.conf )
  3. the pppd log file ( /tmp/qtopia-0/qpe-pppd-log-<peerID> )
  4. the connect and disconnect chat ( $HOME/Applications/Network/chat/connect-<peerID> )
  5. all parameters passed to pppd (check debug output for network details). Note that network logging may have to be enabled.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7