LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to take PCAP using system exec on sbRIO via System Exec

Hello.  Running into an issue where my Modbus data is occasionally wrong.  Want to take a PCAP of data stream when it happens. I would like to automate this.  I'm using TCP dump, but what I've got is not working.  I'm clearly doing something wrong or misunderstanding something.  Any help would be greatly appreciated. If I remember with windows, I needed cmd and maybe even file paths to where it was going.  So I assume it's something like that.

LuminaryKnight_0-1754921235234.png

 

0 Kudos
Message 1 of 6
(111 Views)

Can you SSH onto the target, run that command, and have everything work as expected?

 

If that's the case then I'd guess it's a permission issue. LabVIEW runs under the lvuser account and it doesn't have many permissions by default so you'll need to grant that user permissions to run the command. I've also had issues with lvuser not being able to find commands very well so it might not be a bad idea to just link directly to the tcpdump binary.

0 Kudos
Message 2 of 6
(97 Views)

@Jacobson wrote:

Can you SSH onto the target, run that command, and have everything work as expected?

 


Yes, copy and paste and it runs as expected.

 


@Jacobson wrote:

might not be a bad idea to just link directly to the tcpdump binary.


This is what I was thinking, but I have no idea where it is.  Been looking for it.  Would making a .sh file be a good idea?  Just call the .sh from labview?

0 Kudos
Message 3 of 6
(91 Views)

You should be able to use the find command to find the binary. I think you would do something like `find / --name tcpdump`.

0 Kudos
Message 4 of 6
(42 Views)

Using either whereis or which both result in /user/bin/tcpdump.  So I've since updated my text to use that location and still nothing.  And again, I copy paste what I'm sending to System Exec and it works just find in powershell when I ssh into the device.

0 Kudos
Message 5 of 6
(31 Views)

Have you updated the sudoers file to allow lvuser to use that command? Also, are you monitoring the standard and error output of the sysexec function?

0 Kudos
Message 6 of 6
(17 Views)