[SOL] Sending SMS while keeping an active socket connection

One thought on “[SOL] Sending SMS while keeping an active socket connection

  1. Is this possible? Of course!

     

    If you use Python, you can send SMS via MDM2.

    If you don’t use Python and don’t use CMUX, and you have to send and
    SMS with a socket active (opened with at#sd command), you need to
    suspend the socket with +++ to enter in command mode, send the SMS, and
    then reasume the socket with at#SO (according to the Easy GPRS user
    guide)

    If you don’t use Python and you are using at+CMUX, you have three
    virtual port useful to send AT commands; so, for example, you can open
    a socket on a first one and send an SMS on the second one

    If you are using Python and at+cmuxscr=1, pay attention that "In case
    you have enabled CMUX on ASC0 (AT#CMUXSCR=1) then the second CMUX port
    will be dedicated to MDM2 and no AT command handling will be possible
    on that port. Remember that first CMUX port is reserved for SER module
    and fourth CMUX port is in use for debug (print statements)." as
    written in easy script in Python

    On the last official version 7.03.x01 you could find also a new command
    (at+CGSMS) implemented that permits to send SMS via GPRS network IF THE
    NETWORK OPERATOR SUPPORTS THIS FEATURE (not so common)

    EXAMPLE:

    AT&D1
    OK
    AT#E2SMSRI=1000     (RI 1s pulse indication
    for incoming SMS)
    OK
    AT+CNMI=2,1,0,0,0     (+CMTI URC for incoming
    SMS)
    OK
    AT+CGDCONT=1,"IP","ibox.tim.it"
    OK
    AT#SCFG=1,1,300,90,600,50   
    (set the configuration you prefer)
    OK
    AT#SGACT=1,1
    #SGACT:
    217.203.155.33

    OK
    AT#SD=1,0,10000,"88.30.123.145",0,0
    CONNECT

     

    ==> RI pulse
    of 1s (incoming SMS)

    ==> DTR line
    HIGH (2.8V) for 1s or escape sequence +++

    OK
    ==>
    DTR line LOW (0V) if DTR is used instead of +++

    +CMTI:
    "SM",9
    AT+CMGR=9
    +CMGR: "REC
    UNREAD","+393201569xxx","","10/03/22,13:53:18+04"
    TEST

    OK
    AT+CMGS=3201569xxx
    >

    THIS IS A TEST
    +CMGS:  157

    OK
    AT#SO=1
    CONNECT