comgt General Commands Manual

comgt是一款用于控制GlobeTrotter GPRS/EDGE/3G/HSDPA和Vodafone 3G/GPRS数据卡的工具,支持多种选项和内置脚本。它具有串行通信回显、不运行内部默认脚本、更改行终止符等功能,适用于建立串行线路和GPRS、3G数据卡的通信。comgt可用于检查PIN、信号强度、注册状态等,还可用于替代简单的chat功能,提供更灵活的控制和错误处理。
摘要由CSDN通过智能技术生成

reference url:comgt(1) — comgt — Debian testing — Debian Manpages

NAME

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

SYNOPSIS

comgt -d device -ehstvVx script

OPTIONS

-d device
set the device to be used to communicate with the data-card. If not specified then comgt trys /dev/noz2, /dev/ttyUSB2 and then /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 "0).


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


-V
Print Version information.


-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.

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. There is a search priority order for scripts - 1)internal, 2)working directory, 3)/etc/comgt

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.


comgt PIN
Test the SIM PIN status and use the environment variable COMGTPIN as the value .


comgt APN
Set the APN of the datacard to the value contained in the COMGTAPN environment variable.

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().

Replacing chat

chat is a utility that comes with the ppp package (for Linux, anyway) that, with a set of expect-send string couples, does enough to connect most people to ISPs and such. While chat´s use is very simple, it isn´t very flexible. That´s where comgt takes over.

comgt can be used in place of chat using the same strategy. For example, a pppd line reading:

pppd connect \ 


     ´chat -v "" ATDT5551212 CONNECT "" ogin: ppp \


     word: whitewater´ \


     /dev/cua1 38400 debug crtscts modem defaultroute

Would, using comgt, read:

pppd connect ´comgt -s /root/scripts/isp.scr´ /dev/cua1 38400 \


     debug crtscts modem defaultroute

And the isp.scr script would read:

     send "ATDT5551212^m"


     waitfor 60 "ogin:"


     send "ppp^m"


     waitfor 60 "word:"


     send "whitewater^m"

Of course it then becomes trivial to make this script a whole lot more functional by adding code for busy detect, re-dialing, etc...

Verbose output

When the verbose option is turned on, comgt reports everthing on the standard error channel. If turned on from the command line (-v), the output contains 4 sections.

- Command line argument actions
These are actions taken because they were specified from the command line, such as opening a communication device (-d), etc... For these to be output, you must specify

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值