SMS Tutorial_ +CMS ERROR - Final Result Code Specific to SMS AT Commands

Embed Size (px)

DESCRIPTION

SMS Tutorial_ +CMS ERROR - Final Result Code Specific to SMS AT Commands

Citation preview

  • 23/12/2015 SMSTutorial:+CMSERRORFinalResultCodeSpecifictoSMSATCommands

    http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1 1/5

    16.2.FinalResultCodeSpecifictoSMSATCommands

    PreferencesDonotshowads

    ThefinalresultcodesOKandERRORareavailabletoallATcommands.UnlikeOKandERROR,the+CMSERRORfinalresultcodeisonlyavailabletoSMSATcommands.Itnotifiesyouabouttheoccurrenceofamessageservicefailure.

    16.2.1.The+CMSERRORFinalResultCodeNotifiestheOccurrencesandCausesofMessageServiceFailures

    The+CMSERRORfinalresultcodeisreturnedwhenamessageservicefailureoccurs.Anerrorcodeisprovidedforprogrammerstocheckwhatcausesthemessageservicefailure.The+CMSERRORfinalresultcodeisspecifictoSMSATcommands,i.e.the+CMSERRORfinalresultcodewillonlybeoutputtedbyATcommandsthatareusedtoperformtasksrelatedtoSMSmessaging.BelowaretheSMSATcommandsthatmayoutputthefinalresultcode+CMSERROR:

    +CMGC(commandnameintext:SendCommand)

    +CMGD(commandnameintext:DeleteMessage)

    +CMGL(commandnameintext:ListMessages)

    +CMGR(commandnameintext:ReadMessage)

    +CMGS(commandnameintext:SendingMessage)

    +CMGW(commandnameintext:WriteMessagetoMemory)

    +CMSS(commandnameintext:SendMessagefromStorage)

    +CNMA(commandnameintext:NewMessageAcknowledgementtoME/TA)

    +CNMI(commandnameintext:NewMessageIndicationstoTE)

    +CPMS(commandnameintext:PreferredMessageStorage)

    +CRES(commandnameintext:RestoreSettings)

    +CSAS(commandnameintext:SaveSettings)

    +CSMS(commandnameintext:SelectMessageService)

    Thesyntaxofthe+CMSERRORfinalresultcodeis:

    SMSTutorialTableofContentsSMSTutorialContentsataGlancePreferencesChangeColorSchemePreferencesDoNotShowAdsPreviousPageNextPage

    InternationalSMSGatewayProvider

    SMS Gateway Connection?

    Test Our SMS API for Free (10 Mssg)No Hassle, Only 1 Connection.

    www.smsgateway.to

    Diafaan SMS Server

    Free 30-day trial

  • 23/12/2015 SMSTutorial:+CMSERRORFinalResultCodeSpecifictoSMSATCommands

    http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1 2/5

    +CMSERROR:error_code

    JustasthefinalresultcodesOKandERROR,the+CMSERRORfinalresultcodealwaysstartsandendswithacarriagereturncharacterandalinefeedcharacter.error_codeisanintegerthatisassociatedtoacertainerror.Alistofsomeerrorcodesandtheirmeaningscanbefoundin"Tableof+CMSErrorCodesandTheirMeanings".

    Asmentionedearlier,aftertheexecutionofacommandline,onlyonefinalresultcodeisreturned.Hence,whenanerroroccurs,youwillnotfindboth+CMSERRORandERRORinthecommandresponse.ForerrorsrelatedtoSMSmessaging,the+CMSERRORfinalresultcodeisreturned.ForothererrorssuchasinvalidcommandsyntaxandunsupportedATcommand,theERRORfinalresultcodeisreturnedasusual.

    Belowshowssomecommoncausesof+CMSerrors:

    ASIMcardisnotpresentintheGSM/GPRSmodemormobilephone.

    TheSIMcardrequiresapassword(e.g.PIN,PIN2,PUKandPUK2)butyouhavenotenteredit.

    AninvalidmemoryindexisassignedtoanATcommand.

    ThememoryoftheGSM/GPRSmodem,mobilephoneorSIMcardforstoringSMSmessagesisfull.

    TheSMSCaddressisunknownorincorrect.

    Followingisanexamplethatdemonstratestheusageofthe+CMSERRORresultcode.Let'ssaythereisonlyoneSMStextmessagestoredonourNokia6021anditisstoredinthememorylocationatindex1.Ifweenterthecommandline"AT+CMGR=11"(itmeans"toreadtheSMSmessageatmemoryindex11"),Nokia6021willreturna+CMSerror:

    AT+CMGR=11

    +CMSERROR:321

    Asmentionedearlier,whenaterminalprogramsuchasHyperTerminalofMicrosoftWindowsseesacarriagereturncharacter,itmovesthecursortothebeginningofthecurrentline.Whenitseesalinefeedcharacter,itmovesthecursortothesamepositiononthenextline.Hence,thecommandlineyouentered,togetherwiththeresponsereturned,willbedisplayedlikethisinaterminalprogramsuchasHyperTerminalofMicrosoftWindows:

    AT+CMGR=11

    +CMSERROR:321

    Tofindoutthemeaningofthe+CMSerrorcode321,goto"Tableof+CMSErrorCodesandTheirMeanings".Fromthere,weknowthatthereadmessageoperationfailedbecauseaninvalidmemoryindexwasassignedtotheATcommand+CMGR.

    Notethataftertheoccurrenceofa+CMSerror,theGSM/GPRSmodemormobilephonewillnotprocesstheremainingATcommandsinthecommandline.Thus,ifthecommandlinesenttoNokia6021is"AT+CMGR=11+CGMI"(+CGMIistheATcommandforretrievingthemanufacturernameoftheGSM/GPRSmodemormobilephone),youwillgetthefollowingresultinWindows'HyperTerminal:

    AT+CMGR=11+CGMI

    +CMSERROR:321

    ButifthepositionsofthetwoATcommandsinthecommandlineareexchanged,Nokia6021willoutputtheresultoftheexecutionoftheATcommand+CGMIbeforeoutputtingthe+CMSERRORresultcode.BelowistheresultdisplayedinWindows'HyperTerminal:

  • 23/12/2015 SMSTutorial:+CMSERRORFinalResultCodeSpecifictoSMSATCommands

    http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1 3/5

    AT+CGMI+CMGR=11

    Nokia

    +CMSERROR:321

    16.2.1.1.Tableof+CMSErrorCodesandTheirMeanings

    Thefollowingtablelistssomeofthe+CMSerrorcodesandtheirmeanings.

    +CMSerrorcode Meaning

    300 Mobileequipment(ME)failure.Mobileequipmentreferstothemobiledevicethatcommunicateswiththewirelessnetwork.UsuallyitisamobilephoneorGSM/GPRSmodem.TheSIMcardisdefinedasaseparateentityandisnotpartofmobileequipment.

    301 SMSserviceofmobileequipment(ME)isreserved.See+CMSerrorcode300forthemeaningofmobileequipment.

    302 TheoperationtobedonebytheATcommandisnotallowed.

    303 TheoperationtobedonebytheATcommandisnotsupported.

    304 OneormoreparametervaluesassignedtotheATcommandareinvalid.(ForPDUmode)

    305 OneormoreparametervaluesassignedtotheATcommandareinvalid.(ForTextmode)

    310 ThereisnoSIMcard.

    311 TheSIMcardrequiresaPINtooperate.TheATcommand+CPIN(commandnameintext:EnterPIN)canbeusedtosendthePINtotheSIMcard.

    312 TheSIMcardrequiresaPHSIMPINtooperate.TheATcommand+CPIN(commandnameintext:EnterPIN)canbeusedtosendthePHSIMPINtotheSIMcard.

    313 SIMcardfailure.

    314 TheSIMcardisbusy.

  • 23/12/2015 SMSTutorial:+CMSERRORFinalResultCodeSpecifictoSMSATCommands

    http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1 4/5

    315 TheSIMcardiswrong.

    316 TheSIMcardrequiresaPUKtooperate.TheATcommand+CPIN(commandnameintext:EnterPIN)canbeusedtosendthePUKtotheSIMcard.

    320 Memory/messagestoragefailure.

    321 Thememory/messagestorageindexassignedtotheATcommandisinvalid.

    322 Thememory/messagestorageisoutofspace.

    330 TheSMScenter(SMSC)addressisunknown.

    331 Nonetworkserviceisavailable.

    332 Networktimeoutoccurred.

    340 ThereisnoneedtosendmessageacknowledgementbytheATcommand+CNMA(commandnameintext:NewMessageAcknowledgementtoME/TA).

    500 Anunknownerroroccurred.

    PreferencesDonotshowads

    Page23of65 PreviousPage |NextPage

    TableofContentsContentsataGlance

    1.IntroductiontoSMSMessaging2.WhatMakesSMSMessagingSoSuccessfulWorldwide?3.ExampleApplicationsofSMSMessaging4.WhatisanSMSCenter/SMSC?5.BasicConceptsofSMSTechnology6.IntraoperatorSMSMessages7.InteroperatorSMSMessages8.InternationalSMSMessages9.WhatisanSMSGateway?10.HowtoSendSMSMessagesfromaComputer/PC?11.HowtoReceiveSMSMessagesUsingaComputer/PC?12.IntroductiontoGSM/GPRSWirelessModems13.HowtoUseMicrosoftHyperTerminaltoSendATCommandstoaMobilePhoneorGSM/GPRSModem?14.IntroductiontoATCommands

    SendFreeSMSReceiveSMSGSMModemSMS

    AdsbyGoogle

    FreeUnlockCodesFreeCMSSMStoPhone

    AdsbyGoogle

  • 23/12/2015 SMSTutorial:+CMSERRORFinalResultCodeSpecifictoSMSATCommands

    http://www.developershome.com/sms/resultCodes2.asp#16.2.1.1 5/5

    15.GeneralSyntaxofExtendedATCommands16.ResultCodesofATCommands17.ATCommandOperations:Test,Set,ReadandExecution18.TestingtheCommunicationbetweenthePCandGSM/GPRSModemorMobilePhone19.CheckingiftheGSM/GPRSModemorMobilePhoneSupportstheUseofATCommandstoSend,ReceiveandReadSMSMessages20.OperatingMode:SMSTextModeandSMSPDUMode21.SettingorReadingtheServiceCenterAddress/SMSCAddress(AT+CSCA)22.PreferredMessageStorage(AT+CPMS)23.WritingSMSMessagestoMemory/MessageStorage(AT+CMGW)24.DeletingSMSMessagesfromMessageStorage(AT+CMGD)25.SendingSMSMessagesfromaComputer/PCUsingATCommands(AT+CMGS,AT+CMSS)26.ReadingSMSMessagesfromaMessageStorageAreaUsingATCommands(AT+CMGR,AT+CMGL)

    PrintthisWebPage|EmailYourFriends|BacktoTop

    Tmkim

    FeedbackForm(Expand)

    Whatdoyouthinkaboutthiswebpage?

    Itisveryhelpful.

    Itishelpful,butsomeinformationIwantedismissing.

    Itisnothelpful.

    Ithasbrokenlinks.

    Ithastypos/grammaticalmistakes.

    Ithasincorrectinformation.

    Others

    Send Reset

    Home|Acknowledgements|Advertise|ContactUs/Feedback|Glossary|Preferences20042015|CopyrightNotice|PrivacyPolicy|TermsofUse