Serial ports through Ethernet

Angelo

Well-known member
For a project, the Teensy is conncted to 2 devices with serial ports. But the Teensy should show the 2 physical serial ports and 2 "virtual" serial ports to a PC. On the PC, 4 standard COM port should be present, to be used by existing software.
It work on the desk using tripe serial on USB, but the 4th port is missing. And the final application require 20 meters long cable. Which eliminates USB.

Is there an existing standard ethernet protocol to do that ??? But more important, no application/driver on Windows is required.
How to declare COM ports routed to TCP/IP ????
And on Teensy ????

Thanks for the help
 
Depending on your price point, USB loop extenders are available that go from 50meters to 120meters. They use ethernet cable between the dongles. Features vary as does the price.
 
It could be a solution, but I need to modify some files to add serial endpoints.
Ethernet is the prefered solution. It will open future extensions. It also provide isolation to avoid ground loops.
 
There isn't any Serial over IP standard that I'm aware of. Comercial adapters that do this yes but not a standard protocol.

It's not an ideal solution but the way I'd approach this would be in the Teensy code replace each COM port with a TCP connection on a different port number. Modifying things to send / receive over a TCP connection rather than Serial shouldn't be too tricky.

On the PC side I'd then have an application that acted as the other end of the TCP link and output the received data over a COM port. Which end you make the server and which the client depends on exactly how you want to impliment things. The PC tool could either be a single network port to a COM port and you run 4 copies or a single program that runs multiple ports.

I'd then use COM2COM or some similar virtual COM port loopback tool on the PC to give me 2 COM ports per link, one that the network tool outputs to and the second for the final application to open. That way as far as your application is concerned the data is on a standard COM port.

It's a little messy and involves more steps than you'd probably like but it would work and the basic framework is extendable if needed in the future.
 
SLIP and PPP are designed to run TCP/IP connections over a serial link rather than the other way around.
 
On the PC side I use existing old software, which connect to devices with COMx port only.
I have found some port redirector software. I should write the Teensy side, which should not be that hard.
 
With the following free driver you can create and map a virtual serial to a tcp connection
there is also a multiport version

the tcp connection can either be client or server

i once did create a C# program that connected to a tcp server and was using com0com so that i could
have a connection to a Millenium 3 PLC over the network, and was able to use the PLC software
but using the above linked drivers would create a more robust solution
 
Back
Top