BUENAS, mi problemas es que no puedo conseguir que se envie de forma continua paquetes UDP, SIN que se le
solicite al "server".
es decir, siempre que se quiere enviar algo desde el arduino, lo que sea , se debe hacer una peticion
para que envie, salve la redundancia.
con la placa de arduino ethernet, pasa lo mismo ??
hay alguna solucion, una pista donde deba buscar
he usado esta libreria que sinplifica el envio de paquetes. usa esta funcion
es.ES_make_udp_reply_from_request(buf,reply,8,12345);
http://www.kmtronic.com/software/DINo/EtherShield_Arduino_v1.zip
#include "EtherShield.h"
uint8_t mymac[6] = {0xCF,0x70,0x7C,0xE4,0x8A,0xB8};
uint8_t myip[4] = {192,168,1,25};
uint16_t MYWWWPORT = 80;#define BUFFER_SIZE 750
static uint8_t buf[BUFFER_SIZE+1];char reply[]="00000000";
EtherShield es=EtherShield();
///----------------------------------------------------------
void setup(){es.ES_enc28j60Init(mymac);
es.ES_init_ip_arp_udp_tcp(mymac,myip, MYWWWPORT);} // end setup
///----------------------------------------------------------
void loop(){es.ES_make_udp_reply_from_request(buf,reply,8,12345);
} // end loop
para enviar al arduino he usado este programita:
http://kmtronic.com/kmtronic-dino-internet-ethernet-relay-io-board-udp-example.html
[KMTronic DINo 4 Relay UDP Test Software.zip](http://KMTronic DINo 4 Relay UDP Test Software.zip)
tambien se lo puede hacer con el programa processing, en un ejmplo para enviar y resivir paquetes Udp
/*
Processing sketch to run with this example
=====================================================
// Processing UDP example to send and receive string data from Arduino
// press any key to send the "Hello Arduino" message
import hypermedia.net.*;
UDP udp; // define the UDP object
void setup() {
udp = new UDP( this, 6000 ); // create a new datagram connection on port 6000
//udp.log( true ); // <-- printout the connection activity
udp.listen( true ); // and wait for incoming message
}
void draw()
{
}
void keyPressed() {
String ip = "192.168.1.177"; // the remote IP address
int port = 8888; // the destination port
udp.send("Hello World", ip, port ); // the message to send
}
void receive( byte[] data ) { // <-- default handler
//void receive( byte[] data, String ip, int port ) { // <-- extended handler
for(int i=0; i < data.length; i++)
print(char(data[i]));
println();
}
*/