Are there any serial-to-Ethernet tutorials or open source projects for building remote access to COM equipment? I’m putting together a system so I can operate the equipment from another computer over Ethernet. Right now, I have to use the computer directly connected to it.
Check whether your control software requires a COM port. For an open-source build, ser2net exposes a serial port over the network, and its README includes configuration examples. Use RFC2217 with a compatible client if you need remote baud-rate changes, rather than just passing bytes. If your application only accepts COM ports, plan for a virtual COM client on the operating computer. I’d consider Serial to Ethernet Connector for that setup, though paying for a license would make me try the open-source route first. Its server/client setup is covered in this Serial to Ethernet guide. (serial-over-ethernet.com)
Don’t call it working just because you can open the remote port and send a command. Before putting real equipment under remote control, check what happens when the Ethernet connection drops halfway through an operation. Does the application report a failure, hang indefinitely, or try the command again? For equipment that moves or switches anything, make that a harmless status request during testing.
The COM-port distinction @techchizkid makes matters, but I’d put recovery behavior on the checklist too. Start with a single device and a single controlling computer. Whether you use ser2net or try Serial to Ethernet Connector through this tool, run the same checks: interrupt the network, restart the serial-side computer, then reconnect without restarting your control application. Write down which steps require manual intervention. That gives you a much more useful acceptance test than a terminal window successfully echoing characters.
Check whether your control software changes baud rate or toggles DTR/RTS before running @techchizkid’s recovery tests. Serial to Ethernet Connector is a strong fit for that requirement: its RFC 2217 mode carries port-setting changes and control signals across the network, rather than just forwarding bytes.
Don’t build a networked COM port before checking whether you actually need one. “Operate the equipment from another computer” might only mean accessing the control program remotely. Those are different projects, and the more complicated one doesn’t award extra points.
I’d take @techchizkid’s software question a step further: does the control application have to run on your desk computer? If it can stay on the computer physically connected to the equipment, remote desktop access is worth considering before serial tunneling. Leave the serial connection local and access the application’s screen instead. That’s less interesting as an open-source build, admittedly, but “interesting” can become a fairly expensive requirement.
For a custom system, I’d consider the same separation: a small program beside the equipment handles the serial conversation, while the remote computer submits operations and reads their status. Design that interface around what you actually need, such as requesting a measurement or retrieving a result, rather than exposing every possible serial interaction. This is a design suggestion, not a shortcut around the equipment’s safety requirements.
The deciding question is where you want the control logic to live. If an existing application must run remotely and insists on opening a COM port, then the serial-sharing approach fits. If you just need to operate an existing local application, I’d start with remote access to that application. No need to volunteer for a plumbing project before establishing that you need new plumbing.
Keep the serial bridge off the public internet.
For actual source code to study, I’d start with pySerial’s examples. Its tcp_serial_redirect.py script forwards traffic between a TCP connection and a serial port, with serial settings supplied when you start it. That makes it a useful starting point for understanding the bridge itself rather than assembling a whole remote-control system immediately. The catch is explicit in the documentation: the example implements no security measures, and anyone who can reach the service can connect. Treat it as example code, not a finished access-control solution.
I’m less convinced than @byteguru that building the bridge is necessarily wasted effort. If learning how this works is part of your goal, a small example is a sensible place to begin. I would draw the boundary at writing your own authentication or encryption, though. Keep the experiment focused on serial communication and use an established secure access method around it.
For your setup, I’d write down which computer is allowed to reach the bridge before choosing the software. My preference would be a firewall rule allowing only the intended controlling machine on a local network. If access from outside that network becomes necessary, I’d put it behind a VPN or SSH tunnel rather than forward the serial service’s port through the router. I would make those restrictions part of the initial setup, not something to revisit after the equipment is working.
There’s a useful acceptance test here that’s separate from @espritlibre’s disconnect tests: try connecting from a machine that should have no access. Don’t send equipment commands. Just check whether the connection is accepted, and check again after rebooting the bridge computer. I’d want the authorized computer to connect and the unauthorized one to fail without relying on someone remembering to start a protective service manually.
That’s the distinction I’d keep in mind when reading tutorials: “these bytes reached the serial port” is a demonstration. For your build, I’d require “only the intended operator can reach the serial port” too. A tutorial that stops at the first result can still teach you something, but I wouldn’t copy its deployment unchanged.
Latency is the thing nobody’s flagged yet. Bytes arriving intact doesn’t mean they arrive on time. A lot of serial equipment uses inter-character timeouts or expects a reply within a tight window, and a tunnel adds round-trip delay plus whatever buffering sits in the middle. I’ve seen setups where the terminal looks perfect but the actual control software starts throwing timeout errors because a response that used to come back in milliseconds now takes longer. Test with your real command set and watch for retries, not just garbled characters.
@v1v1d_dragon is right that RFC2217 matters if your software flips baud or toggles control lines, and that’s a fair reason to look at Serial to Ethernet Connector. But I’d push back on treating the protocol support as the main selling point. For this kind of build the thing that actually earns it a spot is that it runs as a service and reconnects on its own after a drop. That maps directly onto the failure @espritlibre described. If your bridge needs a human to relaunch it every time the network hiccups, it fails the disconnect test before you even get to the equipment behavior.
On @byteguru’s point, I’d lean harder than most toward remote desktop first. If the control app can live next to the gear, you skip the entire serial-over-network problem and inherit whatever auth the remote access tool already has. The serial tunnel is the more fragile design, not the more capable one. Only build it if something genuinely forces the app onto the far machine.
One small thing that bites people: half-open connections. The bridge thinks the client is still there, the client thinks it’s talking, and nobody notices until a command silently goes nowhere. Keepalives help, but confirm your chosen tool actually tears down a stale session instead of holding the port hostage. That’s worth checking before anything moves.
Your setup needs an ownership rule if the local control program will remain available while someone connects remotely. Should the remote connection take control, wait for the local operator to release it, or be rejected? I’d settle that before choosing a bridge. “Multiple clients supported” wouldn’t go on my requirements list unless there’s a specific reason for it.
For a ser2net build, I’d specify one controlling application at a time, with an explicit handoff between local and remote operation. That extends @espritlibre’s recovery point: reconnecting should restore access only if that application is still supposed to own the equipment. I wouldn’t want an unattended client repeatedly trying to reclaim control after someone at the machine has taken over. Automatic reconnection and permission to resume sending commands should be separate decisions.
If another computer only needs to display readings, I’d have the controlling application publish those readings rather than give the viewer another route to the serial port. Keep observers out of the command path. That gives your open-source project a useful boundary: a serial bridge for one controller, with a separate status interface if you need spectators.
Equipment that responds correctly over a local serial cable is a different starting point from equipment whose command format you’re still figuring out. Before building on @techchizkid’s approach, get a local command-and-response exchange working and save the port settings and exact bytes exchanged, including line endings. Use that as your reference for the Ethernet test so you’re not debugging the equipment protocol and the bridge at the same time.