Arduino Forum

Forum 2005-2010 (read only) => Software => Troubleshooting => Topic started by: eplewis89 on Jun 16, 2010, 07:16 pm

Title: ethernet update speed issues
Post by: eplewis89 on Jun 16, 2010, 07:16 pm
Hey all,

I'm experiencing some update speed issues with the official arduino ethernet shield. I'm outputting an XML packet from my duino, on request, and I want to be able to have the duino handle requests at a rate of 2-4 per second. Currently it can only achieve updates once per 2 seconds. Is there a known issue that is causing my arduino to be slow? I'll post the code in a reply if anyone wants to see what I'm doing.
Title: Re: ethernet update speed issues
Post by: eplewis89 on Jun 18, 2010, 07:00 pm
Is there a fix or am I just SOL?
Title: Re: ethernet update speed issues
Post by: Coding Badly on Jun 18, 2010, 09:04 pm

Have you performed a simple (as in "very tiny amount of fixed data returned") timing test?
Title: Re: ethernet update speed issues
Post by: Spinlock on Jun 20, 2010, 11:31 pm
if your arduino is writing the xml like this:

Code: [Select]
client.print("<some>");
client.print("</some>");


...then you will have multiple packets, one for each print call.  You should minimize the calls to print which will keep more of the data in the chip until you actually want it out.  There is TCP/IP overhead with each packet.

I don't remember my ethernet shield having that hard of a time with speed once I figured out that limitation.

It is hard to tell without some code though.
Title: Re: ethernet update speed issues
Post by: zoomkat on Jun 21, 2010, 12:47 am
Quote
I'm outputting an XML packet from my duino,

Just how many bytes are you putting in the "packet". How many packets are being generated and sent? I've got a simple little servo control setup using the ethernet shield and the control is very quick. Perhaps you are incurring some XML delay and overhead.
Title: Re: ethernet update speed issues
Post by: eplewis89 on Jun 30, 2010, 07:36 pm
sorry for such a late reply. the computer i usually work on isn't available at the moment so i can't share the code. basically, i'm just outputting temperature information from a ds18s20 one wire, and making the arduino act as a web server. i point whatever application i'm using at the arduino's ip address, and it reads the xml and parses the temperature information. the web page is just text, and looks exactly like this:

-----

<xml>
 <temp>14.5</temp>
</xml>

-----

now the application reads that information, and outputs based off of the temperature (in celcius). the problem is that the arduino can only handle, say, 1 request per 2 seconds. i need this to run in real time. like i said, i'd post the code but i currently don't have access to it.