Hardware Reference
In-Depth Information
or on Debian/Ubuntu:
$ su -c 'apt-get install screen'
Once installed, to use screen to connect to the Raspberry Pi UART serial device, run:
$ screen /dev/ttyUSB0 115200
To exit the screen session, type Control-A K.
Using the Serial Device as a Login Console
Raspbian preconfigures the UART serial device as a login-capable console, but Pidora
does not. To enable the UART serial device as a login console session, run:
$ su -c 'systemctl start serial-getty@ttyAMA0.service'
This will turn it on immediately. If you have a serial cable connected, you should see
a login prompt appear. To make this login session permanent (and automatically
loaded on boot), simply run:
$ su -c 'ln -snf /usr/lib/systemd/system/serial-getty@.service \
/etc/systemd/system/getty.target.wants/serial-getty@ttyAMA0.service'
By making that symbolic link in the systemd directory tree, you are telling systemd to
start the ttyAMA0 device as a “getty” or login console.
Fun Serial Console Trivia
The name “getty” comes from the term “get teletype.” A teletype was originally a
device with a typewriter for input and a printer for output for use as telegraph
machines, but as computers evolved, these devices found a use as a method of
inputting data to a computer. The teletype was also widely used in a “receive only”
format in newsrooms in the 1940s and 1950s. The “clickety clack” sound effect of
news coming in “over the wire” is that of a teletype. Eventually, these devices be-
came proper serial consoles, and they are the reason why we call console devices
in Linux “TTYs”.
Both Pidora and Raspbian come with the UART serial device preconfigured as a con-
sole for kernel messages. You can see this in the /boot/cmdline.txt file:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 con
sole=tty1 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait quiet
The console value tells the Linux kernel where to output messages at boot time, and
the kgdboc value enables kernel debugging over that console.
 
Search WWH ::




Custom Search