# WIP\_CEV\_ERROR after 4 hours

**URL:** <https://forum.sierrawireless.com/t/wip-cev-error-after-4-hours/1310>\
**Category:** Open AT\
**Created:** [May 10, 2007, 8:02am UTC](https://forum.sierrawireless.com/t/wip-cev-error-after-4-hours/1310 "2007-05-10T08:02:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlsa](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jlsa](https://forum.sierrawireless.com/u/jlsa)\
**Post date:** [May 10, 2007, 8:02am UTC](https://forum.sierrawireless.com/t/wip-cev-error-after-4-hours/1310/1 "2007-05-10T08:02:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jlsa](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jlsa](https://forum.sierrawireless.com/u/jlsa)\
**Post date:** [May 11, 2007, 7:11am UTC](https://forum.sierrawireless.com/t/wip-cev-error-after-4-hours/1310/2 "2007-05-11T07:11:47Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![sefer](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@sefer](https://forum.sierrawireless.com/u/sefer)\
**Post date:** [May 11, 2007, 1:01pm UTC](https://forum.sierrawireless.com/t/wip-cev-error-after-4-hours/1310/3 "2007-05-11T13:01:59Z")

</div>

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.
