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