Enable Console on PiScreen

Enable Console on PiScreen

To move the console from the HDMI/RCA to PiScreen you have to updated /boot/cmdline.txt

1. Backup cmdline.txt

pi@raspberrypi ~ $ cp /boot/cmdline.txt ~/cmdline.txt

2. Update cmdline.txt

pi@raspberrypi ~ $ sudo nano /boot/cmdline.txt

Add the text below to the end of the first line. Not on a new line as this will not work.
Rotate will rotate the console on PiScreen. Rotate can be 0, 1, 2 or 3.

fbcon=map:10 fbcon=rotate:2 fbcon=font:ProFont6x11

3. Reboot

Reboot for the changes to take effect.

pi@raspberrypi ~ $ sudo reboot

Calibrating Console

First, we need to find out what file handle is used for the touchscreen on the PiScreen.

pi@raspberrypi ~ $ ls -l /dev/input/event*

A file handle is created for each input device currently connected and can change depending on what is connected and how many input devices are connected.
If you have a keyboard and mouse connected, there should be 3 files.  One for the keyboard, one for the mouse and the last one for the touchscreen. If you have just a keyboard connected, there would be two. One for the keyboard and one for the touchscreen.
To see what file handle is used for the touchscreen, view the file below.

pi@raspberrypi ~ $ cat /proc/bus/input/devices

Look for ADS7846 Touchscreen and within the same section you should see H: Handlers= followed by an eventnumber. This will tell you what file under /dev/input/ is used for the touchscreen.

Going forward, use the input event number associated to your touchscreen in the commands below.

ts_lib is used to calibrate the touche screen for console use. ts_lib also includes some other tools to test your touchscreen.

pi@raspberrypi ~ $ sudo apt-get install libts-bin

Now run the ts_calibrate utility, while setting the framebuffer device and touchscreen device variables;

pi@raspberrypi ~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate

ts_lib also includes a test utility to test your touchscreen;

pi@raspberrypi ~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_test

Running ts_print will output the coordinates of the touchscreen when pressed;

pi@raspberrypi ~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_print

To view raw events of the input system, E.g. touschscreen input, we can use evtest.

pi@raspberrypi ~ $ sudo apt-get install evtest

Run evtest with;

pi@raspberrypi ~ $ evtest /dev/input/event0

Console Blanking

By default, the console will blank out after 30 mins.
This can be changed by editing the value

BLANK_TIME=30

in /etc/kbd/config.

Setting this value to '0' will disabling blanking.

Once you have enabled the console on PiScreen, you should head over to here to learn how to enable X Windows on your PiScreen.

Blip, blop, bloop...