Why is my Wiznet W5500 Module so slow?

I am using an Arduino Mega, connected to a Wiznet W5500 module. (Not a shield)

The unit works. And I can get the bytes back from a HIKVISION camera. BUT, the transfer rate is terribly slow. I get a 275KB image download in approx. 12 seconds.

Am I doing anything wrong in the following code? As I suspect I am.

if (attemptNumber == 2)
    {
      uint32_t x = millis();
     
      //eth();
      while (client.available())
      {
        memset(buf, 0, BUFSIZE);
        client.readBytes(buf, BUFSIZE);
        //Serial.print((char*)buf); // FYI printing at 1M baud adds approx 1 sec.
      }

      x = millis() - x;
      Serial.println();
      Serial.print("DONE:"); Serial.println(x);
      while (1);
    }

With regards to the code, The bufsize is set to 256 bytes, increasing it to 2048 makes no difference.

The initial part of the code is to send the MD5 digest auth, but that all works fine.

Its the return from the camera that takes 12 seconds.

(I dont know if I can mention this here, but when i run the same module on an STM32G0B1KET6 the same thing takes ~1 second.)

Both are set at 16MHz

This code snippet receives nothing at all. It reads a BUFSIZE bytes and immediately clears them
by memset() command.
Please show your REAL code.

That is the REAL code. I am simply running a test to read the data from the camera.

And if you read the code you will see that I am timing how long a read takes.

And without processing the data, it takes 12 seconds.

It is not a bad results for Mega with default SPI clock of 4 MHz

What the library do you use to read the data? Could you show a full code?

How often does that timeout?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.