PHARscape

  • Home
    • Search
    • Login....
  • Linux and 3G
    • Software
      • Option Software
        • Hso driver
        • Rezero
        • Nozomi driver
        • Ozerocdoff
      • PHARscape Software
        • Hsolinkcontrol
        • HSOconnect
          • Downloads
        • comgt
      • Other software
        • Gnome NetworkManager
        • Option driver
        • Usbserial driver
        • USB_modeswitch
        • UMTSmon
        • Wader
    • HOW-TOs
      • HSOconnect Fedora 9
      • HSOconnect Ubuntu 8.04
      • NetworkManager How-To
      • Older HOW-TOs
        • GlobeTrotter (GPRS) HOW-TO
        • GlobeTrotter Fusion (UMTS/WLan) HOW-TO
        • Vodafone 3G (UMTS) HOW-TO
    • APN - Access Point Name
    • Linux Basics
    • DKMS and the HSO driver
  • USB modems
    • iCon 225
    • AT&T Quicksilver
    • AT&T Velocity - GPS and Linux
    • iCon 7.2
  • Datacards
    • Vodafone E3730
    • GE441 and GE442
    • Datacards (hso.ko)
    • Nozomi HSDPA 1.8 Datacards
    • Datacards (option.ko)
    • Datacards (serial modems)
    • Archive - old product table
  • Modules
    • GTM378
  • Getting Help
    • Contact me
  • Diversions
    • Linux and 3G Blog
    • PHARspace
      • Astrophotography
        • Solar System
          • The Sun
          • Venus
          • The Moon
          • Jupiter
          • Mars
          • Saturn
          • Uranus and Neptune
          • Comets
        • Deep Sky Objects
          • Nebula
          • Galaxies
          • Globular Clusters
      • Equipment
      • SPC900 Amp-off Sandwich
      • HEQ5 NGC 7662 Webcam LX video
      • Back to PHARscape
  • The Forums -->
`
Home » Linux and 3G » Software » PHARscape Software » comgt

comgt - a command line utlity for 3G devices

Visit the comgt Support Forum

All of the 3G devices that we use to connect to the Internet have a serial modem like interface. These devices are controlled and managed over that interface using what are known as AT commands.

The purpose of comgt is to control these modems by sending AT commands. There are many command line utilities for communicating with the serial interface but comgt has many special features that make it very useful for 2G and 3G device control.

[comgt was previously known as gcom but for legal reasons I had to change the name.]

Development work has now stopped on comgt but is is still being used. Visit the comgt forum for more examples of how it can be used.

Using comgt

To use comgt you need to get the source file and compile the code for your system. This is very easy to do and only takes a few minutes. Before you start check that you have a C compiler installed. Open up a command terminal  and type the following command:

which gcc

If gcc is installed Linux will respond with its location:

/usr/bin/gcc

If gcc is missing then nothing will be displayed and you will need to use your distribution's software package manager to install it.

Download comgt

You can get the source package from Sourceforge.

Compiling

Open up a terminal and cd to the location of the the downloaded file. Then follow the following sequence to compile the comgt:

tar zxf comgt.0.32.tgz

cd comgt.0.32/

ls
CHANGELOG  comgt.c  COMPILING  gprs.txt  MANIFEST  sigmon.1  umts.txt
comgt.1    comgt.h  gpl.txt    Makefile  scripts   TODO

make
cc comgt.c -c
cc comgt.o  -o comgt

Installing

The following command will install comgt in to the correct location. Notice that you must run the install as the root user so I use the sudo command to get temporary root privileges:

sudo make install
chmod a-w comgt
chmod u+rw comgt
chmod a+x comgt
cp comgt  /usr/local/bin
chmod a-wx comgt.1 sigmon.1
chmod u+rw comgt.1 sigmon.1
chmod a+r comgt.1 sigmon.1
cp comgt.1 sigmon.1 /usr/share/man/man1
mkdir /etc/comgt/
chmod a-w /etc/comgt/
chmod u+rw /etc/comgt/
chmod a+x /etc/comgt/
cp -f ./scripts/* /etc/comgt/ble
chmod a-w /etc/comgt/*
chmod u+rw /etc/comgt/*
chmod a+x /etc/comgt/*

On some systems (e.g. Suse) you would use the su command to give the terminal super user root privileges before typing the make install command

Using it

The simplest command is

comgt

which searches for compatible devices and tries to talk to them. If the device needs a PIN then you are asked to enter the PIN.

When you get a report that the device is registered on a network then you know things are working!

comgt
Trying list of devices

Enter PIN number: ****
Waiting for Registration..(120 sec max)....
Registered on Home network: "vodafone UK",0
Signal Quality: 23,0

Some of the newer device use ports that comgt does not have in its list but you can still control these devices using the -d control.

For example, the devices using the hso driver can be controlled like this:

comgt -d /dev/ttyHS1

which tells comgt to use the /dev/ttyHS1 port for communicating with the modem.

comgt Scripts

comgt can be made more useful  by using scripts. There are several examples in /etc/comgt and the comgt man page will describe the script language in detail.

 

Man Page Extract


NAME

comgt - Option GlobeTrotter GPRS/EDGE/3G/HSDPA and Vodafone 3G/GPRS datacard control tool

SYNOPSIS

comgt -d device -ehstvx script

OPTIONS

-d device set the device to be used to communicate with the data-card. Defaults to /dev/modem

-e turn on serial communications echo.

-h display summary help and exit.

-s don't run the internal default script before an external script.

-t change to an alternate line terminator (default ").

-v run in verbose mode. This traces scripts as they are executed. It is intended to help in debugging scripts.

-x for internal and external scripts, any reference to 115200 baud is converted to 57600. This is useful for data cards that don't like 115200 baud such as the GlobeTrotter EDGE.

DESCRIPTION

comgt is a scripting language interpreter useful for establishing communications on serial lines and through PCMCIA modems as well as GPRS and 3G datacards. The source for comgt can be found here: Sourceforge

comgt has some features that are rarely found in other utilities of the same type.

Features

- Pre-defined built-in scripts for 2G/3G datacard control
- Simple, BASIC-like script language.
- Command-line and file sourcing of script.
- Multi-response waitfor.
- waitquiet permits line stabilization.
- In-line text capture.
- Multi-process support: fork, wait, kill, exit.
- Debugging verbose and log output.
- logging to file.
- Flow control: goto, gosub, return, if, else.
- Low-impact on system resources.
- Time commands and functions.
- String manipulations.
- Environment manipulation: env(), putenv.
- External utilities system calls: system, exec.
 

Supported GPRS and 3G datacards

comgt has been tested against GlobeTrotter GPRS,EDGE, Combo EDGE, 3G, 3G EDGE, HSDPA and GlobeTrotter Fusion as well as Vodafone 3G. It can set the PIN and display information about datacards before a PPP connection is started. Additionally, because the GlobeTrotter and Vodafone 3G/GPRS datacard have a secondary serial interface, these datacards can be monitored while a PPP connection is in existence and transferring data.

comgt is primarily designed to work with the GlobeTrotter range of datacards but should be compatible with any other GPRS or 3G datacard provided its interface is implemented as one or more serial or USB serial devices and it is controlled and queried by an implementation of the Hayes command interface with the same AT command extensions used by the listed datacards.

Using comgt

comgt has only one function: to run a script. This may be one of a number of "standard" internal scripts or an external script. Both types of script are invoked in the same way. The "standard" scripts are built into comgt and will work for serially connected modems, built-in modems, PCMCIA modems as well as the GlobeTrotter GPRS and the Vodafone 3G/GPRS datacards.

Built-in scripts

comgt This runs the default internal script. Running comgt without any script specified, e.g., comgt -d /dev/ttyS1 it will check for a PIN and prompt you if it is required. The next thing it does is wait for the device to register, it then reports the signal strength. If you don't specify a port with the -d option then /dev/modem is assumed. If the -s switch is not used then this default script is run before any external script.

comgt help Lists these and the other options available.

comgt info Lists the datacard configuration.

comgt sig Prints the signal strength.

comgt reg Prints the registration state.

comgt 3G Puts a GlobeTrotter 3G/Fusion and Vodafone 3G into 3G network only mode (UMTS/HSDPA).

comgt 2G Puts a GlobeTrotter 3G/Fusion and Vodafone 3G into 2G network only mode (GSM/GPRS/EDGE).

comgt 3G2G Puts a GlobeTrotter 3G/Fusion and Vodafone 3G into 3G preferred mode (UMTS/HSDPA and GSM/GPRS/EDGE).

comgt GTEDGE Use this command to initialise GlobeTrotter EDGE and GlobeTrotter Combo EDGE cards before doing anything else. (It switches on the radio).

comgt USA Switch to 900/1900 MHz band for USA operation. GlobeTrotter GPRS datacards only.

comgt EUROPE Switch to 900/1800 MHz band for European operation. GlobeTrotter GPRS datacards only.

 

Custom Scripts

As well as built in scripts you can make your own. The following script sets a Vodafone 3G datacard or Option Fusion card's UMTS mode to GPRS:

#Set GPRS only mode
set com 115200n81
set senddelay 0.05
waitquiet 1 0.2
send "AT_OPSYS=0^m"
print "Setting GPRS only mode"

If you saved the above script as GPRS you would call it like this:

comgt GPRS

If you needed to specify the port as well then do this:

comgt -d /dev/ttyS1 GPRS

You can also pass environment parameters to a comgt script via $env().

comgt's script language is fully described in the comgt man-page.

PHARscape

News:

Option release Packaged HSO Drivers
Option makes available HSO drivers in DEB and RPM format

Option release HSO version 1.14
Option release HSO version 1.14

Latest Articles:

  • Equipment 2010.08.02
  • Globular Clusters 2010.07.31
  • Galaxies 2010.07.31

Latest Forum Messages:

PHARscape Linux and 3G forum
  • Re: Download link for hsolinkcontrol?
  • Download link for hsolinkcontrol?
  • "hsocremote CONNECT" doesn't work
  • Re: ZeroCD on Fedora 13
  • Re: ZeroCD on Fedora 13

Powered by MODx  Template © 2006 modXhost.com CSS
MySQL: 0.0058 s, 2 request(s), PHP: 0.0665 s, total: 0.0724 s, document retrieved from cache.