Skip to content

Instantly share code, notes, and snippets.

@cfra
Last active May 6, 2020 21:52
Show Gist options
  • Save cfra/f401a3d72f8203b3260dd7c107f26f0b to your computer and use it in GitHub Desktop.
Save cfra/f401a3d72f8203b3260dd7c107f26f0b to your computer and use it in GitHub Desktop.
comgt/gcom script to send textmessage/SMS with umts stick
#
# export DEST as E164 number and MSG as text message content
# then call:
#
# comgt -v -d /dev/ttyUSB2 /etc/gcom/sendmsg.gcom
#
# where /dev/ttyUSB2 is the console of your UMTS modem
#
opengt
set com 115200n81
set comecho on
set senddelay 0.02
waitquiet 1 0.2
flash 0.1
send "AT+CMGF=1^m"
waitfor 1 "OK"
if % != 0 goto msgerror
send "AT+CMGS=\""
send $env("DEST")
send "\"^m"
waitfor 1 ">"
if % != 0 goto msgerror
send $env("MSG")
send "^Z"
waitfor 5 "OK"
if % != 0 goto msgerror
exit 0
:msgerror
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment