[From QnA]MTU size, s2w data packing and s2w data overflow

Our client is faced with the following problem: Wi-Fi module WizFi210 accumulates data greater than 1500 bytes, and sends them one bundle, it turns out that even the higher the value, the MTU of 1500 bytes in the computer and the router (for some models wifi routers this value is the maximum) it is impossible to ensure the guaranteed transfer large amounts of data. Question is, is there any at commands that you can limit the stack within a module or his own MTU? If there is, could You send us a list of these at commands module.

The device client sends the module WizFi210 many packages 100-200 bytes, in ideal conditions, connection, the module does not have time in its internal buffer to gain more than 1500 bytes and successfully sends data. In case when the connection is unstable, delays in transmission of data in the buffer accumulates more than 1500 bytes, then the module sends one package. In this case, the module exceeds the permitted in the network MTU and receiver (in this case the server) cannot handle this package, the result will break the link.
What can be done in this situation?
  1. WizFi210 doesn’t have commands to control MTU size.

  2. But, WizFi210 have some commands for data packing option as below.

In Bulk Data Mode, data transfers are managed using escape sequences (Esc Z).
Each escape sequence starts with the ESC key (ASCII character 27 (0x1B)).
Encoding is used for both transmitted and received data.
Enable bulk data by using command <AT+BDATA=1> (1 is enable and 0 is disable).

The format of a bulk data frame is:
Z<Data Length xxxx 4 ascii char>

The contents of < > are a byte or byte stream.

  • CID is connection identifier (UDP, TCP, etc.; as derived when TCP socket is created by issuing the command: AT+NCTCP, for example.)
  • Data Length is 4 ascii char represents decimal value i.e. 1400 byte (0x31 0x34 0x30 0x30).
  • The Data Length range should be 1 to 1400 bytes.
  • User Data size must match the specified Data Length. Ignore all command or esc sequence in between data pay load.
    User should send the specified length of data to the adapter irrespective of any asynchronous events happened on the adapter so that the adapter can start receiving next commands.

For example, if CID value is 3, then:

  • To send a 5 byte user data (e.g. ABCDE) for a TCP client connection, the format will be:
    Z30005ABCDE
  • To send a 512 byte user data for a TCP client connection, the format will be:
    Z30512<512 bytes of user data>

And, you can refer to the <WizFi210 Programmer’s Guide>.

  1. To avoid the WizFi210-internal-buffer overflow, you should use UART-HW-Flow-Control(CTS, RTS).

In other words, before WizFi210-internal-buffer begins to overflow, WizFi210 will block using CTS/RTS pin.
So, if you use HW-flow-control of WizFi210, you don’t need to worry about WizFi210-internal-buffer overflow.

If you are using the SPI interface, do the UART busy lines still apply?
If not, how can you ensure you don’t overflow buffers?

Hi

I think that If you use flow control of UART, you can avoid overflow of buffers.

Yes, but we were planning to use spi.

Hi Wieser

I think there are 2 available options.

  1. Using SPI S/W flow control

  2. Flow Control as application level
    It means that doesn’t send a next data until receiving a <recv ok message, a kind of Ack> from .