Fastest way of sending SMS messages (Fastrack Modem)

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:
This will keep the link open while messages are sent.

After that, I switch on the PDU mode:

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):

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!

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

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

Hmm, I’ll give it a shot!


Well, I actually meant
Wait for >
Send your data
Wait for OK…
Move on to next message

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 :wink: