1

I have a free DB-25 port (colloquially: "parallel port") on an Ubuntu 16.04 machine and the right cable (CISCO terminal cable) and now I want to use this port for RS-232 serial traffic using this cable (which you would nowadays you would normally use a DE-9 port ["serial port"] for, which I do already have in use).

Output of lsmod | grep ppdev:

ppdev                  20480  0
parport                49152  2 ppdev,parport_pc

I have no /dev/parport* or /dev/lp*. I have /proc/sys/dev/parport/default/ but not any /proc/sys/dev/parport/parport*.

No relevant entries under /sys/class/tty/ either.

Possibly relevant lines from dmesg:

[   13.833749] parport_pc 00:03: disabled
[   13.833757] parport_pc: probe of 00:03 failed with error -22
[…]
[   15.783423] ppdev: user-space parallel port driver

After I adding pnpacpi=off to my kernel cmdline as per https://lkml.org/lkml/2008/6/12/4:

[   14.676968] parport0: PC-style at 0x378 (0x778)
[…]
[   14.804761] parport0: irq 7 detected

Now there is /dev/parport0 and /proc/sys/dev/parport/parport0.

So how do I enable it and use it for serial communication like the other relevant tty devices?

1
  • Comments are not for extended discussion; this conversation has been moved to chat. – terdon Jan 18 '17 at 8:39
3

A DB25 port can be both serial or parallel, depending on gender, but it's been so long since I've used one that I can't remember which is which.

They are designed differently, and can't be interchanged. Parallel ports use 0 and +5 volts for signalling, serial ports use -12 and +12 volts.

In case your cable fits, it's safe to say it's a serial port, and you should try using /dev/ttyS1 for communication.

7
  • 1
    Some serial ports use 5V, and this will work with short cables. – ctrl-alt-delor Jan 16 '17 at 18:33
  • 1
    @richard RS-232 is indeed -12/+12. You are thinking of what is sometimes referred to "TTL" serial. – phk Jan 16 '17 at 18:37
  • 2
    A parallel port on the back of a computer is DB-25 female. On a device (say, an ancient laser printer), it's often a Centronics connector. A serial port is generally DE-9 male on the back of a computer (DTE); the modem (DCE) is often DB-25 female. – derobert Jan 16 '17 at 18:42
  • @phk I have no idea of official name, or any other name. I just know that it is compatible (mostly), and often indistinguishable until it does not work. A lot of laptaps use this 5v version of RS232. It is not RS232 as not compliant, I think it is probably marketed a serial port, but then so is RS232. Any way the up-shot of this is that you can (probably) get away with 5V. – ctrl-alt-delor Jan 16 '17 at 18:43
  • 1
    That's because the voltage is affected by the cable length. Therefore the adapters are designed to be more tolerant with smaller voltages. This is obviously very dependent on the specific implementation and not very reliable as 5V is very weak compared to the expected 12V. – Julie Pelletier Jan 16 '17 at 19:12
3

Summary of the discussion in the comments below the question:

  • What was attempted here is practically impossible or at least not as easy as assumed at first.
  • A parallel port can't be (easily and without hardware and software hackery) used for serial communication (much less true RS-232). This port is only meant for IEEE 1284, there is no serial mode.
  • RS-232 is specified for DB-25, it's the original connector used. But PCs almost always had cheaper/smaller DB-9 ports instead. Dial-up modems often had DB-25.
  • The Cisco cable in question (with the DB-25 end) which started this quest here was not meant for connecting the console port to a computer but instead to dial-up modems for remote access.
  • There are also non-Cisco DB9-to-8P8C which have different pinouts (e.g., APC used to have some for its UPSes). There are other DB25-to-8P8C pinouts as well, see https://en.wikipedia.org/wiki/Serial_port#Pinouts (the Cisco one is the one is referred there as Yost (DCE), see also https://www.lammertbies.nl/comm/cable/yost-serial-rj45.html).
0
1

Regarding "software hackery", I'm not sure it is needed at all, because the kernel information about "console" option includes lp0 as one possibility. So you could enable EPP/ECP on the port, enable a console on the Ubuntu, so it handles this DB25 parallel port.

I agree the Cisco cable is a serial DB25 one, and will not work for a parallel port usage.

But, about "hardware hackery"

Case 1) To have a USB connector on the other end. I guess any parallel port-to USB converter that is sold to connect a printer to an USB port could work as a console cable, and we will just provide a proper male-to-male 25 pin wiring adaptor. An already-done adapter would be a LapLink cable. https://en.wikipedia.org/wiki/LapLink_cable#Wiring

Case 2) To have a DB9 (serial) connector on the other end, you will need a USB host doing the trasnlation to a second USB-to-serial cable, but just a Raspberry Pi could be an unexpensive solution to do the passthrough communication from the parallel-to-USB to the USB-to-serial cable.

just to say it is doable.

2
  • just being curious about it, I have just purchased one DB25 LapLink cable (like 6 EUR) and one DB25-toUSB printer adaptor (12 EUR), so once I receive will try to demonstrate that case 1 works and it is relatively cheap. – David Aparicio Mar 7 '18 at 15:13
  • and to enhance case 2; i have found a DB9-male parallel port to USB -B cable (like amazon.com/Lpt2USB-Parallel-USB-Printer-Adapter/dp/B0015EP2JO), which allows to connect a USB printer to a paralel port in PC. The USB side can feed an Arduino, and it is straightforward to use a DB9 serial port adapter in the arduino to provide the parallel-to-DB9 serial converter. This one would be mor eexpensive due to the parallel port cable, through. – David Aparicio Mar 7 '18 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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