PocketC.H.I.P. has arrived!
Yesterday evening my C.H.I.P. and PocketC.H.I.P. finally appeared in the mailbox, and in no time I had them up and running. The C.H.I.P. by itself is a really cool gadget, but the PocketC.H.I.P. is, to quote Steven Combs:
The geekiest gadget I have ever owned.
With the clear case and the exposed-electronics design, it fits perfectly in the category of gadgets that most geeks and tinkerers would fall in love with. Personally guaranteed!
I had an old Nokia plectrum lying around in a drawer - I think it belonged to my Nokia 5800 - and it seems to be a really good fit as a stylus for the PocketC.H.I.P.’s resistive touchscreen. In the picture you can also notice the actual effectiveness of the pencil-powered stand. Nice idea, NTC. *tips hat*
During these two days I’ve had the chance of discovering a lot of nice tweaks and mods for this device, here they follow in no particular order.
SSH server
Maybe one of the first things that you’d want to set up: typing on the PocketC.H.I.P.’s keyboard surely brings some fun, but maybe it’s not comfortable enough for repetitive installation commands. Without further ado, here are the commands needed:
1 | sudo apt-get update |
Those commands will install both the SSH server and client (in-field portable server debugging console, anyone?), and will disable the automatic startup of the service via systemd. This way you won’t waste precious battery, and you’ll be able to start the service just by typing sudo systemctl start ssh
. If you prefer you may also setup aliases for faster access:
1 | echo 'alias sshon="sudo systemctl start ssh" >> ~/.bashrc' |
Install a bunch of common utilities
1 | sudo apt-get install git mosh curl netcat nmap telnet vim-nox zsh lynx mtr python3 python3-pip iceweasel locales xinput-calibrator |
Pretty much self-explanatory. No? Ok, here goes a description.
Package | Description |
---|---|
git | The version control system we all use and love. |
mosh | An improved version of SSH, especially useful for slow or crappy connections. |
curl, netcat, nmap, telnet | Should I explain these |
vim-nox | Text editor (obligatory references). This variant of the package includes python bindings. |
zsh | Awesome bash replacement - I can’t live in a shell without it. |
lynx | Text-based web browser. |
mtr | “My TraceRoute”, a nice tracing tool to monitor the network state. |
python3, python3-pip | Newest Python version and its package manager. |
iceweasel | Debian’s clone of Firefox, we’ll see in a moment why this is useful. |
locales | Locale generator, once again refer to next sections of the article. |
xinput-calibrator | Touchscreen calibrator. |
If during the installation if the locales
package you get stuck, see the section hereafter.
Set the locale
This step is mandatory if you want to use Mosh or the Powerline fonts!
Having already installed the locales
package, you should have encountered its setup and having generated your chosen locales.
If not, or if you want to repeat the setup, issue:
1 | sudo dpkg-reconfigure locales |
and you will be greeted with the locales setup. Choose what configurations to generate by moving with the arrow keys and selecting/deselecting with the SPACE key (personally I use en_US.UTF-8
and my native, it_IT.UTF-8
, so at least I always have the English locale available) and confirm the dialog by using the TAB key and SPACE to select. The selected locales will be generated.
Use the following commands to get everything in shape (obviously replace it_IT
with your locale):
1 | sudo update-locale LANG="it_IT.UTF-8" |
Optionally check if everything in the /etc/default/locale
file looks good.
Log out and back in to apply the changes.
Calibrate the screen
The touchscreen can be messy at times, especially in the upper part or in the corners. If you find this to be an annoyance, you can easily recalibrate the screen. Issue xinput_calibrator
and tap the onscreen crossbows as precisely as you can.
On completion it will output something like this:
1 | Section "InputClass" |
Open the file /etc/X11/xorg.conf
with your favorite editor (psst… You’ve just installed vim!) and paste that output at the end of the file.
Install Oh-My-ZSH
A ZSH shell isn’t complete until you’ve installed oh-my-zsh. This should be enough to get you started:
1 | sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
Fix some keys in ZSH
Some keys (especially the ‘-‘ hyphen symbol) doesn’t seem to be understood correctly by the ZSH shell; the problem is that, given the default keymap for the PocketC.H.I.P., those keys are mapped as NumPad ones.
I must thank db2 for the workaround: change the lines for keycode 82
& 86
in the file ~/.Xmodmap
to read:
1 | keycode 82 = minus underscore F11 minus |
And make sure the file is read by the shell at login:
1 | echo "xmodmap ~/.Xmodmap" >> ~/.zshrc |
Now the minus (-
) and plus (+
) keys will be recognized correctly, as they are interpreted as proper characters instead of numeric keypad keys.
Install the Powerline fonts and plugin
Powerline fonts are always a mess for me to install, I always have to patch things at random to make them work the first time. Because of this I’ll send you to the official documentation, backed by the official FAQs and Lev Lazinskiy‘s summary for further instructions.
You can do it! Just… keep trying if they don’t seem to work.
Custom applications in the home screen
Last but not least, here’s a gallery on imgur by the user BladeMaverick that shows you how to change the default shortcuts in the device’s home screen. You can see that, for example, I opted for having Iceweasel (Firefox) instead of the “Get Help” icon.
Browsing from such a small screen isn’t the best user experience ever, but hey, it’s definitely flippin’¹ useful for in-field documentation checking!
¹ Obligatory reference
Custom home screen background
Another little aesthetic tweak that you can pull off easily is replacing the home screen’s background; just make sure that your custom image is 480x272 px
and is in PNG
format. Copy the image on an USB drive and insert it in the PocketC.H.I.P.’s USB port, ignoring eventual popups asking if you want to browse the drive.
1 | sudo cp /media/chip/'[PRESS TAB TO AUTOCOMPLETE THE NAME OF THE DRIVE]'/yourImage.png /usr/share/pocket-home/mainBackground.png |
Aaand you’re done. Either reboot the C.H.I.P. or issue sudo systemctl restart lightdm
to apply the changes.
Image courtesy of user midheaventech on the NTC’s BBS.
Disaster recovery
In case something goes wrong and you end up making a mess of the system, you can either:
- Reflash the C.H.I.P. (see here for advanced help)
- Try to get into the serial console and fix things.
And that’s all I’ve got on my mind at the moment. Let me know via my social accounts if I’m missing something useful!
Have fun with your PocketC.H.I.P.