Sending data to arduino (ethernet shield)

Is there some good ways to send data to arduino using ethernet shield? I tryed udp-sending which worked ok, but seems there is a message size problem.

There may be good ways to send data to an arduino using an ethernet shield depending on what is desired.

zoomkat:
There may be good ways to send data to an arduino using an ethernet shield depending on what is desired.

Actually is it clever to use udp to send command to arduino and then arduino get details from other place? I try send only simple message that arduino get mysql data from other place. Or another thing was that I use php-form to send mysql-database data to arduino.

I tryed this example. There was a size problem but also other problem was that how can I clear data from buffer?

tolerance_zero:
I tryed this example. There was a size problem but also other problem was that how can I clear data from buffer?

So I answer to my own question like many times before.

Clear buffer data:

  for( int i = 0; i < sizeof(packetBuffer);  ++i ){
     packetBuffer[i] = (char)0;
  }

Its actually possible send multiple udp messages just using that method.

But can also change a buffer size.

Why UDP_TX_PACKET_MAX_SIZE have 24 bytes?
http://forum.arduino.cc/index.php?topic=103502.0

Clear buffer data

You clearly do not understand the purpose of the NULL in the array. It is a STOP sign. If the code won't stop at the first stop sign, why do do assume that it will stop at any other stop sign?

Its actually possible send multiple udp messages just using that method.

Using what method? It is not necessary to "clear the buffer" to put something else into it. Do you vacuum all the air out of your coffee cup before pouring coffee into it?

But can also change a buffer size.

Is that a question or a statement?

Why UDP_TX_PACKET_MAX_SIZE have 24 bytes?

Because 17 is a weird size.

My preference would be to start up a http server on the arduino, and to take the data either as JSON or as a blob of binary.Another option is using an html form. It depends on what's sending it.

  1. start up HTTP server.

  2. read a GET request.

  3. id the get request has parametrs, decode them and do stuff.

  4. send back some html:

<html><body>
<p>I just did some stuff</p>
<form action="/" method="GET">
What should I do next? <input name="todo" type="text"></input>
<input type="submit"></input>
</form>
</body>

you should get a http block looking like this

GET /?todo=do+this HTTP/1.1
a-header: a value
a-header: another value
---blank line---

You'll need to parse out the query string in the GET request line. Be sure to read all the headers down to the final blank line, even if you don't do anything with them.

This gives you a simple web interface to your arduino.