smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
62 stars 26 forks source link

One socket-channel through which it is possible to send a command and receive a response from the device. #568

Closed SarenNovak closed 9 months ago

SarenNovak commented 9 months ago

Hello, we use TCP/UDP binding to create a remote control channel for the interactive panel over the LAN. In this network OpenHAB uses the address 192.168.29.11, the interactive panel is connected to the LAN via a virtual COM port VSPE with the address 192.168.29.160. The problem is as follows:

1) OpenHAB creates channels only of client or server types, through them we can either receive a response from the device or send a command to control the device, there is no full duplex connection;

2) VSPE virtual socket sends commands to the device and sends responses from the device through the same channel from which the command from OpenHAB came. But since OpenHAB immediately closes the socket after sending a command and opens a new one with a different port, the response does not come from VSPE.

packets from openhab

As a result, it is necessary to create two separate channels of client and server type to send commands on one channel and receive a response from the remote device on the other.

I would like to know if this problem can be solved without creating two separate channels? Can OpenHAB just create one socket-channel through which it is possible to send a command and receive a response from the device.

With the use of regular terminals everything works fine, a normal connection is established where commands are sent and responses are returned. The address of the terminal is 192.168.29.161.

packets from terminal

Thank you for your reply.