# SMS autoreply

**URL:** <https://forum.sierrawireless.com/t/sms-autoreply/2915>\
**Category:** Open AT\
**Created:** [February 11, 2009, 8:44am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915 "2009-02-11T08:44:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mag\_knu](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mag\_knu](https://forum.sierrawireless.com/u/mag_knu)\
**Post date:** [February 11, 2009, 8:44am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/1 "2009-02-11T08:44:59Z")

</div>

I want to build an application that automaticly reply to SMS begining with keyword: “getdata”. For the first version i just want to answer something like: “DATA from Wavecom supreme”, next version will read data from external datalogger.

I have designed my application based on sample project sms\_automaton. As I understand the use of multi\_app this is used to controll the application from the computer, so I have not used this. Trying to run the application on Wavecom supreme I am not reciveing any of the TRACE print outs, and application does not function. I am unexperienced in use of ADL and Wavecom software, so I might be on a dead end here?? Any advice? THANKS!!

void adl\_main ( adl\_InitType\_e InitType )  
{  
TRACE (( 1, “Embedded Application : Main” ));  
TRACE (( AUTO\_TRACE\_LEVEL, “Start SMS\_Automaton application” ));  
while(1){  
// Subscribe to the SMS Service  
sms\_automaton\_Handle\_txt = adl\_smsSubscribe(SMS\_AUTO\_Handler, SMS\_AUTO\_ctrl\_Handler, ADL\_SMS\_MODE\_TEXT);  
adl\_smsSend(sms\_automaton\_Handle\_txt, \*SmsTel\_send, \*data\_txt, ADL\_SMS\_MODE\_TEXT);  
}  
}

bool SMS\_AUTO\_Handler(ascii \*SmsTel, ascii \*SmsTimeOrLength, ascii \*SmsText)  
{  
u16 pos\_sms = 0;  
bool sms\_tobe\_fwd = TRUE;  
ascii \* reply\_text = “DATA from Wavecom Supreme”;  
ascii Keyword\_comp[wm\_strlen(smsreply\_keyword)];

```
while ( (pos_sms+1) < wm_strlen(smsreply_keyword) )
{
	TRACE (( AUTO_TRACE_LEVEL, "SMS searching "));

    //read begining of SmsText for keyword

    SmsText[pos_sms]=Keyword_comp[pos_sms];
    pos_sms++;

}
//SMS contains Keyword(getdata)?
if(Keyword_comp==smsreply_keyword)
{
	TRACE (( AUTO_TRACE_LEVEL, "Keyword match"));
	*SmsTel=SmsTel_send;
}
else
{
	TRACE (( AUTO_TRACE_LEVEL, "Keyword no match "));
	sms_tobe_fwd=FALSE;
}

return sms_tobe_fwd;

```

}

---

<div class="post-metadata">

**Author:** ![Briga](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@Briga](https://forum.sierrawireless.com/u/Briga)\
**Post date:** [February 11, 2009, 9:05am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/2 "2009-02-11T09:05:22Z")

</div>

Well I would have used the strstr(char \*, char \*) function to perform the search… anyway.  
To see the TRACE I believe you should be in RTE mode (and not running on the Wireless CPU). Is that the case?

Briga

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [February 11, 2009, 10:04am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/3 "2009-02-11T10:04:18Z")

</div>

> [@Briga](#):
>
> To see the TRACE I believe you should be in RTE mode (and not running on the Wireless CPU). Is that the case?

No, that is not the case.

---

<div class="post-metadata">

**Author:** ![mag\_knu](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mag\_knu](https://forum.sierrawireless.com/u/mag_knu)\
**Post date:** [February 11, 2009, 10:45am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/4 "2009-02-11T10:45:43Z")

</div>

Ok, I was running in Target mode so that might be the case. strstr(char \*, char \*) is a good idea!

I encountered a new problem during testing, the GSM module only replys:  
+wind: 12,0  
+wind: 13  
over and over…  
At documentation says:  
12 an interruption has occurred  
13 the rack has been detected as closed

I’ve tried to use the rested pin on hd 15, but still the same reply.  
Does not respont to any at commands.  
??  
Thanks for any help

---

<div class="post-metadata">

**Author:** ![Tom\_Verbeeck](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tom\_Verbeeck](https://forum.sierrawireless.com/u/Tom_Verbeeck)\
**Post date:** [March 6, 2009, 1:42pm UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/5 "2009-03-06T13:42:58Z")

</div>

Hi,

I have got the same problem. The module Q2686 doesn’t respond on any AT command (include at). Only +WIND: 13 is visible.  
Does anybody know how to start is back again ?

---

<div class="post-metadata">

**Author:** ![Madouc](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Madouc](https://forum.sierrawireless.com/u/Madouc)\
**Post date:** [March 6, 2009, 7:48pm UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/6 "2009-03-06T19:48:22Z")

</div>

> [@Tom Verbeeck](#):
>
> The module Q2686 doesn’t respond on any AT command (include at). Only +WIND: 13 is visible.  
> Does anybody know how to start is back again ?

have you tried to reupload the firmware using dwlwin?

---

<div class="post-metadata">

**Author:** ![Tom\_Verbeeck](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@Tom\_Verbeeck](https://forum.sierrawireless.com/u/Tom_Verbeeck)\
**Post date:** [March 9, 2009, 8:23am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/7 "2009-03-09T08:23:15Z")

</div>

I downloaded dwlwin. Alter erasing the software the problem was solved. Thanks !

---

<div class="post-metadata">

**Author:** ![Madouc](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Madouc](https://forum.sierrawireless.com/u/Madouc)\
**Post date:** [March 9, 2009, 11:28am UTC](https://forum.sierrawireless.com/t/sms-autoreply/2915/8 "2009-03-09T11:28:46Z")

</div>

upgradig to the latest frimware might prevent these problems.  
the new frimware (from 7.x i think) has a 20 sec timeout after a reset occures (if the reset is triggered by a foulty application.)  
also if the application crashes 8 succesive times it doesn’t start the application anymore.
