linux - Create a virtual serial port connection over TCP -


i developing application should able write virtual serial port , receive data through same port remote clients on network.

the application runs on linux server. new in using serial ports , have questions on topic.

clients

the client can establish tcp connection server. when setup client, have provide ip address of server, tcp port (usually 8080) , virtual com port.

the client automatically try connect server.

server

the server has virtual com port, same set in client config (e.g. com1). when application on server writes data port, data should send clients connected via tcp. response clients send on tcp server can read on virtual serial port.

question

on windows used virtual serial port connector http://www.eterlogic.com/products.vspe.html did of work. want solve problem on linux machines.

my question is, how can create tcp server has virtual serial port attached , can send/receive data through port on tcp listening clients?

try socat. possible scenario:

socat  pty,link=/dev/virtualcom0,raw  tcp:192.168.254.254:8080& 

socat creates tcp connection 192.168.254.254:8080, everything, written /dev/virtualcom0 forwarded 192.168.254.254:8080 , vice versa.

another approach use rfc2217 via ser2net on linux sever side , rfc2217 driver on windows side (for example http://www.hw-group.com/products/hw_vsp/index_en.html single port version). can try http://pyserial.sourceforge.net/ work ser2net.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -