Skip to content

Instantly share code, notes, and snippets.

@albertfilice
Last active September 13, 2020 21:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save albertfilice/0f12dc87f8d1ec02ef14 to your computer and use it in GitHub Desktop.
Save albertfilice/0f12dc87f8d1ec02ef14 to your computer and use it in GitHub Desktop.
VT220 Setup
#####
IF YOU'RE COMING HERE BECAUSE OF PROBLEMS MAKE SURE YOU HAVE THE PROPPER ADAPTER
I tried several adapters and the one from Tripplite works the best. Some don't work at all, others create a lot of gibberish on the VT220.
Link: http://www.amazon.com/gp/product/B0000VYJRY/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
#####
1. Installed drivers for USB -> Serial adapter
2. Run ls /dev/tty.*
I see my adapter as: '/dev/tty.usbserial'
3. Edit /etc/gettytab
Add the following lines at the end of gettytab:
std.ttyUSB:\
:np:im=\r\n:sp#19200:tt=vt220:
4. Create /Library/LaunchDaemons/serialconsole.plist with the contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>serialconsole</string>
<key>ProgramArguments</key>
<array>
<string>/usr/libexec/getty</string>
<string>std.ttyUSB</string>
<string>cu.usbserial</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Communications Set-Up on the VT220 V2.3:
---------------------------------------
Transmit=19200
Recieve=Transmit
XOFF at 64
8 Bits, No Parity
1 Stop Bit
No Local Echo
EIA Port, Data Leads Only
Disconnect, 2 s Delay
Limited Transmit
I have the serial adapter -> a DB9 to DB25 Male Null Cable -> DB25/DB25 gender changer -> COMM port on the back of the VT220
Running `sudo launchctl load /Library/LaunchDaemons/serialconsole.plist` does nothing. VT220 cursor blinking in top left.
Rebooting the computer with the VT220 plugged in and nothing happens.
I tried this:
Open the console and type `screen /dev/tty.usbserial 19200' and I get a blank screen with solid non-blinking cursor at the top.
Nothing changes on the VT220.
I saw this post: http://jstn.cc/post/8692501831
He mentions:
'Eventually I found this page (http://www.club.cc.cmu.edu/~mdille3/doc/mac_osx_serial_console.html), which explains the problem and how to fix it. After adding a line in /etc/gettytab to manually set the terminal type to vt220 everything works perfectly!'
However I can't seem to find out what he's talking about on (http://www.club.cc.cmu.edu/~mdille3/doc/mac_osx_serial_console.html).
1. Get a USB to Serial adapter.
I tried several, the only one that worked was a Tripp Lite Keyspan
Link: http://www.amazon.com/gp/product/B0000VYJRY/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
Drivers: http://www.tripplite.com/high-speed-usb-to-serial-adapter-keyspan~USA19HS/
2. Install drivers for USB to Serial adapter
3. Run the following command to see your device: `ls /dev/tty.*`
The result of the command is below:
/dev/tty.Bluetooth-Incoming-Port /dev/tty.KeySerial1
/dev/tty.Bluetooth-Modem /dev/tty.USA19H142P1.1
I'm going to guess that "/dev/tty.KeySerial1" is the correct device
4. You need to add to the file '/etc/gettytab'
You can edit it using the program vi:
`sudo vi /etc/gettytab`
Add the following two lines to the end of the file:
std.ttyUSB:\
:np:im=\r\n:sp#19200:tt=vt220:
5. Now you have to create the launch daemon that will give the login prompt to the terminal:
You can create the file using the program vi and name it whatever you want, I'm calling it "serialconsole.plist":
`sudo vi /Library/LaunchDaemons/serialconsole.plist`
Add the following 16 lines to "serialconsole.plist":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>serialconsole</string>
<key>ProgramArguments</key>
<array>
<string>/usr/libexec/getty</string>
<string>std.ttyUSB</string>
<string>cu.KeySerial1</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Replacing the line "<string>cu.KeySerial1</string>" specifically the "KeySerial1" part with the name of your device
6. Now you have to load up the daemon:
You can do that by restarting your computer or running the following:
`sudo launchctl load /Library/LaunchDaemons/serialconsole.plist`
If everything went smoothly your VT220 should present you with a login prompt
###########################
Some things to keep in mind
###########################
If cu.YourSerialDevice doesn't work then try tty.YourSerialDevice
@albertfilice
Copy link
Author

Humm ok cool thanks for the tips, I'll probably end up getting the same USB -> Serial adapter that JSTN used in his post, since that seemed to work for him. Which adapter did you use when you tried it with your Mac?

Even commands with minimal output seem to produce gibberish like pwd

The TOP command doesn't give me gibberish...
I just logged in again, to try to fiddle with things. I got the gibberish I usually do but decided to see what it would look like running top and surprisingly there doesn't seem to be any gibberish there.

I also tried man top and was able to move through the man pages without any gibberish...

I also tried playing around with the Ruby Gem "t" which can stream a twitter feed on the command line. When initially running the command there's a bunch of gibberish but once the stream moves on a bit everything smooths out.
Maybe the gibberish has something to do with the beginning and end of commands somehow?

@colegleason
Copy link

Hey, @albertfilice, I'm trying to get the same setup working and I could use some help. I have a Macbook Pro (2015) running macOS Catalina. I have connected the VT220 (with keyboard) to the Mac using the Tripp Lite Keyspan adapter you linked. The adapter is plugged into a DB9 to DB25 adapter (https://www.amazon.com/gp/product/B00066HJCA/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1) and into the COM port.

I can see the tty.KeySerial1, but I can't connect to it in CoolTerm or with screen. In CoolTerm I get a 100 error with "Access Denied" and in screen I get a window with a solid, un-blinking white cursor in the top left (I don't know the meaning).

I'm using the Keyspan drivers from Tripp-Lite. Any suggestions on how I could move forward and get connected?

@albertfilice
Copy link
Author

@colegleason Sorry I can't be of more help, but after reading your post and looking back I can't remember having that issue. Did you check your DB9 to DB25 adapter?

I don't have my terminal out anymore, I used to have it set up at work but was laid off from that job, and now it's in the closet of my small apartment.

I'm not sure how changes in macOS since I got mine working might impact things. Not sure what access denied means either. You could try to find somebody has one running on Catalina, but that probably isn't easy.

If I ever get mine out and working again I'll be sure to post the info.

@colegleason
Copy link

colegleason commented Sep 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment