Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible WiFi Shield SPI communication timing issue #29

Open
shankar108 opened this issue Mar 29, 2013 · 1 comment
Open

Possible WiFi Shield SPI communication timing issue #29

shankar108 opened this issue Mar 29, 2013 · 1 comment

Comments

@shankar108
Copy link

I wrote a WiFiClient sketch to communicate with a TCP/IP sever running on a PC.

When the WifiClient sends more than 92 bytes using

  1. print()
  2. println()
  3. write()
    functions, the return value that indicates how many bytes were written is zero for print() and write(). It is 2 bytes for println().

For example the following code
count = client.println("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
Serial.print("Wrote bytes = ");
Serial.println(count);

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.

@liudr
Copy link

liudr commented Apr 21, 2013

I don't know enough about SPI bus but I do share this problem. I didn't pinpoint the limit but in my case the client.print() will only work properly if the message is less than (90-100) bytes. Splitting the long message into multiple shorter messages and sending them with a for loop and client.print works though. It's just a pain. Any reason to this behavior? I've been looking up and down in different source files but I didn't see a buffer that could limit the message size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants