diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-07-07 23:58:22 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-07-07 23:58:22 +0200 |
commit | 3c70077f308437281c72431223b532f6f427e1d0 (patch) | |
tree | db825d10d656b0330867ce32e90d9f7207b22f02 /package/comgt | |
parent | 92ee1314c1c4f6a93bbca3c4ffaeddc51b5609af (diff) |
add support for hso umts modems
if you like to use an usb umts modem with hso chipset,
this is the support for it.
use following in /etc/network/interfaces:
auto hso0
iface hso0 inet manual
pin xxxx
apn foo.bar
credentials go to freewrt 1.0 supporters...
Diffstat (limited to 'package/comgt')
-rw-r--r-- | package/comgt/Makefile | 5 | ||||
-rw-r--r-- | package/comgt/files/hsoauth.comgt | 34 | ||||
-rw-r--r-- | package/comgt/files/hsoconnect.comgt | 19 | ||||
-rw-r--r-- | package/comgt/files/hsodata.comgt | 27 | ||||
-rw-r--r-- | package/comgt/files/hsodisconnect.comgt | 19 | ||||
-rw-r--r-- | package/comgt/files/hsostatus.comgt | 14 | ||||
-rw-r--r-- | package/comgt/files/waitready.comgt | 34 |
7 files changed, 149 insertions, 3 deletions
diff --git a/package/comgt/Makefile b/package/comgt/Makefile index 50816d485..8f2c25db7 100644 --- a/package/comgt/Makefile +++ b/package/comgt/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= comgt PKG_VERSION:= 0.32 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= db2452680c3d953631299e331daf49ef PKG_DESCR:= 3G/GPRS datacard control tool PKG_SECTION:= console @@ -21,12 +21,11 @@ $(eval $(call PKG_template,COMGT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG CONFIG_STYLE:= manual INSTALL_STYLE:= manual - ALL_TARGET= comgt do-install: ${INSTALL_DIR} ${IDIR_COMGT}/usr/bin ${IDIR_COMGT}/etc/comgt ${INSTALL_BIN} ${WRKBUILD}/comgt ${IDIR_COMGT}/usr/bin/comgt - ${INSTALL_DATA} ./files/dial.comgt ${IDIR_COMGT}/etc/comgt/dial.comgt + ${INSTALL_DATA} ./files/*.comgt ${IDIR_COMGT}/etc/comgt/ include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/comgt/files/hsoauth.comgt b/package/comgt/files/hsoauth.comgt new file mode 100644 index 000000000..ea81ee3ca --- /dev/null +++ b/package/comgt/files/hsoauth.comgt @@ -0,0 +1,34 @@ +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + +:start + flash 0.1 + +:getuser + let $u=$env("USER") + let a=len($u) + if a=0 goto continue + +:getpass + let $p=$env("PASS") + +:auth + print "User: ",$u,"\n" + print "Pass: ",$p,"\n" + send "AT$QCPDPP=1,1,\"" + send $p + send "\",\"" + send $u + send "\"^m" + waitfor 2 "OK" + if % = -1 goto error + if % = 0 goto continue + +:error + exit 1 + +:continue + exit 0 + diff --git a/package/comgt/files/hsoconnect.comgt b/package/comgt/files/hsoconnect.comgt new file mode 100644 index 000000000..721a86c68 --- /dev/null +++ b/package/comgt/files/hsoconnect.comgt @@ -0,0 +1,19 @@ +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + flash 0.1 + +:start + send "AT_OWANCALL=1,1,0^m" + waitfor 2 "OK" + if % = -1 goto error + if % = 0 goto continue + + +:error + exit 1 + +:continue + exit 0 + diff --git a/package/comgt/files/hsodata.comgt b/package/comgt/files/hsodata.comgt new file mode 100644 index 000000000..92d2d8e3a --- /dev/null +++ b/package/comgt/files/hsodata.comgt @@ -0,0 +1,27 @@ +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + flash 0.1 + + let c=1 +:start + send "AT_OWANDATA=1^m" + waitfor 2 "ERROR" + if % = 0 goto repeat + send "AT_OWANDATA=1^m" + get 2 "^m" $s + get 2 "^m" $s + print $s + print "\n" + exit 0 + +:repeat + sleep 3 + inc c + if c > 15 goto error + goto start + +:error + exit 1 + diff --git a/package/comgt/files/hsodisconnect.comgt b/package/comgt/files/hsodisconnect.comgt new file mode 100644 index 000000000..755a0a318 --- /dev/null +++ b/package/comgt/files/hsodisconnect.comgt @@ -0,0 +1,19 @@ +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + flash 0.1 + +:start + send "AT_OWANCALL=1,0,0^m" + waitfor 2 "OK" + if % = -1 goto error + if % = 0 goto continue + + +:error + exit 1 + +:continue + exit 0 + diff --git a/package/comgt/files/hsostatus.comgt b/package/comgt/files/hsostatus.comgt new file mode 100644 index 000000000..83f13f0a8 --- /dev/null +++ b/package/comgt/files/hsostatus.comgt @@ -0,0 +1,14 @@ +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + flash 0.1 + +:start + send "AT_OWANCALL?^m" + get 2 "^m" $s + get 2 "^m" $s + print $s + print "\n" + exit 0 + diff --git a/package/comgt/files/waitready.comgt b/package/comgt/files/waitready.comgt new file mode 100644 index 000000000..0de4df5d4 --- /dev/null +++ b/package/comgt/files/waitready.comgt @@ -0,0 +1,34 @@ +# wait till the sim is ready +opengt + set com 115200n81 + set senddelay 0.02 + waitquiet 1 0.2 + flash 0.1 +:start + print "Waiting for SIM..." + let c=0 +:waitready + send "AT+CPIN?^m" + waitfor 2 "SIM PUK","SIM PIN","READY","ERROR","ERR" + if % = -1 goto tryagain + if % = 0 goto simready + if % = 1 goto simready + if % = 2 goto simready + if % = 3 goto tryagain + if % = 4 goto tryagain + +:tryagain + if c > 120 goto waittimeout + let c=c+2 + print "." + goto waitready + +:waittimeout + print " Timeout +" + exit 1 + +:simready + print " OK +" + exit 0 |