Introduction

When I travel on vacation I usually pack a Chromebook for reading emails and surfing the net - they're lightweight and more than adequate for these tasks. On a recent trip however, I started wondering if it would be possible to use a Chromebook instead of a Raspberry Pi for controlling Pi-Plates. And, as it turns out, you can! Even if you don't need to use our products, you can still use your Chromebook as a Linux laptop for writing and testing Python code.

Why a Chromebook?

Chromebooks are basic laptops that have a limited amount of RAM and small amounts of eMMC memory for program space. They're really designed to connect to Google's ecosystem as web appliances. But, you can bypass all of that and install a limited version of Linux called Crostini which is a Debian-based Linux container inside a virtual machine (VM), that enables you to use desktop applications, code editors, and command-line tools right alongside ChromeOS apps.

If you don't already have a Chromebook then you can find inexpensive ones on Craigslist, Facebook Marketplace, eBay, Walmart, or even an open box from Best Buy. If you do choose to purchase a Chromebook, let me make some hardware recommendations:

  • Get 32GB of eMMC memory or more. A lot of cheap Chromebooks only come with 16GB. And since the recommended size of the Linux container is 10GB, that will eat up a lot of space when you only have 16GB to start with.
  • Get a 14" or larger display - it will be easier on your eyes and it will most likely have FHD resolution. I used a 720p 11" Chromebook for a couple of years to manage inventory and print shipping labels - it was painful.
  • Make sure you get something relatively new (<5 years old) so that you can receive updates. There's a LOT of Chromebooks for sale out there that are too old for updates.
  • Avoid the Chromebooks that are advertised as For Parts Only 😀

I snagged an open box ASUS CX14 14" FHD Chromebook Plus with an Intel Core 3, 8GB Memory, and 128GB eMMC for $112.99 from Best Buy a week before writing this:

The text on the image reads: "M Jun 17 12:30 ASUS - | EC.E i .. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Installing Linux

Enter the Settings page, scroll to the bottom of the left panel, and click on About ChromeOS.   Then scroll the right pane down until you see the Developers options:

Click on Set Up. You may see a message asking you how much memory to allocate for Linux with a default of 10GB. If you have 16GB of eMMC then 8GB should be enough.

Give the machine a few minutes to set up and you should soon have a terminal window available that looks like:

Click on the penguin container to launch Linux. Once the Command Line Interface (CLI) appears, do the usual Linux thing of:

sudo apt update
sudo apt upgrade

Close and reopen the container to ensure all the upgrades are in place. At this point you can start coding in Python using a text editor. But we're not done yet. First, we may want to install some Python libraries with pip. However, pip is not included with this Python distribution so we need to add it with:

sudo apt install python3-pip

Now maybe you want to...

Install an IDE

If you are like me you prefer to use an IDE for developing Python code. I'm a big fan of Thonny and it can be installed from the Linux command  line with:

sudo apt install python3-tk -y
sudo apt install thonny -y

After the above commands are run, a Thonny shortcut should show up as a Chromebook app in a Linux Container:

And clicking it will bring up the Thonny IDE:

Or maybe you prefer something a bit more professional like Visual Studio Code. To install it do the following:

  • Download the Debian/Ubuntu version from the Visual Studio Code website here: https://tinyurl.com/2cf73uv9
  • Move the downloaded *.deb file from the download folder to the Linux files folder
  • From the Linux command line, install with:
    sudo apt install ./code*.deb
    where "code*.deb" is the name of the downloaded VSCODE program. For us it was "code_1.126.0-1782208079_amd64.deb"
  • After you answer a few questions and link your Microsoft and/or git accounts, you should be good to go:
  • After installation, install the Python extensions and start coding.
  • Delete the deb file after installation to free up disk space

You now have a Chromebook that can run Linux along with a graphical IDE for writing Python code. If you don't plan to use your Chromebook to control Pi-Plates then you can stop here. But if you want to control Pi-Plates...

Controlling Pi-Plates

To control Pi-Plates, we need to add a few more Python modules. Run the following command from the Linux CLI:

pip install --break-system-packages Pyserial Pi-Plates Pmw

Next, mount your Pi-Plates on top of the BRIDGEplate and plug it into a USB A port on the Chromebook. You might get a message that asks if you want to control the serial port with the Chrome OS or Linux - choose Linux.

After the LED on the BRIDGEplate starts to blink, start a Python session and run the following two commands:

from piplates.BRIDGEplate import *

POLL()

And viola, you should be communicating with your BRIDGEplate:

PIPLATElogger

Want to log data using PIPLATElogger? Then follow these steps:

  • Run sudo apt install git from the Linux command line
  • Download the repository with git clone https://github.com/pi-plates/PIPLATElogger-PC.git
  • Enter the logger subdirectory with cd PIPLATElogger-PC
  • Launch the logger with python3 PIPLATElogger-PC.py

And voila, you can now use your Chromebook as a data logger:

Note that the log files are saved in a format called CSV so when you open them, your Chromebook will default to Google Sheets.

Wrap Up

I fully expected this to be a long arduous task. But it was surprisingly easy to do. In the end, I hope it was educational, helpful, and brings life back to an unused or refurbished Chromebook.