gsmd confused when sending commands immediately after phone power on via libgsmd API

Philipp Zabel philipp.zabel at gmail.com
Sun Jun 10 15:25:51 CEST 2007


Hi,

sending AT+COPS=0 immediately after AT+CFUN=1 via the libgsmd API
without waiting for the first command's OK confuses gsmd to the point
that the operator search is never started and it doesn't even accept AT
commands from libgsmd-tool afterwards. Example:

$ libgsmd-tool --mode shell
libgsm-tool - (C) 2006 by Harald Welte
This program is Free Software and has ABSOLUTELY NO WARRANTY

O
# Power-On
R
# Register

# EOF

$ libgsmd-tool --mode atcmd
libgsm-tool - (C) 2006 by Harald Welte
This program is Free Software and has ABSOLUTELY NO WARRANTY

AT
STR=`AT'
<no response here>

This is the corresponding gsmd log:

Sun Oct  2 19:54:44 1994 <1> atcmd.c:453:atcmd_submit() submitting  command `AT+CFUN=1'
Sun Oct  2 19:54:44 1994 <1> atcmd.c:453:atcmd_submit() submitting command `AT+COPS=0'
Sun Oct  2 19:54:44 1994 <1> atcmd.c:180:ml_parse() buf=`OK'(2)
Sun Oct  2 19:54:44 1994 <1> atcmd.c:339:ml_parse() Calling cmd->cb()
Sun Oct  2 19:54:44 1994 <1> usock.c:173:null_cmd_cb() null cmd cb
Sun Oct  2 19:54:58 1994 <1> gsmd.c:74:alive_tmr_cb() gsmd_alive timer expired
Sun Oct  2 19:54:58 1994 <3> gsmd.c:80:alive_tmr_cb() modem alive!
Sun Oct  2 19:55:05 1994 <1> usock.c:904:gsmd_usock_user_cb() EOF, this client has just vanished
Sun Oct  2 19:55:08 1994 <1> usock.c:96:usock_rcv_passthrough() submitting cmd=0x1a960, gu=0x1a900
Sun Oct  2 19:55:08 1994 <1> atcmd.c:453:atcmd_submit() submitting command `AT'
Sun Oct  2 19:55:08 1994 <1> atcmd.c:180:ml_parse() buf=`OK'(2)
Sun Oct  2 19:55:08 1994 <1> atcmd.c:339:ml_parse() Calling cmd->cb()
Sun Oct  2 19:55:08 1994 <1> usock.c:173:null_cmd_cb() null cmd cb
Sun Oct  2 19:55:11 1994 <1> usock.c:904:gsmd_usock_user_cb() EOF, this client has just vanished

When I do the same experiment from libgsmd-tool's atcmd mode, the
queueing takes care of only sending COPS after the CFUN's OK is
received:

$ libgsmd-tool --mode atcmd
libgsm-tool - (C) 2006 by Harald Welte
This program is Free Software and has ABSOLUTELY NO WARRANTY

AT+CFUN=1
STR=`AT+CFUN=1'
AT+COPS=0
RSTR=`OK'
STR=`AT+COPS=0'
EVENT: Netreg searching for network 
...

regards
Philipp




More information about the gsmd-devel mailing list