I'm playing with a GSM module (WAVECOM Q2406 if it matters). I know that the
PLMN with which I establish a GPRS session deactivates the PDP-context every
30 minutes if MS sends no data. My problem is that I would like to find out
whether I'm deactivated. I know that normally this is not a problem, but add
to the picture a fact that the deactivation messages don't reach the mobile
(I may be temporarily out of range when this happens). Is there a way to
find out reliably that the PDP context is deactivated?
Saying "AT+CGACT?" doesn't do the job. I made an experiment. I shielded my
mobile, waited long enough to ensure that PLMN deactivates PDP-context then
un-shielded the mobile and issued the command. I got:
+CGACT: 0,0
+CGACT: 1,1
OK
Context "1" is what I activated and what gets deactivated(while I don't see
it). Any suggestions are appreciated!
Piotr
> I'm playing with a GSM module (WAVECOM Q2406 if it matters). I
> know that the PLMN with which I establish a GPRS session
[quoted text clipped - 20 lines]
> deactivated(while I don't see it). Any suggestions are
> appreciated!
Have you looked at the "AT+CGREG" command (assuming it's
supported by your module)?
AT+CGREG=1
should at least notify you when you loose GPRS coverage and when
you regain it (via unsolicited "+CGREG: <stat>" messages).
Whether it can also tell you if the session is still active or
not must surely depend on whether there's been an over-the-air
interaction on regaining coverage.
If it's then simply a matter of forcing an interaction of any
description with the network on regaining coverage, then an
appropriate supplementary services command should be both
straightforward and free. For example:
AT+CLIP?
just might result in your GPRS status being updated as a
side-effect.
John
blue box thief - 15 Feb 2008 14:11 GMT
>> I'm playing with a GSM module (WAVECOM Q2406 if it matters). I
>> know that the PLMN with which I establish a GPRS session
[quoted text clipped - 5 lines]
>> happens). Is there a way to find out reliably that the PDP
>> context is deactivated?
<SNIP>
> Have you looked at the "AT+CGREG" command (assuming it's
> supported by your module)?
[quoted text clipped - 3 lines]
>
> John
<SNIP>
while I'm more familiar with actual core messages, when yo uget an active PDP
context, your UT will get an IP address.
Would it be something as simple as checking, when you "think" your UT
has disconnected, if your modem still has an IP address.
When your UT receives a PDP De-activate message, the IP address assigned
will be released and reused in the APN DHCP pool (unless your a corporation
who pays a fortune for static addresses...).
Just a thought...
hth,
b
Piotr Pietraszkiewicz - 15 Feb 2008 16:46 GMT
>>> I'm playing with a GSM module (WAVECOM Q2406 if it matters). I
>>> know that the PLMN with which I establish a GPRS session
[quoted text clipped - 23 lines]
> Would it be something as simple as checking, when you "think" your UT
> has disconnected, if your modem still has an IP address.
That could work, if the disconnection messages reached me. But then the
regular "CGACT?" would work too. In the scenario I described the PDP
context deactivation is overlooked. The problem is that I have the IP
address
assigned, but don't know if its a valid one.
> When your UT receives a PDP De-activate message, the IP address assigned
> will be released and reused in the APN DHCP pool (unless your a
> corporation
> who pays a fortune for static addresses...).
>
> Just a thought...
Thanks, anyway.
Piotr
Piotr Pietraszkiewicz - 15 Feb 2008 16:35 GMT
Thanks for your suggestions. I include my comments inline.
>> I'm playing with a GSM module (WAVECOM Q2406 if it matters). I
>> know that the PLMN with which I establish a GPRS session
[quoted text clipped - 27 lines]
> should at least notify you when you loose GPRS coverage and when
> you regain it (via unsolicited "+CGREG: <stat>" messages).
Yes.. and that seems to work. But "not registered" does not imply
"deactivated".
When I am out of coverege the status changes to "not registered", when I
have
the coverege again the status changes back to "registered". I'd like to
preserve
the GPRS session in cases where I'm temporarly out of coverage. But I would
also like to be sure that the GPRS session is still valid after I regain the
coverage.
> Whether it can also tell you if the session is still active or
> not must surely depend on whether there's been an over-the-air
[quoted text clipped - 9 lines]
> just might result in your GPRS status being updated as a
> side-effect.
This one looked very promising. I just tried it, but the status remains
unchagned. The device still claims it is "activated" afterwards. But perhaps
some other commands have the side-effect you described.. I did not think of
this earlier. Thanks. I'll keep on trying.
Piotr
John Henderson - 16 Feb 2008 00:08 GMT
> This one looked very promising. I just tried it, but the
> status remains unchagned. The device still claims it is
> "activated" afterwards. But perhaps some other commands have
> the side-effect you described.. I did not think of this
> earlier. Thanks. I'll keep on trying.
This suggestion isn't exactly what you asked for, but is your
aim to keep the context active (rather than simply check its
status)?
If so, then
AT+CGATT=1
_might_ achieve that, if you issue this command whenever
"+CGREG: <stat>" indicates that coverage has returned.
GSM 07.07 says "If the MT is already in the requested state, the
command is ignored and the OK response is returned." Whether
this will work will depend on whether it actually tests the
status or trusts its pre-coverage-loss value. GSM 07.07 itself
isn't absolutely clear on this point.
John
Piotr Pietraszkiewicz - 20 Feb 2008 16:48 GMT
>> This one looked very promising. I just tried it, but the
>> status remains unchagned. The device still claims it is
[quoted text clipped - 18 lines]
> status or trusts its pre-coverage-loss value. GSM 07.07 itself
> isn't absolutely clear on this point.
This hint was also promising. Unfortunately it seems it does not test the
status :-(. "OK" is returned the module claims it is activated, but IP
packets don't reach their destination.
I temporarly implemented this workaround(which I don't like):
Whenever state changes from "not registered" to "registered", or "signal not
measurable" to "signal measurable" then I detach and assume my GPRS session
is disconnected. Later(depending on the choosen policy) the software may
decide to automatically rebuild the GPRS session.
I don't like this solution because:
- It is not comfortable for the end user. Being temporarily out of coverage
results in GPRS session being broken.
- It is not reliable. One can imagine that PDP-deactivation messages don't
reach the mobile for some other reason e.g. due to wave interference or
some SGSN problem, maintanance action, etc.
It would be nice to have a message like "hello PLMN do you still have my
context?".
BTW. During "Network initialized PDP deactivation" the mobile sends back the
"Deactivate PDP Context Accept" message. What happens if SGSN doesn't
get this accept message? What does it do? What is specified? Does anyone
know? I found only the good scenarios explained on the web.
I guess I have to educate myself more on the subject. I hope it is just my
incompetence and that there exists a way to prove whether my context is a
valid one.
Thanks again for your suggestions!
Piotr