GPRS service fails after a long time


#1

I start a gprs bearer, launch a TCP/IP server, then sit and wait for client connections. THis all works fine. Except that after a day or few days, if there is no activity, I can not connect a client. The FSU20 does not receive any tcp connection events.
I have learned that the GPRS provider may be dropping the connection (the PDP context). So I have tried shutting down the TCP/IP server and the GPRS bearer and restarting them. However I still seem to run into the same problem. Trouble is I have to leave it a few days to see if it works or fails!
In the failed mode I can still connect via serial, AT+COTS gives me the provider, everything looks OK. I just can’t connect!

Any hints?


#2

I think you just have to assume that the GSM provider may close the connection - and design to cope with that!


#3

Any hints as to what will show me that the GPRS link is no longer valid? The at+cops still gives me the correct details in this failed mode. I have a CGREG handler and no events have been seen by that.


#4

maybe ping a server once a day?


#5

Hiya,

subscribe to the adl_gprsSubscribe() events.

This will let you be notified when a whole lot of things happen (such as the network has forced a detachment of the modem). Have a look at section 3.18 of the R7.4 ADL User Guide…

ciao, Dave


#6

Thanks, will do.


#7

But it only relates to the GPRS radio link - it tells you nothing about the IP link from the GPRS network out to the internet.

Operators do drop the IP link from the GPRS network out to the internet for various reasons at various times - and there is no specific indication to the mobile. :frowning:

If you’re using a specific M2M service provider, they should be able to give you details of their policies on this (which may depend on the level of service you’ve subscribed) - but, if you’re just using a standard public network, such technical details are notoriously difficult to obtain (and probably aren’t guaranteed anyhow). :frowning:
See: viewtopic.php?f=34&t=1106
As an aside on using “a standard public network” see also: viewtopic.php?f=34&t=2147

The only way to confirm that the IP link from the GPRS network out to the internet is still working is, as Madouc suggests, to do some kind of “ping”.


#8

Thanks for the confirmation. This seems to be the only way, pinging something. It has worked for a number of days, before loosing the connections previously. But its not reliable.


#9

Radio networks are iherently unreliable - so your application must be designed to cope with loss of the link!


#10

Hello to all,

i think this could be due to a change of IP address

some times the gprs provider changes it every two-three days …

may be you need to test for an IP change and update the clients to switch to the new address

but i don’t know how to read the assigned ip address … i think we have a structure in wip reporting it.

can someone help us ?

Enrico


#11

No, I don’t think the provider changes it; I think they just drop your link, so you lose it.

It’s then up to you to establish a new link - which, of course, will result in a new IP address…


#12

Us this code snipe to get your current IP assigned by provider (maybe public):

wip_in_addr_t appIpAddr;
wip_bearerGetOpts(bearer,WIP_BOPT_IP_ADDR,&appIpAddr,WIP_BOPT_END);