04-19-2018 04:18 AM
Hello,
I need establish TCP/IP connection using cvi exeple to my hardware device which has ip(192.168.56.1) I DNT KNOW HOW PORT I have to choosse
Since i am new to this protocol i am bit worried about how to make communication between my pc under labwindowscvi 2017 to my other hardware ( raspberry or an other pc windows) . Here my labwindow code act as client and hardware as server. i need to read the data coming out .
Please help me in making this communication happens.
thks
04-20-2018 02:00 AM
You won't go very far without a bit of documentation about your external device.
First of all you need to know whether it operates as a server or as a client, next the port to be used is needed.
Does it offers a web access? I mean, can you open a browser and connect to it interactively? This could be a good starting point.
If not, even supposing you get a connection, how would you interpret the data you get from the device? You'll receive a byte string which could include some protocol headers / footers and some actual data, which could not be plain text...
04-20-2018 02:25 AM
Hello,
and thanks for replaying ,
To answer the questions:
my external device is RASPBERRY PI 2, works as a server and normally communicates in port 22 after search, for internet access yes I have access on this raspberry to wifi, So my raspberry communicate with my pc i want to use the tcp/ip protocol , where the raspberry do acquisitions of some images and send to the pc in order to do the image processing under labwindowscvi , So can i established this connexion between both and how to operate
thks
04-20-2018 04:44 AM
Hello Bylka,
I read you are using an RPI and you want to use the TCP on port 22. Are you trying to use SSH & SCP with your RPI?
Best regards,
Antoine
04-20-2018 04:51 AM
Hello caillotantoine;
Yes i try to use this one but for processing i have to send information to my pc wich the procesing will be under labwindows cvi and the sending informations it have to be automaticly for processing
thks
04-20-2018 08:43 AM
I seem to understand that there isn't a finite application on the RP side: if this is true you can try developing some basic TCP server on RP and connect to it via the basic TCP example of CVI. You can mimic the behaviour of client.prj and server.prj example that ships with CVI and see if you manage to establish a communication between them. I cannot help you on the RP side: you can try searching for an example of TCP server to be programmed there.
04-20-2018 09:01 AM
Hello Bylka,
Let's sumarize what you want to achieve:
You have RPi with a camera plugged on it.
with you computer, you want to connect in SSH to request the RPi to take a picture and send it to your computer. Afterward, you want you CVI application process the image. You also want your CVI application tells when to take and send the pictures.
Is it what you want to do?
04-20-2018 09:21 AM
Hello,
yes exactely what i want do, so after acquisition image my photos is processing using labwindowscvi and vision assitant , its why i have to send this photos to my pc and all this must be automaticlly
thks
04-23-2018 03:32 AM
Hello Bylka,
I do not advise you to use SSH since it is a complex and encrypted. However you might be able to find a library to help you to do it if it is really what you want (https://www.libssh.org/) but keep in mind that it is more complex to use than what you do on putty.
What I advise you would be to use a client program that sends commands via TCP protocol to a server located on your RPI. Then you could copy the picture to a shared folder (https://raspberrypihq.com/how-to-share-a-folder-with-a-windows-computer-from-a-raspberry-pi/) or on a web server (https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md). When the picture is ready, the server could send a notification to the client to let it grab and process the image.
You can find a shematic of that enclosed.
Is it alright for you?
Best regards,
Antoine
04-23-2018 05:43 AM
Hello,
thanks i'll tray this , even for the first step i established connexion between pc and the RP so i can send odreder to my rp to snap images im in the seconde step to shared the image on my pc ill try with your solution thks ;
Best regards,