Receiving SMS twice


#1

In Q24Plus

My smsdatahandler receiving the same sms twice.

What could be the problem?

Please any suggestions.


#2

How are you certain that it is the same SMS?

Does your unit crash or restart on receiving the SMS? If so, the network may not get the confirmation that the message was received; therefore, it assumes that the message was not received - and re-sends it.


#3

Please refer to the traces below. I am querying one time from my base station and till i get response i am not sending any new SMS.

[b]First SMS [/b]
Trace	IP	1	Inside smsDataHandler
Trace	IP	2	New Message Received
Trace	IP	2	+919972498121
Trace	IP	2	09/07/28,12:39:08+22
Trace	IP	2	#00Q0!
Trace	IP	2	Memory allocated
Trace	IP	1	After copying to Structure
Trace	IP	2	+919972498121
Trace	IP	2	09/07/28,12:39:08+22
Trace	IP	2	#00Q0!

[b]second SMS[/b]
Trace	IP	1	Inside smsDataHandler
Trace	IP	2	New Message Received
Trace	IP	2	+919972498121
Trace	IP	2	09/07/28,12:39:08+22
Trace	IP	2	#00Q0!
Trace	IP	2	Memory allocated
Trace	IP	1	After copying to Structure
Trace	IP	2	+919972498121
Trace	IP	2	09/07/28,12:39:08+22
Trace	IP	2	#00Q0!

My system never restarts after receiving single or multiple SMS
After receiving SMS i dynamicaly store and process after some.
My smsdatahandler returns FALSE after copying to dynamic link

During processing the dynamic link i am unsubscribing and subscribing the sms


#4

Why? :confused:


#5

In order to not to receive any new sms that may lead problem to dynamic link chain while processing the link.

During sms receive i am allocating memory adl_memGet and linking the SMSs by dynamic link.

During processing SMSs i releasing each link i.e adl_memrelease


#6

I think you are programming with the typical uC. In Wavecom OS, must of the services work as “events” not as “interruptions”. Using dynamic links, is useful if you generate them on an interruption that may stop temporally critical operations.


#7

what sends you sms? maybe the fault is on sender side, maybe you receive 2 smses actually.


#8

That’s not necessary!

Your Open-AT application runs in a single “thread” - so you can’t get another SMS Event until you’ve finished processing the previous one!


#9

True…

… but not so sure what you mean by that?

In many ways, an “event” is very much like and “interrupt” in a “normal” microcontroller system.

The big difference, as I see it, is that you don’t provide the “main” loop in Open-AT (that is part of the Wavecom OS) - you just provide the event handlers…

It’s rather like Windows programming in that respect…


#10

What I mean is:
In events, if incoming SMS events arrive, no more events will be handled until last action on the callback is taken.
In interrupts, if an incoming interrupt arrive, a new one can freeze it before you handle it. That’s why is typical to unsubscribe/disable new interrupts while you handle an interrupt.


#11

Hi All,

I found the problem and was due to bug in my code
Mistakenly i subscribed SMS twice that was given this problem. In one point of my code i missed for checking my smssubcribe flag and i was subscribing again that led to this problem.

  1. IS unsubscribing sms will not give SMSs to application or for a whole module (modem + Openat)?

  2. If the above case is true will it keeps pending and send after sms subscribe is done?

“Cause I was not clear for above doubts from the document i have”


#12

Can i do SMSsubscribe and unsubscribe multiple times depending upon the situations?


#13

I can’t process single SMS and reply because my application will keeping reading data from externally connected device and after reading cycle finish it checks the SMS or SMSs received and respond to the sms or SMSs received.

During reading the Device my application will only stores the sms and it should not send SMS while reading device.


#14

In that case, you need some kind of “queue” or “buffer” to store the SMS messages until you can handle them.

If you unsubscribe the SMS service, you will lose any messages that are received while not subscribed.


#15

OK, I see what you mean, but that does depend on the particular processor - some will block further occurrences of the same interrupt until an existing occurrence has been fully serviced…


#16

The healthiest is blocking by SW, because versions of the same architecture, may automatically block or not depending on the manufacturer.


#17

You are right. I have implemented Queue and for that i am using adl_memget and adl_memrelease memory services.


#18

After implementing Queue My application is now not burdened with smssubscribe and unsubscribe