UDP connection won't work.

15 visualizaciones (últimos 30 días)
Ana Ladeira
Ana Ladeira el 17 de Mzo. de 2017
Good afternoon,
I've been trying for a while to set up an UDP connection. I'm setting up a UDP communication interface between my computer, using Windows (server) and an Intel Edison (client). I know the connection on Edison is set up properly, because I've used exactly the same code to send stuff to other applications, but I can't get it to work on MATLAB by any means.
My computer's IP is 192.168.1.203, the Edison's is 192.168.1.238. They are connected to the same Wi-Fi network. Edison is only sending data, not receiving anything. It's set up to send data to port 1555 of my computer. I tried many different ways of coding the connect, but
get (u, 'BytesAvailable')
always return 0.
Codes I've tried:
delete(instrfindall)
u=udp('192.168.1.238','LocalPort', 1555);
fopen(u)
while true
get (u, 'BytesAvailable')
end
fclose(u)
Code number 2:
udpClient = udp('192.168.1.238', 1555, 'LocalPort', 1555);
flushinput(udpClient);
fopen(udpClient);
while true
data = fread(udpClient);
disp(data);
end
fclose(udpClient)
This code returns "Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period.". I've tried other similar ways of coding the same thing, but they give the same error messages.
I've tried maaaany different ways of coding this, I've disabled my windows firewall, I've tried setting up the host IP to 0.0.0.0 so it accepts things from all IPs, and it simply won't work.
Has somebody gone through anything similar? I could use the help.

Respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by