CR5 // Communication of DOBOT with external devices // TCP/IP connection // Client-server architecture


#1

Greetings friends! I have a problem trying to create a TCP/IP connection. The task is to declare a DOBOT as a Client, and an external connected device as a Server.

I studied this issue and tested using the examples given in SC-Studio (TcpClient, TCPServer). TCPServer is working! And it is also possible to make requests from the client.

Example:

The program for the server:

I didn’t succeed with TcpClient. I have registered the ip address, port.
When running this program:

nothing happens, although it is executed (as in the example with the Server)

I think that the client should send requests to the server with a set frequency. But there is no connection to any client on the server.

Example:

I tried changing the values of the socket variable, it didn’t help.
I also tried to just run the code without using the err variable – with no result((
I was also confused by the fact that the code for the server and the client is almost the same except for the true/false value in line 9

Please tell me what I’m doing wrong?


#2

Whoever does the server should use the IP address of the server. The figure shows that the computer does the server. The IP address of the input computer should be used instead of the IP address of the robot


#3

Thank you very much!