Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference

Qtopia 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

Network Service Files are standard Qtopia configuration files. They have three groups, with the following keys:

The NetworkInterface class defines the interface for plug-ins. Two plug-ins are provided with Qtopia: "Dial-up" and "LAN", which configure pppd and ethernet respectively.

The Dial-up Plug-in

The Dial-up plug-in:

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

The field names supported by the Hide and ReadOnly keys are below. Note that entire tabs can be hidden by adding the tab name to Hide.

GPRS AT dial string

By default the Dial-up 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 that for you to contact the modem manufacturer to determine the dial string to use in

DialupImpl::dialString(Config&) in $QPEDIR/src/plugins/network/dialup/dialup.cpp

The LAN Plug-in

The LAN plug-in:

The LAN plug-in makes use of the keys in the Network Service configuration file. For further information refer to: PCMCIA documentation.

The Hide and ReadOnly keys are not supported at this time.

Some Linux distributions ship network.opts, iwlan-ng.opts, and wireless.opts with many partial configurations. These will override all settings created by Qtopia, which inserts its configurations before the final "*,*,*,*)" catch-all configuration.

The Proxies page

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

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 Dial-up network plug-in to establishing a connection see : $QPEDIR/src/plugins/networking/dialup/

In the ideal case

  1. The user runs the Internet application and configures a GPRS connection
  2. The user selects the newly created GPRS connection and it starts dialing
  3. GPRS is established and Internet traffic can occur

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 GPRS Service that has at least value for the APN field and optionaly a user name/password.

  1. Create Network Server

    Add the following code to function initApplication(...) located in $QPEDIR/src/server/main.cpp:

       Network::createServer(s);
    

  2. Create object NetworkServer.

    Add the following code to function Network::createServer(...):

      void Network::createServer(QObject* parent)
      {
      ns = new NetworkServer(parent);
      }
    
    File location: $QPEDIR/src/libraries/qtopia/network.cpp.

  3. Create QCopChannel QPE/Network and start a timer using NetworkServer(QObject* parent) and timerEvent(). File location: $QPEDIR/src/libraries/qtopia/network.cpp

  4. Start the network
     examineNetworks()
     Network::start(*it);
    

  5. Send QCop message to Channel QPE/Network
     Network::start(...) 
     start(QString,QString)
     
    

  6. NetworkServer will receive this QCop msg and calls:
      void receive(...)
    

  7. Function receive(...) then calls
     start(file,password) 

  8. Load plug-in using:
     NetworkInterface* plugin = Network::loadPlugin(type);
     plugin->start(cfg,password);
    

  9. Prepare for the full dial control string:
     DialupImpl::start(...) 
     PhoneLine line;
     ...
     line.startData(number, init, args, demand);
    
    File location: $QPEDIR/src/plugins/network/dial-up/dial-up.cpp

  10. Send QCop message to phoneServer
     Statement line.startData(...) 

  11. phoneServer calls
     PhoneLineAt::startData(...) 

  12. PhoneLineAt::startData(...) calls
     mux->startProtocolModule(...) 
    to start the pppd daemon. File location: $QPEDIR/src/libraries/qtopiaphone/phoneat.cpp.

  13. fork and exec a new process and pppd using:
     mux->startProtocolModule(... ) 
    File location: $QPEDIR/src/libraries/qtopiaphone/muxdevice.cpp.

  14. pppd starts with connect script qtopia-dial-internal().

    This connect script sends the QCop message dial() to QPE/pppd and waits for dialResult(boot) from QPE/pppd.

  15. When the dial() QCop message is received:
     PhoneLineAt::pppdListen() 
    sends the QCop message dialResult(...) to QPE/pppd.

  16. The connect script successfully returns when the message dialResult(...) is received, and pppd will begin to IP configuration.

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

For further GPRS information please refer to: Qtopia GPRS Networking

Troubleshooting

Example connect,disconnect scripts

Scripts can be provided on request and may be customized to suit your device and GPRS provider. For example:

Enabling AT Command Debugging

A debug build of Qtopia will cause all AT commands being used to be printed to standard output. If required re-build Qtopia with debugging enabled via running :

    cd $QPEDIR
    make distclean
    ./configure  -debug <extra options>
    make
    make cleaninstall

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 Dial-upImpl::dialString in $QPEDIR/src/plugins/networking/dial-up/dial-up.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

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/modules/DialUpGPRS*.conf )
  3. the pppd log file
  4. the connect chat
  5. all parameters passed to pppd


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.2.0