![]() Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
![]() |
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.
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 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.
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 makes use of the keys in the Network
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 Dial-up and LAN plug-ins share a proxies page. The settings for this page are defined in the configuration as:
General Packet Radio
Qtopia uses the Dial-up network plug-in to establishing a connection see : $QPEDIR/src/plugins/networking/dialup/
In the ideal case
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
Add the following code to function initApplication(...) located in $QPEDIR/src/server/main.cpp:
Network::createServer(s);
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.
examineNetworks() Network::start(*it);
Network::start(...) start(QString,QString)
void receive(...)
start(file,password)
NetworkInterface* plugin = Network::loadPlugin(type); plugin->start(cfg,password);
DialupImpl::start(...) PhoneLine line; ... line.startData(number, init, args, demand);File location: $QPEDIR/src/plugins/network/dial-up/dial-up.cpp
Statement line.startData(...)
PhoneLineAt::startData(...)
mux->startProtocolModule(...)to start the pppd daemon. File location: $QPEDIR/src/libraries/qtopiaphone/phoneat.cpp.
mux->startProtocolModule(... )File location: $QPEDIR/src/libraries/qtopiaphone/muxdevice.cpp.
This connect script sends the QCop message dial() to QPE/pppd and waits for dialResult(boot) from QPE/pppd.
PhoneLineAt::pppdListen()sends the QCop message dialResult(...) to QPE/pppd.
For further GPRS information please refer to: Qtopia GPRS Networking
Scripts can be provided on request and may be customized to suit your device and GPRS provider. For example:
ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT BUSY # Change the word internet to the name of your providers APN "" "AT+CGDCONT=1,\"IP\",\"internet\"" OK "AT+CGATT=1" OK "ATDT*99***1#"
\d+++\d\c OK ATH0 OK
#!/bin/sh # # Start a pppd session via GPRS # # Usage: # startpppd.sh [PPP peer to call] # # The following notes apply to the pppd options used. See the pppd man page for more details # ttyS0 : change to the device that modem is connected to # 115200 : lower modem speed if required # noipdefault: pppd must not propose any IP address to the peer! # ipcp-accept-local : Accept peers idea of our local address # modem : use modem control lines; change modem to local if required # novj : Disable all compression # record /tmp/ppp-all-text.log : record all traffic to file shown set -x if [ -z "$1" ]; then /usr/sbin/pppd \ ttyS0 \ 115200 \ connect 'chat -s -v -f connect-chat' \ disconnect 'chat -s -v -- -f disconnect-chat' \ crtscts \ defaultroute \ replacedefaultroute \ noipdefault \ ipcp-accept-local \ modem \ usepeerdns \ demand \ connect-delay 5000 \ idle 120 \ nodetach \ lcp-echo-failure 0 \ lcp-echo-interval 0 \ novj \ nobsdcomp \ novjccomp \ nopcomp \ noaccomp \ debug else # call the specified peer /usr/sbin/pppd call $1 \ connect 'chat -s -v -f connect-chat' \ disconnect 'chat -s -v -- -f disconnect-chat' \ record /tmp/ppp-all-text.log \ debug fi
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
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.
debug record /tmp/ppp-all-text.log
ping 216.239.39.99
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.
If support is needed please ensure that your support request contains the following items:
Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|