I've got an RJ45 to D9 RS232 Adapter that I want to use to control an RS232 device in the following config:

Laptop RJ45 Ethernet port -> Cat6 patch lead -> D9 RS232 adapter -> RS232 Device

Would the above work ?

  • 7
    The RJ45 to DB9 adaptor is almost certainly just connecting pins on the RJ9 connector to connectors on the RJ45 - I've yet to come across any of these devices with any logic in them - and a lot of logic (and configuration) would be required as Ethernet and serial connections are very different. – davidgo Nov 8 at 18:33
  • 3
    Please provide a photo of your adapter. – Criggie Nov 8 at 21:03
  • 1
    @Criggie, it's probably the adapter that APC used on their uninterruptible power supplies for years, before they switched to using RJ45-to-USB adapters. – Mark Nov 9 at 0:27
up vote 26 down vote accepted

No. Ethernet ports can't transmit or receive RS-232 signals.

If your laptop has a traditional DB9 RS-232 serial port, use that with the appropriate serial cable. If it doesn't, use a USB to RS-232 serial adapter.

  • 1
    "Ethernet ports can't transmit or receive RS-232 signals" -- But there are converters. – sawdust Nov 8 at 20:56
  • 2
    @sawdust Do you have an example? – Michael Hampton Nov 8 at 20:57
  • 3
    Any RJ45 to serial cable I have seen was made to plug into a switch/router for control or programming like this. – JPhi1618 Nov 8 at 21:06
  • 1
    @MichaelHampton -- there's a link at the end of my answer. – sawdust Nov 8 at 21:06
  • 3
    @JPhi1618, that's just a pinout adapter, it doesn't help with the differences in physical and logical signalling between Ethernet and a serial port. I suppose the reason the "RJ45" connector is used for serial consoles is that it's smaller than the DE9. That might make e.g. the difference between being able to fit the console connector in the front of a switch, instead of having to place it in the rear. It's a bit confusing that the same connector is used, but they're likely to be easy to source, and anyone can find the plugs to make e.g. a longer serial cable. – ilkkachu Nov 9 at 8:19

If you have something like this item, then it is merely a pinout adapter and not a serial/ethernet device.

https://cdn3.volusion.com/uvrp7.f3o9w/v/vspfiles/photos/319016-2.gif?1401188765

You could use one of these on each end of a RJ45 cable to make a serial cable. That serial cable could run through structured cable installed inside a wall or similar, but it cannot run through an ethernet switch or vlan.

  • 2
    I've used these for a long time, and they work reliably even with relatively long cables (10+ meters). – Ismael Miguel Nov 9 at 12:44
  • 3
    The RS-232 standard specifies DB25 connectors. Since DB25 connectors are bigger than most modern connectors and thus somewhat inconvenient, lots of equipment has switched to other connectors including the RJ-45 and DE-9 connectors in your picture. That adapter was likely intended to enable a connection between a server or network equipment with an RJ-45 serial port and another device with a DE-9 serial port. – kasperd Nov 9 at 12:52
  • 4
    @kasperd, If you want to get technical, RS-232 describes the interface between a computer or computer termnial (a.k.a., "Data Terminal Equipment", or "DTE"), and a modem (a.k.a., "Data Communication Equipment", or "DCE"). These days, when we say "RS-232" we ignore almost the entire thing, except for its very lowest level---line coding and framing. – Solomon Slow Nov 9 at 15:03
  • 1
    @SolomonSlow Exactly. My point is there are parts of that standard which are no longer in use today including the form factor of the connector. The depicted adapter is for conversion between two of the connectors which vendors have chosen to use instead of the larger DB25 connector. – kasperd Nov 9 at 15:44

I've got an RJ45 to D9 RS232 Adapter that I want to use to control an RS232 device in the following config:

Whether you can accomplish your goal depends on exactly what this "adapter" that you have can do.
There certainly are "serial to Ethernet converters" designed for the connection you proposed:

Laptop RJ45 Ethernet port -> Cat6 patch lead -> D9 RS232 adapter -> RS232 Device

which looks a lot like the product application: enter image description here.

So what is a serial Ethernet converter used for?

Most commonly it is used for connecting a serial RS232, RS485 or RS422 device such as a serial printer, barcode scanner, scale, GPS, sensor or any other consumer or industrial device with a serial interface, to a computer over a standard LAN network.
The advantage of this is obvious; you will be able to control, monitor and communicate with your serial device remotely from a central computer.


How does a serial Ethernet converter work?

The circuitry inside the converter can convert IP/TCP packets to serial data and also convert serial data to IP/TCP packets, so it works in both directions. Before you can start using the converter you need to install driver software on your computer. This driver software is also called virtual COM software because it creates a virtual COM port in your computer's Device Manager when the converter is connected to your computer. Virtual COM software is usually included with the converter, at least if you buy from a reputable seller.

Once the virtual COM port has been created by the Serial to Ethernet converter's driver software the COM port will show up in your computer's Device Manager as if it was a standard built-in COM port, however it actually is the COM port in the converter at the other end of the Ethernet.


Images of serial to Ethernet converters


  • 2
    These converters are cool and useful, but I don't think I'd call something that requires its own power supply an 'adapter'. OP could probably use this if his serial device needed to be controlled remotely tho. – JPhi1618 Nov 8 at 21:10
  • 4
    "I don't think I'd call something that requires its own power supply an 'adapter'" -- Anything with a digital IC is going to require power. USB adapters (e.g. the USB to RS-232 serial adapter mentioned in another answer) have the advantage that the USB connection provides the power for the converter chip. Ethernet is a not a bus like USB, so there is no power (unless you have PoE). – sawdust Nov 8 at 21:26
  • 5
    Isn't this missing the point of the question? The user's laptop ethernet port can not be used to drive a serial connection. Yes it can connect over a LAN to one of these devices, but that's not the question. – cpt_fink Nov 8 at 21:30
  • 1
    Very true. Maybe I'm in the minority but I've always reserved "adapter" for something that is a truly dumb pin-to-pin connection. Now that you mention it I have seen others use "USB to serial adapter" quite a bit (and for similar products). – JPhi1618 Nov 8 at 21:30
  • 2
    @cpt_fink -- The OP wants to "to control an RS232 device", not "drive a serial connection" (whatever that means) as you claim. The description of the serial Ethernet converter states that "you will be able to control ... your serial device remotely from a ... computer." How is that not a perfect answer to the OP's question? – sawdust Nov 8 at 23:29

The physical signalling, and even more so the logical protocols, used by Ethernet are completely different from those of serial ports, so it's impossible to directly connect a laptop's LAN port to a device's serial port.

However, the same connector is often used for both. I think the usage of an "RJ45" connector for serial console was made popular by Cisco, but network devices from other vendors use the same connector. If you have an adapter with a DE-9 on the other end, and an "RJ45" on the other, it's most likely a Cisco-style console cable. Like this one (image from Wikipedia):

enter image description here

To connect your laptop to a serial port of a device locally, just get a USB serial port adapter. They should be readily available and drivers for the common ones (FT232R and PL2303) can be found for most operating systems.

However, if your use case is to connect to a serial port remotely, as in over the network, then that won't work. You'll need something that connects to the network and talks with the serial port of your device. There are commercially available devices that do just that (terminal servers), but you could solve that with another serial-equipped computer too.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.