8

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 ?

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
sam
  • 3,953
  • 20
  • 65
  • 107
  • 8
    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 08 '18 at 18:33
  • 3
    Please provide a photo of your adapter. – Criggie Nov 08 '18 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 09 '18 at 00:27

4 Answers4

27

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.

Spiff
  • 101,729
  • 17
  • 175
  • 229
  • 2
    *"Ethernet ports can't transmit or receive RS-232 signals"* -- But there are converters. – sawdust Nov 08 '18 at 20:56
  • 2
    @sawdust Do you have an example? – Michael Hampton Nov 08 '18 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](https://www.amazon.com/Cisco-72-3383-01-Console-Cable-RJ45-to-DB9/dp/B000GL3MOY). – JPhi1618 Nov 08 '18 at 21:06
  • 1
    @MichaelHampton -- there's a link at the end of my answer. – sawdust Nov 08 '18 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 09 '18 at 08:19
  • @ilkkachu given the number of switches that use the RJ45 Console Port, using that connector, albiet with a different pinout, must have saved the switch manufacturers millions of dollars by this point in time! – PhasedOut Nov 09 '18 at 13:53
  • A downvote, because the author states that he *"hate(s) ... misleading information in Answers"*. This simplistic answer is flawed because it (1) assumes that the OP has a passive adapter without any evidence whatsoever, and (2) this assumption is unstated, making this unconditional answer misleading. – sawdust Nov 13 '18 at 02:10
20

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.

Criggie
  • 2,323
  • 12
  • 24
  • 2
    I've used these for a long time, and they work reliably even with relatively long cables (10+ meters). – Ismael Miguel Nov 09 '18 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 09 '18 at 12:52
  • 5
    @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 09 '18 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 09 '18 at 15:44
9

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


sawdust
  • 17,383
  • 2
  • 36
  • 47
  • 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 08 '18 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 08 '18 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 08 '18 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 08 '18 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 08 '18 at 23:29
  • @sawdust, is there some significant difference between "controlling" "an RS232 device", and just plugging a serial port in? Why the emphasis on the choice of words? – ilkkachu Nov 09 '18 at 08:26
  • 1
    Be aware that some of these adapters only provide a TELNET connection, not a virtual COMnn port. Therefore, check the requirements of your device control software and the capability of the ethernet-to-serial adaptor before you buy. – Richard Nov 09 '18 at 18:07
  • 1
    @JPhi1618 -- I tend to agree with you on the use of "adapter". However newbies and PC manufacturers use it in many ways. The expansion boards of the IBM PC were called adapters. So guess what the "A" in CGA, EGA and PGA (names of video cards) stand for? – sawdust Nov 09 '18 at 21:10
  • While this has good information, anyone with one of these trying to make it work would not ask the OP's question at its current resolution. The OP most likely has a passive pinout adapter. – YetAnotherRandomUser Nov 11 '18 at 03:07
  • @YetAnotherRandomUser -- I agree with your observations, but when I originally posted this answer there was only the one accepted answer. That answer IMO is flawed, too absolutist, and makes unstated assumptions as to the OP's circumstances. My goal was to specifically offer a counterpoint (to that other answer), and an answer/solution that matched the OP's stated goal. I'm not trying to answer a `what is this adapter?` question (which was only implied and not asked by the OP), but that seems to be the focus of some newer responses. – sawdust Nov 12 '18 at 22:54
  • @ilkkachu -- If you're familiar with the concept of a protocol model, "control" would be performed at a high-level (i.e. the application) layer, whereas *"plugging a serial port in"* is at the lowest (i.e. physical) layer. – sawdust Nov 12 '18 at 23:07
  • @sawdust, ok, that was sloppy of me, I'll rephrase: Is there some difference in _"**controlling** an RS232 device"_, and communicating to the device over a serial port in general? Why the emphasis on *"controlling"* as opposed to some other word? – ilkkachu Nov 13 '18 at 08:57
  • @ilkkachu -- That verb was not chosen by me, but rather quoted from the OP and the product description. The emphasis was to indicate that the exact goal of the OP could be satisfied by the capabilities of the product using their words rather than mine. – sawdust Nov 13 '18 at 19:21
4

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.

ilkkachu
  • 1,220
  • 8
  • 15