Setting up PocketCHIP
So I got a couple of these fantastic little embedded systems from Next Thing, and started to try to set one of them up how I would like to see it setup. Basically I was looking for a web browser, SSH installed, and a few aliases to make things easy to work with.
NOTE: All of the operations below assume a basic understanding of terminal commands!
To start off, the PocketCHIP OS is slightly out of date as it’s currently being flashed, so the first thing we need to do is update the OS to current:
Now lets go ahead and install the needed packages (Note: “\” and lines are used here for page cleanliness).
Next we will disable SSH from starting automatically:
So now technically all of the software was installed (that was easy), but now we want to make the needed configuration changes to make everything behave how we expect it to. I’d recommend actually doing everything from hear-on out through SSH, as you’ll have the benefit of a full-size keyboard.
with the small keyboard, it makes a lot of sense to build-in some aliases to commonly-used commands. This will save a lot of keystrokes overall and can only improve the overall experience. I prefer to shim into the user profile in a manner that means that I’m not constantly editing the default user profiles, as there is plenty in there that you simply don’t want to touch. To do this, we will do the following:
Step 1: create the profile scripts directory. This directory will house our custom additions to the shell environment and allows us to more easily extend the shell in a safer manner.
Step 2: using either
nano, we will need to append the following to the end of the
Step 3: Now that the user’s profile is set to load anything with a .sh extension into the profile, lets create an aliases file and input the aliases that we want to use. Using either
nano, create a new file at
~/.profile_scripts/aliases.sh and input the following into the file (and feel free to modify as you see fit):
Step 4: Now to get these changes to apply to the current shell, you simply need to
source ~/.bashrc and it will reload the shell environment based on these new settings.
Next we will want to add the browser to the home screen so that it is easily accessible for general use. As the PocketCHIP home screen only supports 6 icons, we will need to replace the help documentation with the browser. To do so we will need to modify the definitions file for pocket-home to point to the browser. Using
/usr/share/pocket-home/config.json and look for the help icon and change this definition to look like below instead:
Once you have saved the change, we will need to bounce the pocket-home GUI by typing
sudo skill pocket-home. If you have made an error in the configuration, you will not see the GUI come back up and just see the PocketCHIP logo on the screen (it may take a minute or so for the GUI to show up). If this is the case, don’t fret, just re-edit the file and and bounce the application again. This is why we are making these changes over SSH, eight ;).
DWB is a really decent webkit-based browser (same engine thats in chrome), however we need to make some minor configuration changes to the browser to support the low resolution of the PocketCHIP and to mimick a mobile device so that we load less resource intensive pages. To do this we much first start DWB from the PocketCHIP (using the
dwb command) so that it will write it’s initial configuration file and then
CNTRL+X to exit it. Once thats done, we will open the configuration file from the SSH console and make the appropriate changes. For brevity, I have listed the relevant changes that you will need to make in the file, simply look for each line below and modify as appropriate:
As DWB is keyboard-heavy for navigation, you may want to look at the DWB Manual in order to get a good understanding of what to do. I personally fine the simple cheat-sheet below enough to get by for most uses:
- CNTRL+Q - Quit
- o - Enter URL (Open)
- h - Go back
- l - Go forward
- Scrolling = Arrow keys
Now with these changes in place, go ahead and attempt to launch the browser from the home screen. If all is well, the browser should come up and everything should look good. A good test is to goto slashdot.org or google.com and see if the page is rendering as we should expect (no scrolling, mobile site, etc). If everything looks good, then your done!
I have also built a script to automate all of the actions mentioned in the above post, please see the PocketCHIP Browser Installer Script post for information on how to use it.