Wip_write fails with error WIP_CERR_RESOURCES

The TCP/IP communication between our SL6087 module and our server works fine until the module moves into a region with bad/no reception. The data is queued on the module and once communication could be established again, the data is sent to the server. If there is substansial data to send, the wip_write function returns (after some data has been sent) the error: -992 WIP_CERR_RESOURCES (No more TCP buffers available) and shortly after the module reboots with a watchdog reset. We get the number of bytes that can be written using the WIP_COPT_NWRITE option and only write this amount of data using the wip_write command if there is more data than that, otherwise all data is sent. The WIP_CERR_RESOURCES problem was fixed by implementing the following as stated in the WIP manual:
“When return value of wip_write function is zero or write attempt writes less data than the requested data, then an application must wait for WIP_CEV_WRITE event before calling wip_write function again.”

Even with this fix we still get a watchdog reset. Any ideas what may cause this? Is there some WIP resources that take long to release?

We do not encounter this problem during normal operation and call wip_close on WIP_CEV_ERROR, WIP_CEV_PEER_CLOSE and when we are finished sending all data.

There is another thread with similar problems but it has no solution and is 4 years old!:
[url]https://forum.sierrawireless.com/t/wip-close-shutdown-abort-release-resources-problem/1974/1]

Any help would be greatly appreciated.

Hi,

According to WIP:

WRITE event will be received when:
1.channel is opened for the first time(i.e. buffer is empty)
2.write attempt writes less data than the requested data and there are more than WIP_COPT_SND_LOWAT(MIN) bytes available in the buffer

In case of WIP_CERR_RESOURCES problem i.e. buffer is not available to write data, no WRITE event will be received and wip_write function will not be called.

Try to close all opened channels and reopen them. With this action, the IP stack should retreive all memory resources without need of module reboot.

Thanks.