Wiz810MJ not receiving data correctly

Hi, I am sending 7 bytes of data via socket 1 of a Wiz810MJ module to a serial device. I have noticed that sometimes the Wiz810MJ does not receive all of the bytes sent to it.

Below is a portion of a log file showing how many times the data was transmitted before an error occurred, the data that was sent and the data that was received. This file only logs the errors, all other data transmissions were correct.

When an error occurs, and the Rx register of the Wiz810MJ is checked to see how many Rx bytes are available, it shows that not all the data bytes were received. For example, the data, H5=65/r/n, was sent 174 times without any errors and then on attempt 175 an error occurred where the data received was H5=. When the receive buffer of the Wiz810MJ is checked, it shows that 3 bytes are available. The remaining 4 bytes of data are lost.

Times Data β€œData Data avail
Sent Sent Received” in buffer
175 H5=65/r/n β€œH5=” 3
1108 H5=65/r/n β€œH5=” 3
3134 H5=65/r/n β€œH” 1
6500 H5=65/r/n β€œH5=” 3
6966 H5=65/r/n β€œH” 1
8242 H5=65/r/n β€œH5=” 3
9058 H5=65/r/n β€œH5=” 3
9309 H5=65/r/n β€œH5=” 3
10928 H5=65/r/n β€œH” 1
11346 H5=65/r/n β€œH” 1

When the same tests are performed on a commercially available Ethernet to serial converter, no data errors occur. What could cause this to happen with the Wiz810MJ?

Kind regards.
Leo

Explain how you transmit information over the network. Open connection, transmit, close? Or you open persistent connection and transfer data over the live socket?
Which software you use to access the chip?

We open a persistent connection and transfers over the live socket.

I use Flowcode v 7 to programme a PIC.

Persistent connection assumes TCP, and you know that under TCP no data is expected to be lost by the protocol design, however it can be omitted due to incorrect data flow handling.

As you say another implementation works well, thus we assume that sending device is operating correctly.

It is important to know how remote device sends this data - does it send in single packet (7 bytes in one packet), or one character in one packet (thus 7 packets - some terminal programs work this way - it sends single char as soon as it is typed).

So I suspect that something wrong is happening at the side of W5100, but for this you will have to review the driving code.

For example, you read RX_RSR value in loop; while RX buffer is being filled, and if it is filled not with all 7 chars at a time, but char-by-char, at some point in time RX_RSR pointer can be less than 7. Thus in general in the W5100 state checking loop you must wait for required number of chars received (instead of just waiting for RX_RSR!=0) before you go to data acquisition phase.

Thank you for the reply.

I will ask our software engineer how the dats is sent and check on Wireshark what is on the wire.

I will also enquire how Flowcode handles the data acquisition to see whether this can be where the problem lies.

Best regards.
Leo

1 Like

Hi,

To answer your question, the remote device sends the data, i.e. 7 bytes in this test, in 1 packet.

I have attached a Wireshark session. Transmission # 47 shows the PC (192.168.168.10) transmitting the data to the Wiz810MJ (192.168.168.1) via TCP. The data is processed and sent to the commercial device via their serial ports. Transmission # 48 shows the commercial device (192.168.168.2) sending the received serial data, which is one byte, to the PC.

The individual parts of the processes on the device with the Wiz810MJ where checked and the serial sending circuitry and the serial receive/TCP send part of the circuitry works with absolutely no errors. The commercial device also has no errors in either direction.

Unfortunately I have not received any response from the manufacturer of the IDE , so I cannot comment on how the driving code works.

Kind regards.

Leo