Skip to content

Instantly share code, notes, and snippets.

@albertfilice
Last active September 13, 2020 21:23
Show Gist options
  • 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
@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