VT510 and RaspberryPi
Last update date: 08/05/2017
This was something I wanted to do forever now. Connecting a VT510 to a RaspberryPi and then showing something on the terminal; access logs, server usage, any other kind of fun data, or even just using it as a terminal screen to my MacBook.
Since this is just a start of the project, there isn't a lot I did. I'll update this page and share it around as we go. In the end, we'll have a full build log with photos and steps to do it your self. I'm done! 🎉
- a VT510 terminal - I found mine on local classifieds for about $20
- a RaspberryPi - I chose a RaspberryPi Zero with wifi for this project (it was about $11 with shipping)
- a RS232 to TTL adapter - I found one on eBay for $0.99 with free shipping
- a DB25 to DB9 adapter - again, off eBay for $1.99 with free shipping
Connecting it up
Connecting everything was simple. I've followed the GPIO pinout guide and connected VCC, TX, RX, and GND from the TTL converter to the RaspberryPi Zero. Without configuration, nothing was showing.
Next up was enabling the serial connection on Raspberry Pi. I've edited the
/boot/config.txt file and at the very end added
enable_uart=1. A quick reboot later...
I've changed the VT510 transmission and receiving speed to 9600. The same had to be done to the Raspberry PI. To see if everything was working I did
stty -F /dev/ttyAMA0 9600 and 🎉 the login was working.
Since this was nothing more than a display piece having the keyboard connected to log in was not an option. So I configured autologin on serial connections.
/etc/systemd/system and rename it to
firstname.lastname@example.org. Open the file and edit the following line:
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
ExecStart=-/sbin/agetty -a pi serial0 9600 vt510
Save the file and enable the service:
systemctl enable email@example.com
There is one more thing left to be done! Disabling the serial on boot since this will mess up our tmux session later on. This was a hard one to debug.
/boot/mdline.txt and remove the
console=serial0 part. Be careful and leave only one space between the params.
As I said before this was meant to be setup as a display piece. So tmux had to be started at the login. Since I didn't want to start tmux on SSH login, I had to modify the default way of starting tmux.
At the very end of
~/.bashrc I added this:
[[ $(tty) == "/dev/ttyS0" ]] && [[ $TERM != "screen" ]] && exec tmx
A quick restart later tmux showed! Note that nothing wiill be showing until the device is booted up since we disabled all of that.
And yet another vendor decided to ditch the 3.5 mm jack from a phone. A standard that's been around from the 50's... https://t.co/cnqwY4ZI3V— ⚛ Andrei Zvonimir (@andreicek) August 5, 2017