WIP_CEV_ERROR after 4 hours


#1

I am programming a Q2686 module which should send at a given rate (1 hour for the moment) data.
I am using OpenAT 4.12 , WIP 1.10.03 , firmware 6.61.

Everything works well but the GPRS connection : after 4 hours (sometimes less, but those 4 hours may be exactly the same even if the “send rate” is 20 minutes for exemple) I can’t connect anymore to my server. I don’t have memory leaks (tested with a free memory function).

Here is more or less the way I proceed :
At boot time, I do :
wip_netInitOpts(WIP_NET_OPT_SOCK_MAX, 1, WIP_NET_OPT_END);
wip_bearerOpen( &bearer_GPRS, “GPRS”, handler_GPRS, NULL);

And then for each connection :
wip_bearerSetOpts(bearer_GPRS,
WIP_BOPT_GPRS_APN, config.GPRS_APN,
WIP_BOPT_END);
wip_bearerStart(bearer_GPRS);
After receiving WIP_BEV_IP_CONNECTED :
TCP_connection = wip_TCPClientCreate ( config.URL, (config.TCP_port), TCP_connection_eventHandler, NULL);
After receiving WIP_CEV_OPEN :
some wip_read ( TCP_connection, buffer, i );
and some wip_write(TCP_connection, buffer, buffer_size);
And finally :
wip_close(TCP_connection);
And after a 2 seconds timer :
wip_bearerStop(bearer_GPRS);

Is there something wrong in that way of proceeding ?
Did one of you ever had a similar problem ?

Thanks in advance for any piece of advice.


#2

I am self-responding …

I managed to get my module working : when I get a WIP_CEV_ERROR, I now make (after a 5 seconds wait, just to be sure) :
wip_bearerClose( bearer_GPRS );
wip_netExit();

And then I come back to the whole connection procedure, including the 2 functions I call at boot time.

It now seems to work (it has been running all night long).


#3

You must be careful.
On every connection your provider charges you with a minimum data transfer. If for some reason your module connect - disconnect from GPRS network very often (continuous loop connect - error), you will have extra data amount transfer.