概述
comgt 是一个 GPRS 模块配置工具。它更像是一个脚本语言解释器,通过调用内建、或者外部脚本与 GPRS 和 3G 模块通,解决了在脚本中使用microcom命令需要交互输入AT指令的问题。
编译
下载comgt.0.32.rar并解压,进入comgt目录,编译命令:make VERBOSE=1,交叉编译需要给CC赋值;安装命令:make DESTDIR=./usr install,安装在./usr/sbin目录下。
使用
root@genvict_imx8qxp:~# ./comgt help
comgt Usage: comgt [options] [built in script]'|[external script]
Built in scripts -
comgt [default] Checks SIM status (requests PIN if required),
registration and signal strength reported by
datacard.
comgt info Display configuration of datacard.
comgt sig Report Signal strength.
comgt reg Report Registration status.
comgt PIN Set PIN using COMGTPIN env variable.
comgt APN Set APN using COMGTAPN env variable.
Valid for GlobeTrotter GPRS only:
comgt USA Switch to 900/1900 MHz band for USA operation.
comgt Europe Switch to 900/1800 MHz band for Europen operation.
Valid for GlobeTrotter EDGE and Combo EDGE only:
comgt GTEDGE Switch on radio interface.
Valid for Vodafone 3G, GlobeTrotter Fusion, GT Max :
comgt 2G 2G networks only.
comgt 3G 3G networks only
comgt 3G2G 3G network preferred
Command line options (must be before script name) -
-d device Use alternative device. e.g -d /dev/ttyUSB0
-e Turn on communication echo.
-h Help.
-V Version.
-s Don't run internal 'default' script before running
external script.
-t=n Set alternative line terminator (default=n).
-v Verbose mode. Print lots of trace info.
-x Speed exchange. 115200 replaced by 57600.
***used for GlobeTrotter EDGE and Combo EDGE***
NOTES:
comgt assumes that the GlobeTrotter device is /dev/modem (create a logical link
to actual device or use -d switch). Unless you use the '-s' switch comgt will
run the internal 'default' script first before running an external script file.
外部脚本g.gcom
opengt
set com 115200n81
set comecho off
set senddelay 0.02
waitquiet 0.2 0.2
flash 0.1
:start
send "AT^m"
get 1 "" $s
print $s
:continue
exit 0
调试使用
root@genvict_imx8qxp:~# ./comgt -d /dev/ttyUSB5 -se g.gcom
AT
OK
最后
以上就是孤独小白菜为你收集整理的comgt AT工具使用编译使用的全部内容,希望文章能够帮你解决comgt AT工具使用编译使用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复