A voice-activated label printer utilizing Google Assistant, a Raspberry Pi, and a Dymo LabelWriter.
OK Google, print a label called "Awesome"
This is a client that runs on a Raspberry Pi connected to a Dymo LabelWriter. The Pi should have CUPS installed, along with the appropriate Dymo drivers. Technically, this doesn't have to run on a Pi. It can run on any computer that has access to a CUPS print queue. However, I've only tested it on a Raspberry Pi.
There is also a server (of sorts), in the form of Firebase Cloud Functions.
Finally, an IFTTT applet listens for commands from Google Assistant and dispatches requests to the Cloud Function endpoint (via a Webhook action).
This project is only compatible with Python 3. It will work with Python 3.7+ at least, and may work with older versions of Python 3, but these haven't been tested. It is not compatible with Python 2.
Ensure you have a Dymo LabelWriter connected to a Unix-like system running CUPS, and that the computer can print to the Dymo.
Setting that up is outside the scope of this document, but this guide is pretty helpful.
Ensure texlive
is installed on your system. If on a Raspberry Pi, it may be already installed.
Run pdflatex
on the command line to find out. If not, it's fairly easy to install.
On the command line run:
sudo apt update
sudo apt install texlive
apiKey
databaseURL
projectId
cd
into the cloned directory.env.example.sh
to env.sh
. e.g. cp env.example.sh env.sh
.env.sh
and edit several values:
LC_FIREBASE_APP_NAME
to the value of projectId
.LC_FIREBASE_KEY_PATH
to the absolute path of the location where you copied the private key file.LC_FIREBASE_API_KEY
to the value of apiKey
.LC_FIREBASE_DATABASE_URL
to the value of databaseURL
.LC_CUPS_PRINTER_NAME
to the name of the CUPS printer queue of your LabelWriter. This value will get turned into the command:
lp -d LC_CUPS_PRINTER_NAME filename
Ensure you can print to your Dymo this way from the command-line before proceeding.
make setup
to get your virtual environment bootstrapped.make run
to start the client.sudo make install
.sudo make uninstall
.Now, head over to Label Commander Server and follow the instructions there to get the cloud functions running and configure an IFTTT applet to interface with them.
The templates
directory contains a LaTeX template (label.tex) that defines the format of
the printed label. You can change this template to customize the size and content of the label.