Problem getting remote IP and port from UDP packet

Hello,

I am trying to connect an Arduino with a Galileo device.
For doing so, I am sending a broadcast message, which is correctly received by Galileo device. But when I try to get the Arduino's IP and port from UDP packet, I get 255.255.255.255 and 0.

udp.beginPacket(255.255.255.255, 8888);

I should get the IP SRC and PORT using udp.remoteIP() and udp.remotePort(), instead of the destination IP (255.255.255.255) and port 0.

How can I fix this?

Thanks in advance

It will guess it is a problem with the Galileo. I had to debug the DHCP part of the Arduino when connected to a Mikrotik router. It ended up being the router, but I learned a lot about the UDP section of the Arduino. It seems to work ok on broadcast.

The Galileo does not use the w5100 or the ENC28J60 for the ethernet IC, so it would be hard to get help on this forum for the Galileo ethernet library.

edit: You might want to use a packet sniffer like wireshark to see what the Arduino is sending.

BTW, DHCP requests include the IP the requesting device is currently assigned if it is a renew request. Maybe you should try something like that. I did not check, but it may be using 255.255.255.255 for the IP when sending the request. Look for CIAddr parameter here:
http://www.tcpipguide.com/free/t_DHCPMessageFormat.htm

Thanks for answering,

I thought it could be that, since I had a similar problem with DCHP in Galileo. It uses system calls to iniciate ethernet instead of the Ethernet library.
Wireshark showed the packets are ok, so it is possible to get the whole information from it.
I will ask in Galileo's forum and will post any solution here :wink: