In our last episode, our intrepid hero lamented the lack of hardware flow control on the TTL-based something-like-a-serial-port that the Raspberry Pi provides. Well, in the comments someone pointed out that the Pi hardware actually does support flow control on the serial line, after you jump through some hoops to activate the "secondary function mode" on a couple of random pins. So I hooked that up.
But, unsurprisingly, it did not just magically work on the first try.
There are any number of things that could be going wrong here, so the first question I want to ask is probably, "when the Pi attempts to turn RTS on and off, does the light on my serial tester cable change state?"
So like, how do I do that? How do I toggle the RTS line through software?
Also, I'm not 100% sure I'm hooking up the right pins. Some sanity checking, please?
(Fun fact that I managed to go my entire life until today without realizing, which suddenly explains so many things: did you know that the RS232 DB25 spec has TX/RX on pins 2/3, but the RS232 DB9 spec swaps them to 3/2? And that is not for a null modem.)
So. The DB25 on the terminal is using pins 2 (TX), 3 (RX), 4 (RTS) and 20 (DTR). Pin 5 (CTS) is wired to ground.
This has made me realize that I don't actually know the difference between DTR and CTS. I thought they were synonyms, not different pins. Uhhhh...
So here's how I wired it up. TX/RX are swapped to null-modem it, as are RTS/DTR. Does this seem right?
Update: No, that was wrong, I got turned around: CTS is not wired to ground. However, there is a DTR with no corresponding DSR. So this is more sensible:
Also, some questions about booting Debian, unrelated to serial ports:
The Raspbian install I'm using uses systemd, and is presumably loading a zillion services that I do not need like disk quotas, "remote file systems", "encrypted volumes", etc. How do I tell what it's doing and how do I identify and disable the useless cruft? ("Replace systemd with something else" is a common suggestion that is harder that it sounds.)
Also how do I make DHCP be non-blocking, that is, get me to a login prompt while the network is still negotiating?
And how do I make rc.local or something similar run as early as possible? Right now it runs very near the end.