Possible WiFi SPI communication timing issue
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
- print()
- println()
- 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.
You are writimg the string address
Can you please explain what you mean by string address. the WifiClient has println(), print() and write(). The println() takes constant literals as arguments. I used the F() function then it appears to work but the single 100 byte constant literal gets broken down to 4 TCP/IP frames by the receiving Server. The MTU size for the network is 1418. Onc emy finish my implenetation I would be reading data from multiple sensors and aggregated into a single message and sent back to the server. I expect the aggregated sensor mesage to be around 350 Bytes. That is why I writing a simple TCP/IP client sketch to send out message as a first step.
Any input is very much appreciated.
Thanks Shankar
The string is a char pointer of 2 byte, what if you write the string byte per byte? Maybe it is a ram problem. For the string that get broken you should look at the library implementation.
But then why you closed the issue? Il giorno 01/apr/2013 19:57, "shankar108" [email protected] ha scritto:
Can you please explain what you mean by string address. the WifiClient has println(), print() and write(). The println() takes constant literals as arguments. I used the F() function then it appears to work but the single 100 byte constant literal gets broken down to 4 TCP/IP frames by the receiving Server. The MTU size for the network is 1418. Onc emy finish my implenetation I would be reading data from multiple sensors and aggregated into a single message and sent back to the server. I expect the aggregated sensor mesage to be around 350 Bytes. That is why I writing a simple TCP/IP client sketch to send out message as a first step.
Any input is very much appreciated.
Thanks Shankar
— Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/issues/1336#issuecomment-15727297 .