Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

WiFi SPI communication timing issue

Open shankar108 opened this issue 13 years ago • 2 comments

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.

shankar108 avatar Apr 01 '13 15:04 shankar108

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

Fede85 avatar Apr 16 '13 20:04 Fede85

Closing for lack of feedback. Feel free to reopen if the issue is still present.

cmaglie avatar Jul 01 '15 13:07 cmaglie