06-14-2011 07:31 AM
Hi everyone,
I am trying to set up a desktop computer with LabVIEW to receive UDP packets from an embedded processor (DaVinci DM355) via UDP over ethernet. The problem is that I do not seem to be receiving any packets when I try to use LabVIEW's example VI:
National Instruments\LabVIEW 8.6\examples\comm\UDP.llb\UDP Receiver.vi
Here's a more detailed description of the setup:
To ensure that the desktop computer is actually receiving the packets, I used Wireshark to capture packets sent over ethernet. I've attached a screenshot of the capture.
Here's some other things that I have tried:
Hopefully I am missing something simple somewhere. Does anyone know what could be wrong?
Thanks!
06-14-2011 08:11 AM - edited 06-14-2011 08:12 AM
I can't see anything why it shouldn't work after a quick look.
some things I noticed:
- You use same port to sent (at transmitter-DaVinci) and receive (the PC). What happens if these are different (this is a typical case)?
- Are you sure that you don't have firewall running somewhere that blocks the IP number of the DaVinci?
- Are you sure that you released the UDP port at the receiving end (no other application running in the background that still uses this port)?
- Are you using multiple ethernet cards in your PC? If so you should specify the correct one when configuring the receiver.
06-14-2011 08:37 AM
Thanks for the response!
- You use same port to sent (at transmitter-DaVinci) and receive (the PC). What happens if these are different (this is a typical case)?
Yeah, I noticed this as well when I ran Wireshark (I did not program the DaVinci). I'll see if I can change this and see what happens.
- Are you sure that you don't have firewall running somewhere that blocks the IP number of the DaVinci?
As far as I know, I only have Windows Firewall. After checking the properties, it looks like "LabVIEW 8.6 Development System" for both UDP and TCP are unblocked. Is there a simple way to make sure that packets aren't being blocked by a firewall?
- Are you sure that you released the UDP port at the receiving end (no other application running in the background that still uses this port)?
I am not running any other applications that use the port (maybe there are some other applications that I am unaware of though). Is there a way to check this?
- Are you using multiple ethernet cards in your PC? If so you should specify the correct one when configuring the receiver.
No. Perhaps off topic, but, won't LabVIEW listen on all ethernet cards if I had multiple?
06-14-2011 08:49 AM
If you only use the windows firewall it is easy to check this. If you have administrator rights you can just switch it off (for debugging).
I just checked, if the port is already in use you will get an error when you start the UDP receiver immediatly (error #60).
I never used multiple card myself but was aware of the 'net adress', quickly checked the help and it mentions that by default it works on all.
so I am afraid you can already tick all the things I mentioned 😞
06-14-2011 09:02 AM - edited 06-14-2011 09:09 AM
Was your Wireshark trace taken on the PC or was it captured from a different machine? If you ran the trace on the PC then I would check your code to see if any errors are being generated. I have used the basic examples as well as written several other UDP applications and have not had any issues. UDP can throw errors if your read buffer is smaller than the data packet.
With respect to your last question yes, LabVIEW can listen on all interfaces. This is the default if you have multiple interfaces and you don't specify the IP Address for the listener.
06-14-2011 12:20 PM
The wireshark trace was taken on the same PC. I'll check to see if any errors are thrown. If there were errors, none of them caused the program to stop (it stops the infinite loop if the error status becomes true).
I'll try some of the things suggested above and post the results.
06-14-2011 01:25 PM
Are you using a cross-over cable for your peer-to-peer connection?
If not, then you need to get one or use a router between the two computers.
06-14-2011 01:33 PM - edited 06-14-2011 01:36 PM
If the wireshark sees the packets, the cable is OK. Double-check the firewall and the UDP receiver settings.
Run the UDP receiver and do a "netstat -an" in a command window. Is it really listening on the right port?
06-14-2011 03:51 PM
I tested the system a bit more and the "UDP Receiver.vi" does receive the UDP packets when Wireshark is running at the same time! I don't know why I didn't try running them at the same time before.
The setup is the same:
One obvious solution is to just run Wireshark all the time. But it would be nice to know why this is happening.
It's a bit hard to get internet access where all the hardware is set up so I have not been able to try run "netstat -an". I will soon and hopefully this will provide a bit more info.
I also tried disabling Windows Firewall, and that did not seem to have any effect.
06-14-2011 04:06 PM
For those who might be wondering: I am just using a regular ethernet cable, not a crossover cable. I guess the computer that I am using has the hardware does the switching automatically (Auto-MDIX).