PL2303 UART: can I use pl2303 UART with 4 pins to get any statuses like DCD/RTS/etc?

I'm trying to make a simple UPS replacement with monitoring via COM port. Can I monitor pl2303 /dev/ttyUSB0 status somehow? I don't see ttyUSB0 file in /proc/tty/driver directory (nevertheless, /dev/ttyUSB0 is it where it should be and can be "read" with cat).
Moreover, can I use pl2303 UART with 4 pins to get any statuses like DCD/RTS/etc? Or do I need in full 9-pin COM-port converter? Did anybody tried to do something similar?

kmod-usb-serial-pl2303 is installed?
Testing the module on a general purpose linux distribution should give you more information about it and the required kernel module.

You do need a module matching the requirements of your UPS, if that one comes with RS232C and a DB9 connector, your module needs to have that as well <-- important, the voltages must match, otherwise you will damage the other end.

[quote="slh, post:2, topic:192488"]
kmod-usb-serial-pl2303 is installed?[/quote]
Yes.

[quote="slh, post:2, topic:192488"]
Testing the module on a general purpose linux distribution should give you more information about it and the required kernel module.[/quote]
Unfortunately I don't have linux distribution - only Windows.

[quote="slh, post:2, topic:192488"]
if that one comes with RS232C and a DB9 connector, your module needs to have that as well[/quote]
No, the module is completely “naked”, like this: https://aliexpress.ru/item/4001267331390.html

You can download linux and install it onto a thumb drive, then boot from that. You don't have to actually install linux on your computer.

As @slh stated, the voltages/standard needs to be consistent. You should check the specifications for the UPS you are trying to connect to find out if it is RS232, TTL, or something else. It should state in clear language in the specifications section of the manual.

I know this, but what will it give me? What should I see “there” (in Linux) that will help me understand what is happening under OWRT?

Yes, there is no UPS as such yet - I’m just trying to look at the status of the port and signals. As they wrote to me, "there should be a pseudo-file that will contain the status of the port and all signals. Something like this:

serinfo:1.0 driver revision:
0: uart:ST16650V2 mmio:0x11002000 irq:121 tx:216 rx:0 RTS|CTS|DTR|DSR|CD|RI
1: uart:unknown port:00000000 irq"

You can use lsusb and other tools to identify the specific chipset and drivers that are loaded. Since OpenWrt is linux based, this information is useful because it can help ensure you've got the right packages to install (most big-distro linux will have the drivers pre-loaded, but OpenWrt, to save space, doesn't).

So then what connects on the other end of the serial adapter?

From the pre-historic days, when using RS232: When only Rx/Tx available, you can prepare a 'null-modem' to provide modem control signals like CD, RTS etc.

Sure. But the op hasn’t specified what is expected here. The adapter needs to be connected to something, even if it is just a loop back. But a loop back doesn’t really seem to be terribly useful in this scenario.

The packages are correct, I'm sure of it. Also, lsusb is available in my OpenWrt; it shows the presence of the device (pl2303): "Bus 001 Device 011: ID 0403:6001 pl2303"

For now, I’m just trying to determine the state of the port, find the pseudo-file I wrote about above. I was simply assured that there should be one - “ttyUSB0”. With the content, a fragment of which I provided above. Then - I would like to see whether it is possible to receive (read) a signal from the RX input, whether it is possible (programmatically) to monitor changes at the same input (RX). Say, if you connect RX to a common signal, will such a state be read stably?

This is true. But I just don’t know where to go yet - can I... Then, in fact, everything is set out in my 1st post: Can I somehow monitor the status of pl2303 /dev/ttyUSB0?
I don't see ttyUSB0 file in /proc/tty/driver directory (nevertheless, /dev/ttyUSB0 is it where it should be and can be "read" with cat).

I tried, as I wrote above, connecting the RX signal to the common one - it had no effect. Perhaps, as I read somewhere, it’s also worth trying to connect the RX and TX signals to each other?

The problem is that TS tries to create dumb DIY UPS from batteries and cheap charging aliexpress board. He doesn't want to implement the UPS protocol fully, he want only to know: are there power from the inlet, or he is on the batteries (to stop power-hungry services like samba and stop USB HDD). There are two possibilities: to implement full UPS protocol, or to send 0 instead of 1 to any COM-port status that can be detected by router itself. AFAIK it can be DCD (+1 - there is power source from the inlet, or 0 - we're on batteries). The problem that how to read it (and can it be done through pl2303/ftdi UART)?
Can DCD (or any other status) can be read through USB UART (or it is always "ON")?

define the "common one" -- ground? That would be expected. The ground is the reference 0-volts, you won't see anything if you ground your Rx line.

If you connect Rx to Tx, you get what's known as a loopback. Every character you send via the tx will go into the rx line and be displayed on the screen (when running a terminal emulator against the adapter.

Have you tried it in (big-distro) linux to ensure that it is enumerates as expected and that you can connect to it with a terminal emulator?

Is this speculation, or are you working with the OP on this project?

If this super simplified approach is what is desired, the OP would be better off with a small GPIO adapter instead of serial.

This is a statement of fact ))

What is a "small GPIO adapter" in this context? For example?

Something like an adafruit / arduino type device, a Pi, or other devices that have GPIO. There are also networked relay/GPIO devices

I assumed that we would talk about this - I was already advised this. But I would like a solution that is as simple as possible, especially since, I repeat, I don’t need full control of the UPS parameters, I just need to determine the absence of the UPS supply voltage (U). This is not needed for the same UPS control; I only need to "pass the command" to OpenWrt to execute the script.
In general, the question is: is this really a consequence of the USB -> UART module, specifically on the PL2303 USB:
https://aliexpress.com/item/4001267331390.html

I have a hard time understanding the original question here. It's quite obvious that a module exposing only the TX and RX pins of an UART chip doesn't fit the purpose. But there are other modules out there. For example:
https://www.sparkfun.com/products/12731

I'm sure there are PL2303 examples too. I just didn't bother searching. The lack of DCD/RTS or generic GPIO support has nothing to do with the bridge chip. That's only a module implementation detail. If you look at the Prolific datasheet you'll see that the chip supports lots of signals:

Note that most of the "PL2303" modules out there don't have any Prolific chip at all, so modifying one of those 4pin modules might not work.

Clear. It looks like we need to look for another implementation of our idea...
Perhaps there are some other simple options? Offers?
I don’t actually need the implementation of a UPS, as such - I’m only interested in the UPS as a power source from which everything will work. Basically, it could just be “phase B” or “phase C”, but I need to control the voltage on “phase A”.

Is there a reason you aren't just looking at a purpose built UPS? (too expensive, doesn't have the right specs, etc.)?

Most modern UPS devices have a USB port and you can just NUT (Network UPS Tools) to get status and to trigger actions like spinning down HDDs or shutting down other equipment.

Eat. This is simply unnecessary for me: the minimum power UPS is used only to operate the “Router (OWRT) + Storage” combination. All I need is to correctly unmount the drive in the event of a global power outage.

I have a homemade UPS based on a Chinese module; of course, there is no USB port there. There's nothing there at all! UPS, just UPS! ))
Something like: https://aliexpress.ru/item/1005005347480845.html

Really the question - how can we get the ttyUSB0 port status? In OWRT 23.05.2 there is NO such file as ttyUSB0 in /proc/tty/driver unfortunately (at least, it is so at mt7621 platform router Smartbox Giga).
At my filogic I can see built-in serial UART:

root@OpenWrt:~# ls -al /proc/tty/driver
dr-x------    3 root     root             0 Mar 18 22:38 .
dr-xr-xr-x    6 root     root             0 Mar 18 22:38 ..
-r--r--r--    1 root     root             0 Mar 18 22:38 serial

So I can easily get status of built-in serial port (it's not pl2303, it's built-in serial in Asus TUF-AX4200!):

cat /proc/tty/driver/serial 
serinfo:1.0 driver revision:
0: uart:ST16650V2 mmio:0x11002000 irq:121 tx:216 rx:0 RTS|CTS|DTR|DSR|CD|RI
1: uart:unknown port:00000000 irq:0
.........

So, the only needed string is string 0, especially port statuses that easily can be parsed with awk or something similar.
The only thing that we can't find the file ttyUSB0 with port status anywhere (or it is located in the unusual place with no references at stackexchange etc) - although /dev/ttyUSB0 is present where it should be!