Go Down

Topic: Problems sendind udp comands (Read 124 times) previous topic - next topic

11Vane

Im trying to send an udp comant control to my laptop , from shield…
Im sending at the same time same content to the serial conexión

Just to check this sendings im using Hércules software to know if something is coming to te laptop i.p
the problem ihat im recieving by the serial one but cant see anything from udp hercules viewer

i ve chacked that the laptop ip is the correct one … it can be the port? does the laptop have an specific port to send or recieve udp cpmands?


here is my code


Please let me know how to do.

Another thing is.. how i can get the ethernetudp.h library?


thanks a lot


//////////////////////////////////////////////////7

#include <SPI.h>
#include <Ethernet.h>


EthernetUDP Udp;
byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x5C, 0x18};
IPAddress ip(192,168,1,15);
unsigned int localport = 8888;

IPAddress remoteIP(192,168,1,122);
unsigned int remotePort = 8888;
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);

void setup(){
 Serial.begin(9600);
 Serial.println("****************");
 Serial.println("Puerto Serial OK");


 
 Ethernet.begin(mac,ip);
 Serial.print("IP : ");
 Serial.println(Ethernet.localIP());
 Udp.begin(localport);
 Ethernet.setSubnetMask(subnet);
}

void loop(){
 Udp.beginPacket(remoteIP, remotePort);
 Udp.write("message");
 Serial.println("Mensaje UDP");
 Udp.endPacket();
 delay(5000);
}

pert

Another thing is.. how i can get the ethernetudp.h library?
If you mean EthernetUdp.h, it's part of the Ethernet library you're already using. If you really meant ethernetudp.h, then I have no idea. In the Arduino IDE, filename case does matter, even on Windows where it normally doesn't.

Go Up