AT+CMGS hangs if command is misissued


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default AT+CMGS hangs if command is misissued

    Hi there,

    I was wondering if there is any way to get out of a "sitting" situation from a GSM module when, i.e., a AT+CMGS is misissued.

    This situation I'll discribe further on should actually not appear since the program takes care to send "clean" SMSs.

    Since my project is about a GSM monitoring system, I would like to make sure the modem will always be functional even if something goes wrong.

    In this example, I've omitted the CTRL-Z command to terminate the message. This leads the module to hang showing ">" lines (yellow highlight).

    Name:  000630.png
Views: 1129
Size:  6.1 KB


    Appart from the next line +CMTI: "SM",0 indicating an incoming message, the next lines (braun highlight) are commands issued by my PIC but not recognized and therefore not executed. AAMOF, these three last lines are preceeded by a ">", the one that is probably waiting for AT+CMGS command termination.

    Unfortunately, sending a CTRL-Z does not finally terminate the AT+CMGS command and my module is stuck here until...I switch it OFF.

    Is there a way to get out of this trap?
    Roger

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383

    Default Re: AT+CMGS hangs if command is misissued

    in the old dialup days +++ used to be a modem escape sequence, worth a try
    Warning I'm not a teacher

  3. #3
    Join Date
    Sep 2009
    Posts
    737

    Default Re: AT+CMGS hangs if command is misissued

    There is no universal solution for that. It depends on implementation of AT command parser and sometimes there is difference between modems FW versions.
    In my programs I repeat command 3 times, if there is no valid reply, then just reset modem. I tried few times to make error handler for modem comm, and in 90% error cases it end up resetting modem.

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Re: AT+CMGS hangs if command is misissued

    Hi Richard,

    I actually never saw this "+++" command - I'll give it a try asap


    Pedja,

    I'm thinking of doing the same thing, repeating commands and waiting for acknowledgement.

    As you said: this can be modem dependent.

    Currently I use a SMICOM 7600E one. I think to give a try with a QUECTEL one or any other if you have a suggestion.
    Roger

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Re: AT+CMGS hangs if command is misissued

    Pedja,

    May I kindly ask you what type of modem(s) you use?
    Roger

  6. #6
    Join Date
    Sep 2009
    Posts
    737

    Default Re: AT+CMGS hangs if command is misissued

    Started with sim300, then sim900D, now sim800C.
    I think simcom is best modem for price.
    There is at least 150 pcs in few different products, and I think that there is no failed modem in field. There was few that fail testing after assembly.
    If you want to be sure that modems works reliable, you must have way to switch power off(for reason that you are trying to solve), good supply(low ESR caps, good regulation-no more than 0.2V drop on 1.6A pulse), and good antenna.
    Flow control is optional.
    Where I have large files to transver(10's of KB )I use flow control or if device can download new FW from FTP.
    I had no luck with built in FTP client, so I stick to mine FTP and SMTP clients in PBP.

Similar Threads

  1. pic18f4550 hangs.. RX_INT DT_INTS-18.. please help
    By cluster in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th November 2011, 17:32
  2. uC Hangs after second serout command
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th August 2011, 18:57
  3. Trouble with PIC16F88 (chip hangs up)
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 10:23
  4. PIC HANGS with SERIN and Timeout?
    By koossa in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th January 2008, 18:33
  5. PIC Hangs when using Serin TimeOut
    By Squibcakes in forum Serial
    Replies: 2
    Last Post: - 20th July 2006, 02:59

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts