I recently needed to reset the password on an old APC UPS which requires connecting their proprietary serial cable, hitting the reset button, and logging in with the default username and password over the serial interface. I connected it to the serial port on an R720XD, and passed the port through to a Ubuntu VM.
I used stty
to configure the serial port according to APC's documentation, launched screen /dev/ttyS0 <options>
, and went to work. For some reason, the output was a total mess. It seemed like it would pick up the first 3-4 characters of every transmission, then miss the rest. I tried minicom
with the same results.
So I did a loopback test - connected RX and TX together - to see if what I sent would come back in. Same issue. I hooked up an oscilloscope to the wire and discovered that every keypress was sent properly; I could see it going over the wire. But for some reason, most of the characters wouldn't show up on screen
.
I then discovered that if I did cat /dev/ttyS0
in one terminal, and echo alongstring > /dev/ttyS0
in another, I could see everything just fine!
I ended up just leaving the cat
open to view the incoming bytes, and running screen
in another terminal to send keypresses, which worked just fine and was a lot easier than using echo
over and over. Password was successfully reset using this.
But now I'm curious... does anyone have any ideas why screen
and minicom
had issues? I tried every option I could find in man
, but no luck. It seemed like there might be something else pulling the bytes out of the buffer, but I have no idea what that could be.