WiFi SPI communication timing issue
I am using the Arduino Wifi Shield and Arduino Mega 2560.
I wrote a simple wifi client sketch using the WiFiClient to communicate with a TCP/IP sever running on a PC.
When I use the WifiClient functions [print(), println() or write()] to send more than 92 bytes, the return value of the function call indicates zero for print() and write() and 2 bytes for println().
For example the following code count = client.println("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); Serial.print("Wrote bytes = "); Serial.println(count);
using char arrary to hold the data and passing the address to the send functions also produce the same problem.
The Serial.println() indicates only 2 bytes were written. I confirmed that Server only received 2 bytes by checking with wireshark.
It appears there may be some SPI timing issue between the Arduino processor (I Used Arduino Mega 2560) and the WiFi shield.
If I send less than 92 bytes, no problem everything works fine.
we have recently updated the firmware and the library. Your issue should be solved with the latest work made on the library. Can you try to upgrade the firmware (http://arduino.cc/en/Hacking/WiFiShieldFirmwareUpgrading) and try out the new library that you can find in the master (https://github.com/arduino/Arduino/tree/master/libraries/WiFi)?
Closing for lack of feedback. Feel free to reopen if the issue is still present.