Show Posts
Pages: 1 [2]
16  Using Arduino / Networking, Protocols, and Devices / Re: Smartphone -> Arduino Ethernet Server on: September 23, 2012, 07:07:29 am
Thank you very much, Comment #2 says everything: Client.stop() dropps the connection to early when transmitting a large amount of data or the connection is slow.

I propose the following solution:

while (W5100.getTXFreeSize(_sock) < 2048) {
          // time out handling should be implemented here !                                 };
client.stop();

This gives the W5100 time to send all data. Works fine and much more stable than the "delay(1)" method.

edit: my good old win mobile 6.5 smartphone is fast enough for me, the problem is the gsm net (pure gsm: 14K under good conditions)
17  Using Arduino / Networking, Protocols, and Devices / Re: Smartphone -> Arduino Ethernet Server on: September 23, 2012, 03:44:32 am
Quote
throttled to 48k up and down
48K is far beyond my gsm connection !
Thank you for your code. That speeds up transmission significantly.

But i have a question to the ethernet library: What happens if more data is printed via client.println, sprintf,... than the W5100's buffer can hold ? Is the client.print command blocking further program execution until enough data is read ? I think no.

But what happens to the data, that exceeds the buffer ?
18  Using Arduino / Networking, Protocols, and Devices / Re: Smartphone -> Arduino Ethernet Server on: September 22, 2012, 12:23:21 pm
Quote
thru Verizon 3G

a 3G network isn't "slow". i meant pure gsm ! on 3G i believe everything works fine.

I think you are right by avoiding client.print, etc. . But how to pack a ton of html in a character array ???
With client.print(" i can use copy and paste from the an editor.
Does client.sprintf work ? Didn't see it in the reference. Do have perhaps a piece of code for me ?
19  Using Arduino / Networking, Protocols, and Devices / Re: Smartphone -> Arduino Ethernet Server on: September 22, 2012, 11:28:34 am
Maybe it's another problem too: I want to client.println about 80 lines before connection is be closed. Is that to much for the W5100's buffer ?
Does the ethernet library prevent buffer overflow's of the W5100 ?
20  Using Arduino / Networking, Protocols, and Devices / Re: Smartphone -> Arduino Ethernet Server on: September 22, 2012, 10:51:40 am
Quote
in a while(client.connected()) loop, use a while(client.available() > 0) loop to read all the data

That's exactly my code. But the problem still exists: In case of a verry slow internet connection such as gsm, the server closes the connection, BEFORE the client has read all data.
Which means: client.connected() returns false even not all data is read.

Just try !

I which i had a better mthod than "delay(3000)" to work arround that behavior !
21  Using Arduino / Networking, Protocols, and Devices / Smartphone -> Arduino Ethernet Server on: September 22, 2012, 08:40:31 am
The Ethernet Server example works fine with the standard delay(1) before client.stop() on fast internet connections such as Ethernet, DSL,...
But my problem is: when i want to connect from smartphone to the arduino (e.g.via dyndns), the html page is transmitted broken.Only if i change to delay(3000) or higher, i get the complete page.

Is there any way, the arduino can determin, whether the page has been completely transmitted ?

The "delay method" doesn't seem to be very stable with low transmission rates.

Is there any better way ???
22  Using Arduino / Storage / Re: Bug in SD library ?! on: September 08, 2012, 04:49:17 am
OK, found the answer myself:
After each openNextFile is a close() required. Otherwise too many files are obviously left open.

Example in the reference does not show this; perhaps someone could correct this.
23  Using Arduino / Storage / Bug in SD library ?! on: September 08, 2012, 03:22:43 am
I'm new here, but i've a problem with the SD library (arduino 1.0.1., Mega 2560 +SD on Ethernet shield):

I want to dump the directory of an sd card as often as a user want's.
The following code e.g. work's for fine for a few (depends on how much entries exist) loops. Then less directory entries are found, at last even none !
Can anyone help ?
Code:
#include <SD.h>

  void setup() {
    Serial.begin(9600);
    SD.begin(4);
  }

void loop()   {
            File root = SD.open("/");
            File entry =  root.openNextFile();
            while(entry) {
              Serial.println(entry.name());
              entry =  root.openNextFile();
              }
            root.close();
            Serial.println();
            delay(1000);
}
24  Using Arduino / Networking, Protocols, and Devices / Re: Question on Ethernet-Shield / datatypes on: September 05, 2012, 07:55:10 am
Thank you very much

can't help wondering, why that feature isn't mentioned in the reference at all ?!
25  Using Arduino / Networking, Protocols, and Devices / Question on Ethernet-Shield / datatypes on: September 05, 2012, 03:43:21 am
Hello, i am new on this forum but have the following problem:

The EthernetServer Object has a "write" Method, which accepts only 1 Byte Arguments, such as char. Sending with that write Method works fine, but results in only one Byte in a TCP-packet, which makes communication slow and produces a lot of IP overhead.

With the "print" Method, whole up to 255 bytes can be send in one packet, but it terminates if a 0 value occurs. Therefore this Method is not suitable for transmitting jpg files e.g.

My question is: How to send more then one byte per tcp packet ???
Pages: 1 [2]