# Fastest way of sending SMS messages (Fastrack Modem)

**URL:** <https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253>\
**Category:** Open AT\
**Created:** [April 12, 2007, 8:30am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253 "2007-04-12T08:30:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilipB](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@PhilipB](https://forum.sierrawireless.com/u/PhilipB)\
**Post date:** [April 12, 2007, 8:30am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253/1 "2007-04-12T08:30:05Z")

</div>

Hi all  
I’m currently developping a Java application to send SMS messages stored in a database.  
I can already send SMS messages (PDU mode) but not all messages are received (around 50%). When I get the messages from the database and send them to the fastrack modem, it can’t handle them so fast after each other.

I first use this command:  
AT+CMMS=2  
This will keep the link open while messages are sent.

After that, I switch on the PDU mode:  
AT+CMGF=0

Now I start with sending the messages:  
First (In java, pdu length has been calculated):  
“AT+CMGS=” + pdu.length // set length of PDU

After that, the message itself:  
  
Port.write(“00”); // prepare for the PDU  
Port.write(SMSTools.toHexString(pdu)); // set PDU  
Port.write(“\u001A”); // set Ctrl-Z = indicates end of PDU

All these steps of course work fine.

The log (4 messages have to be sent):

> [@](#):
>
> SMSID: 8569 gsm: 32494888888 berid: 36 Message: Test Message prior: 10
> 
> write port: AT+CMGS=42
> 
> read port: AT+CMGS=42
> 
> > 
> 
> read port: 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> Sent!  
> Result:
> 
> * * *
> 
> 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> * * *
> 
> NA
> 
> This message above was OK and sent!
> 
> SMSID: 11027 gsm: 32494888888 berid: 36 bericht: Test Message prior: 10  
> VOOR  
> write port: AT+CMGS=42
> 
> read port: AT+CMGS=42  
> [b]+CME ERROR: 515
> 
> +CME ERROR: 515
> 
> +WIND: 4[/b]
> 
> read port: 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> Sent!  
> Result:
> 
> * * *
> 
> 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> * * *
> 
> NA
> 
> This message above was NOT OK and NOT sent!
> 
> SMSID: 11028 gsm: 32494888888 berid: 36 bericht: Test Message prior: 10  
> VOOR  
> write port: AT+CMGS=42
> 
> read port: AT+CMGS=42
> 
> > 
> 
> read port: 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> Sent!  
> Result:
> 
> * * *
> 
> 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> * * *
> 
> NA
> 
> This message above was OK and sent!
> 
> SMSID: 11029 gsm: 32494888888 berid: 36 bericht: Test Message prior: 10  
> VOOR  
> write port: AT+CMGS=42
> 
> read port: AT+CMGS=42  
> [b]+CME ERROR: 515
> 
> +CME ERROR: 515
> 
> +CMGS: 19[/b]
> 
> OK
> 
> read port: 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> Sent!  
> Result:
> 
> * * *
> 
> 0011000B912394488888F80000AA20D4F29C2E2ECBD363341DE40E87E5A0765AED069DE76D90BBDE6E97E5
> 
> * * *
> 
> NA
> 
> This message above was NOT OK and NOT sent!

As you can see, the error +CME ERROR: 515 comes up which means that the modem is still busy with previous commands.

I can catch these error messages and put my loop in Java to -1 to send the previous message again, but this is not a good way to do (Are the messages send to the provider? So does it cost money?). I can also sleep the application for a few seconds but it will happen that I need to send more than 500 messages. This will take way too long.

Anybody has an idea how I can send a lot off messages the fastest way without the modem still being busy? (Like putting it into a “waiting to be sent” group)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [April 12, 2007, 8:33am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253/2 "2007-04-12T08:33:57Z")

</div>

Isn’t it enough to wait for the OK after AT+CMGS…?

---

<div class="post-metadata">

**Author:** ![PhilipB](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@PhilipB](https://forum.sierrawireless.com/u/PhilipB)\
**Post date:** [April 12, 2007, 8:43am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253/3 "2007-04-12T08:43:43Z")

</div>

You mean like looping the AT+CMGS command? until it says OK?

Hmm, I’ll give it a shot!

Thanks

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [April 12, 2007, 8:47am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253/4 "2007-04-12T08:47:20Z")

</div>

Well, I actually meant  
AT+CMGS=…  
Wait for \>  
Send your data  
Wait for OK…  
Move on to next message

---

<div class="post-metadata">

**Author:** ![PhilipB](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@PhilipB](https://forum.sierrawireless.com/u/PhilipB)\
**Post date:** [April 12, 2007, 9:19am UTC](https://forum.sierrawireless.com/t/fastest-way-of-sending-sms-messages-fastrack-modem/1253/5 "2007-04-12T09:19:00Z")

</div>

Alright, all messages have been sent, I’m now indeed waiting for the character “\>” to appear. Then the messages are send and waiting for the OK to go on.

Thanks for your help tobias!

I really appreciate it!  
I owe you a beer or something 😉
