LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SSH LIBSSH2 Labview 2021 SLOW

Hello,

i have finally a connection to my device with SSH protocol , using the LIBSSH2 addon from VIPM.

it works but  my problem is that it takes 500 ms each time i ask for a value. and so 3 seconds to get the answer for the table.

 

if you have any suggestion for me to try to get this as a normal speed , that would be really great and helpful

SSH - screenshot.png

 

it is LIBSSH2  1.2.4 ; Labview 2021-32bits, windows 10 64bits

 

 

 

 

0 Kudos
Message 1 of 11
(1,039 Views)

Have you tried with Putty to see how your unit responds?  That would be my first thing to look at to debug.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(1,016 Views)

I just installed the LIBSSH2 library and did a little digging.  It looks like the read is flat out timing out.  It has no way, as far as I can tell, of stopping the read when the Line Feed is read.

 

I handle SSH by using an open-source SSH .NET library wrapped around a class.  This library has WriteLine and ReadLine methods that work perfectly for your situation.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 11
(996 Views)

Thank you.

I understand that each  read or write will take 500ms whatever we do with libssh2. Correct ?

 

You solution Iis getting a bit technical for me. would you share an example of how to immlement and use it in labview ?

 

Thank you

Emmanuel

0 Kudos
Message 4 of 11
(989 Views)

Hello again , thank you very much.

 

i guess what you propose in explain there :  Using Custom .NET Class Library in LabVIEW - NI

if so , it seems simple enough for me finally.

 

but

i can not build the .dll here , could you share it ? ( i do not have c# , or VB here) 

could you also share an example of the labview code ?

 

that would be great.

0 Kudos
Message 5 of 11
(945 Views)

Hello,

ok sorry i found the dll in the package 

https://www.nuget.org/packages/SSH.NET

 

i am now trying to use it , and have this problem : 

 

petite01_0-1709812959167.png

 

i tried this : Error Loading .NET Assemblies in LabVIEW - NI

but no progress.

 

any advices ?

 

regards

Emmanuel

0 Kudos
Message 6 of 11
(929 Views)

Hello,

i can now load the Renci.SshNet.dll in labview 2021SP1 32bits ,   using the constructor node .  ( it is a windows 11 64bits )  and the DLL is from

sshnet/SSH.NET: SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism. (github...

 

- i can load the version 2023.0.0 but the 2023.0.1 or 2024.0 will not load  : 'an error occurred trying to load the assembly'. not the biggest problem so far.

- i end up with all the possible methods , but have no experience on how to use it and the documentation is not..

 

petite01_0-1709819462910.png

 

 

does someone have some code example on how to porceed next : 

what i am willing to do is something like i did with the SSH LIBSSH2  but faster as this library is very slow ( i have an anwser after 500 ms)  so i need to  to connect to the device , send message end read answers ?

SSH - screenshot.png

 

any suggestion , help highly appriciated.

regards

Emmanuel

 

 

0 Kudos
Message 7 of 11
(927 Views)

Hello,

i can now load the Renci.SshNet.dll in labview 2021SP1 32bits ,   using the constructor node .  ( it is a windows 11 64bits )  and the DLL is from

sshnet/SSH.NET: SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism. (github...

 

- i can load the version 2023.0.0 but the 2023.0.1 or 2024.0 will not load  : 'an error occurred trying to load the assembly'. not the biggest problem so far.

- i end up with all the possible methods , but have no experience on how to use it and the documentation is not..

 

petite01_0-1709819462910.png

 

 

does someone have some code example on how to porceed next : 

what i am willing to do is something like i did with the SSH LIBSSH2  but faster as this library is very slow ( i have an anwser after 500 ms)  so i need to  to connect to the device , send message end read answers ?

SSH - screenshot.png

 

any suggestion , help highly appriciated.

regards

Emmanuel

 

 

0 Kudos
Message 8 of 11
(926 Views)

I just spent way more time than I should have stripping out my SSH class to sit on its own.  Hopefully this works for you.

 

I don't remember which version of the DLL I grabbed.  You will need to have the .NET framework installed to match the DLL.  For instance, if the DLL was built for .NET 4.0, you will need to make sure you have .NET Framework 4.0 installed.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 11
(909 Views)

Thank you Very very  much , look very promising.

It seems it is connecting but then i do not get answer to the message.

 

i was thinking maybe it is because you use the DLL 2023.0.1 and for some reason i can'y load any dll after version 2023.0.0 on my computers.

i tried to replace the 2023.0.1 by the 2023.0.0  in the folder , but then it is not working at all anymore.

 

anyway i attach the screenshot, in case you have a suggestion.

would be a possibility  that you rebuild it with the 2023.0.0 dll  , any version of .NET seems to load here , see if it helps ?

 

Emmanuel

0 Kudos
Message 10 of 11
(876 Views)