Setting up text mode on PocketCHIP 4.3

From www.chip-community.org
Jump to: navigation, search

Introduction

This guide includes the steps I needed to go through to get the PocketCHIP to work properly in text mode. These instructions work only on pocketCHIP 4.3 firmware, but I hope we can achieve the same thing later on 4.4.

For this guide you need to have WiFi enabled and connected. Let's begin.

Upgrade the system

Open the Terminal from PocketCHIP menu. Upgrade the package lists and download latest packages by commanding:

sudo apt-get update && sudo apt-get upgrade

Enable the SSH server for easier setup

sudo apt-get install openssh-server

To be able to connect to your Chip, you need to know the IP address:

ip addr

Disabling graphical login

sudo systemctl set-default multi-user.target

To assure that the ssh server starts at boot in the new systemd target:

sudo systemctl enable ssh.socket

It's time to reboot now:

sudo reboot

Getting the keyboard to work

Now that we are in the text mode, you may login with username 'chip' and password 'chip'. The keyboard's FN modifier doesn't work. We need to fix that.

sudo apt-get install kbd

Next, we need to create a new keymap. I prefer to do this via SSH on my laptop. Create a new file called ~/pocketchip.kmap and paste this there (Credits to SKarp):

keymaps 0-2,4-5,8,12
altgr keycode  2 = F1
altgr keycode  3 = F2
altgr keycode  4 = F3
altgr keycode  5 = F4
altgr keycode  6 = F5
altgr keycode  7 = F6
altgr keycode  8 = F7
altgr keycode  9 = F8
altgr keycode 10 = F9
altgr keycode 11 = F10
altgr keycode 74 = F11
shift keycode 74 = underscore
altgr keycode 13 = F12
altgr keycode 21 = braceleft
altgr keycode 22 = braceright
altgr keycode 23 = bracketleft
altgr keycode 24 = bracketright
altgr keycode 25 = bar
altgr keycode 35 = less
altgr keycode 36 = greater
altgr keycode 37 = apostrophe
altgr keycode 38 = quotedbl
altgr keycode 48 = grave
altgr keycode 49 = asciitilde
altgr keycode 50 = colon
altgr keycode 52 = semicolon
shift keycode 52 = comma
altgr keycode 53 = backslash

Next, you need to load the keymap (on the device, SSH will not work for this):

sudo loadkeys /home/chip/pocketchip.kmap

If it works, we need to dump the keymap config to get the full configuration (still on the device):

keydump > /home/chip/keydump.kmap

Then we move the dumped keymap to proper place:

sudo mv /home/chip/keydump.kmap /usr/share/keymaps/pocketchip.kmap

To make the keymap persistent, add "/usr/bin/loadkeys /usr/share/keymaps/pocketchip.kmap" to /etc/rc.local before "exit 0"

Now it's a good time to change the password, when you can type all the letters:

passwd

Maybe lock the root account?

sudo usermod -L root

And reboot.

sudo reboot

Installing locales

Without locales many things on the command line constantly nag you about it. We need to enable them:

sudo apt-get install locales
sudo dpkg-reconfigure locales

I selected en_US.UTF8, do as you wish.

Change the console font

By default the font is quite hard to read. We can change that:

sudo apt-get install console-setup
sudo dpkg-reconfigure console-setup

I recommend choosing the smallest variant of Terminus.

Add additional stuff

There are lots of useful utilities for command line, but at minimum I recommend these:

sudo apt-get install bash-completion openssh-client

How to access graphical environment again?

You can start the graphical environment by commanding:

startx

If you want to start the graphical environment by default again, you can enable it like this:

sudo systemctl set-default graphical.target