Failed to receive SMS

Hi guys,

I badly needed your help. I’m creating a simple OPEN AT application that process incoming SMS so i subscribe to SMS service using the following code:

static s8 sms_automaton_Handle_txt; //declare sms handle

//subscribe to sms service
sms_automaton_Handle_txt = adl_smsSubscribe(SMS_AUTO_Handler, SMS_AUTO_ctrl_Handler, ADL_SMS_MODE_TEXT);

sms_automaton_Handle_txt is equal to zero after subscription so i proceed by implementing the call back function:

//handle for incoming SMS
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
adl_atSendResponse(ADL_AT_UNS, “\r\nNew Message\r\n”);
TRACE (( 1, “New Message\n”));
return TRUE;
}

//handle for sending sms
void SMS_AUTO_ctrl_Handler(u8 Event, u16 Nb)
{
// Does nothing because i just want to process incoming sms
}

As you can see the code simply send a “New Message” notification to UART1 and display a trace to the target monitoring tool. I tried to send an SMS message to the modem and the message arrives and displays it to the terminal program. But my open AT application did not receive it because the “New Message” string was not displayed on the terminal program. What could be the problem?

Pls help,
Von

Would you show all code?
Where are you do subscribing to SMS messages I don’t understand?

And use the CODE button during posting the message.

Here is the actual code:

#include "adl_global.h"


/***************************************************************************/
/*  Mandatory variables                                                    */
/*-------------------------------------------------------------------------*/
/*  wm_apmCustomStack                                                      */
/*  wm_apmCustomStackSize                                                  */
/*-------------------------------------------------------------------------*/
/***************************************************************************/
u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

/***************************************************************************/
/*  Local variables                                                        */
/***************************************************************************/
static s8 sms_automaton_Handle_txt; //declare sms handle


/***************************************************************************/
/*  Local functions                                                        */
/***************************************************************************/
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText);
void SMS_AUTO_ctrl_Handler(u8 Event, u16 Nb);

/***************************************************************************/
/*  Function Implementation                                                        */
/***************************************************************************/
//handle for sending sms
void SMS_AUTO_ctrl_Handler(u8 Event, u16 Nb)
{
// Does nothing because i just want to process incoming sms
}

//handle for incoming SMS
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
    adl_atSendResponse(ADL_AT_UNS, "\r\nNew Message\r\n");
    TRACE (( 1, "New Message\n"));
    return TRUE;
}

/***************************************************************************/
/*  Function   : adl_main                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Customer application initialisation                       */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  InitType          |   |   |   |  Application start mode reason         */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void adl_main ( adl_InitType_e InitType )
{
    TRACE (( 1, "Embedded Application : Main" ));

    sms_automaton_Handle_txt = adl_smsSubscribe(SMS_AUTO_Handler, SMS_AUTO_ctrl_Handler, ADL_SMS_MODE_TEXT);
    //check subscription status
    TRACE (( 1, "SMS subscribe:%d", sms_automaton_Handle_txt));
}

sms_automaton_Handle_txt is always equal to zero after subscription so i assume sms subscription was succesfull. I tried to send an SMS from my phone to the modem to check if my open AT app will receive it but unfortonately it did not. But my message was displayed on the terminal emulator but no TRACE was displayed on the Target Monitoring Tool. Please help. What’s wrong with my code? Thank you in advance.

Interesting, but notifications on new posts is working very bad. :frowning:

So.

  1. If you can entering in your SMS_AUTO_Handler so you can view info like sms tel, length and time.
    Try to send it to TMT.
  2. And TRACE don’t require the \n parameter in the end of your string. Why are you do that?

Try this:

//handle for incoming SMS
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
    // you show that you enter in
    TRACE (( 1, "SMS_AUTO_Handler"));    

    // show sms info
    TRACE (( 1, "SMS is received from: (%s) in (%s) with text (%s) ", SmsTel, SmsTimeOrLength, SmsText));
    
    adl_atSendResponse(ADL_AT_UNS, "\r\nNew Message\r\n");
    return FALSE;
}

and post the traces in answer.

Here are the TRACES:

Trace 1 Unable to find the string of the remote trace in the file (ID = 12654)
Trace 1 Unable to find the string of the remote trace in the file (ID = 12654)
Trace 1 Unable to find the string of the remote trace in the file (ID = 12654)
Trace 1 Unable to find the string of the remote trace in the file (ID = 12654)
Trace 1 Unable to find the string of the remote trace in the file (ID = 12654)
Trace IP 1 Embedded Application : Main
Trace IP 1 SMS subscribe:0
Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 4867)
Trace GRR 1 Unable to find the string of the remote trace in the file (ID = 5293)
Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 4867)
Trace MMT 1 Unable to find the string of the remote trace in the file (ID = 11112)

I really appreciate your help. I hope i could make this right. Thank you.

It’s very very interesting.

I think that you have to do next:

  1. update module to the last firmware version (and open at software too course).
  2. clean all customization & object data in module using DWLwin application by wavecom.
  3. clean & build your project using eclipse.
  4. download app to module.

Before doing that, are you sure that the SMS is actually being delivered by the network?

If you stop your application, does the SMS actually arrrive?

What if you put the SIM into a phone?

Have you tried requesting delivery confirmation at the sender?

I’m quite sure that the SMS is actually being delivered by the network in fact it arrives and displayed on the terminal emulator. I am running my app on RTE mode. I already tried to update the modem’s firmware via Send file command in hyperterminal using the 1k XMODEM protocol but same happens.

Actually i am able to receive the message before from my sms handler but only once. It happens when i used the modem i am using now for to develop an open AT app for the very first time. Upon power up i also notice the following WIND messages that never happens before. Could this be the problem? Here are the WIND messages the terminal emulator displayed upon startup:

+WIND: 13
+WIND: 1
+WIND: 16
+WIND: 4
+WIND: 10,“SM”,1,“FD”,0,“ON”,1,“EN”,0
+WIND: 11,“984F7420D1EFA088EC12ED50191E1855”,“6B30010054C5C9D011FF0205AF45363F”
,“FB0A9E6A91FA8BEF4CA97C7A0F234E7B”,“33D1E6E047605D685D09EA2D39802F67”
+WIND: 7